b_asic.process¶

B-ASIC classes representing resource usage.
- class b_asic.process.MemoryProcess(write_time: int, life_times: list[int], name: str = '')¶
Bases:
ProcessIntermediate class (abstract) for memory processes.
Different from regular
Processobjects,MemoryProcessobjects can contain multiple read accesses and can be split into two newMemoryProcessobjects based on these read times.- Parameters:
- write_timeint
Start time of process.
- life_timeslist of int
List of ints representing times after
start_timethis process is accessed.- namestr, default=””
Name of the process.
- split_on_length(length: int = 0) tuple[MemoryProcess | None, MemoryProcess | None]¶
Split this
MemoryProcessinto two newMemoryProcessobjects.This is based on the lifetimes of the read accesses.
- Parameters:
- lengthint, default: 0
The lifetime length to split on. Length is inclusive for the smaller process.
- Returns:
- Two-tuple where the first element is a
MemoryProcessconsisting - of reads with read times smaller than or equal to
length(or None if no such - reads exists), and vice-versa for the other tuple element.
- Two-tuple where the first element is a
- class b_asic.process.MemoryVariable(write_time: int, write_port: OutputPort, reads: dict[InputPort, int], name: str | None = None)¶
Bases:
MemoryProcessObject that corresponds to a memory variable.
- Parameters:
- write_timeint
Time when the memory variable is written.
- write_port
OutputPort The OutputPort that the memory variable originates from.
- readsdict
Dictionary with
InputPortthat reads the memory variable as key and for how long after the write_time it will read.- namestr, optional
The name of the process.
- split_on_length(length: int = 0) tuple[MemoryVariable | None, MemoryVariable | None]¶
Split this
MemoryVariableinto two newMemoryVariableobjects, based on lifetimes of read accesses.- Parameters:
- lengthint, default: 0
The lifetime length to split on. Length is inclusive for the smaller process.
- Returns:
- Two-tuple where the first element is a
MemoryVariableconsisting - of reads with read times smaller than or equal to
length(or None if no such - reads exists), and vice-versa for the other tuple element.
- Two-tuple where the first element is a
- property write_port: OutputPort¶
- class b_asic.process.OperatorProcess(start_time: int, operation: Operation, name: str | None = None)¶
Bases:
ProcessObject that corresponds to usage of an operator.
- Parameters:
- start_timeint
Start time of process.
- operation
Operation Operation that the process corresponds to.
- namestr, optional
The name of the process.
- property type_name: TypeName¶
- class b_asic.process.PlainMemoryVariable(write_time: int, write_port: int, reads: dict[int, int], name: str | None = None)¶
Bases:
MemoryProcessObject that corresponds to a memory variable which only use numbers for ports.
This can be useful when only a plain memory variable is wanted with no connection to a schedule.
- Parameters:
- write_timeint
The time the memory variable is written.
- write_portint
Identifier for the source of the memory variable.
- reads{int: int, …}
Dictionary where the key is the destination identifier and the value is the time after write_time that the memory variable is read, i.e., the lifetime of the variable.
- namestr, optional
The name of the process.
- split_on_length(length: int = 0) tuple[PlainMemoryVariable | None, PlainMemoryVariable | None]¶
Split this
PlainMemoryVariableinto two newPlainMemoryVariableobjects, based on lifetimes of read accesses.- Parameters:
- lengthint, default: 0
The lifetime length to split on. Length is inclusive for the smaller process.
- Returns:
- Two-tuple where the first element is a
PlainMemoryVariableconsisting - of reads with read times smaller than or equal to
length(or None if no such - reads exists), and vice-versa for the other tuple element.
- Two-tuple where the first element is a
- class b_asic.process.Process(start_time: int, execution_time: int, name: str = '')¶
Bases:
objectObject for use in resource allocation.
Has a start time and an execution time. Subclasses will in many cases contain additional information for resource assignment.
- Parameters:
- start_timeint
Start time of process.
- execution_timeint
Execution time (lifetime) of process.
- namestr, default: “”
The name of the process.