b_asic.process
¶

B-ASIC classes representing resource usage.
- class b_asic.process.MemoryProcess(write_time: int, life_times: list[int], name: str = '')¶
Bases:
Process
Intermediate class (abstract) for memory processes.
Different from regular
Process
objects,MemoryProcess
objects can contain multiple read accesses and can be split into two newMemoryProcess
objects based on these read times.- Parameters:
- write_timeint
Start time of process.
- life_timeslist of int
List of ints representing times after
start_time
this process is accessed.- namestr, default=””
Name of the process.
- split_on_length(length: int = 0) tuple[MemoryProcess | None, MemoryProcess | None] ¶
Split this
MemoryProcess
into two newMemoryProcess
objects.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
MemoryProcess
consisting - 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:
MemoryProcess
Object 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
InputPort
that 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
MemoryVariable
into two newMemoryVariable
objects, 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
MemoryVariable
consisting - 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:
Process
Object 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:
MemoryProcess
Object 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
PlainMemoryVariable
into two newPlainMemoryVariable
objects, 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
PlainMemoryVariable
consisting - 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:
object
Object 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.