b_asic.process

Inheritance diagram of 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 new MemoryProcess 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.

property life_times: List[int]
property read_ports: List[Any]
property read_times: Tuple[int, ...]
property reads: Dict[Any, int]
split_on_length(length: int = 0) Tuple[MemoryProcess | None, MemoryProcess | None]

Split this MemoryProcess into two new MemoryProcess 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.
property write_port: Any
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_portOutputPort

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.

property read_ports: List[InputPort]
property reads: Dict[InputPort, int]
split_on_length(length: int = 0) Tuple[MemoryVariable | None, MemoryVariable | None]

Split this MemoryVariable into two new MemoryVariable 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.
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.

operationOperation

Operation that the process corresponds to.

namestr, optional

The name of the process.

property operation: Operation

The Operation that the OperatorProcess corresponds to.

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.

property read_ports: List[int]
property reads: Dict[int, int]
split_on_length(length: int = 0) Tuple[PlainMemoryVariable | None, PlainMemoryVariable | None]

Split this PlainMemoryVariable into two new PlainMemoryVariable 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.
property write_port: int
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.

property execution_time: int

Return the execution time.

property name: str
property read_times: Tuple[int, ...]
property start_time: int

Return the start time.