A soclib-based platform description.
Creates a new platform.
Parameters: |
---|
Creates a new component in this platform.
Parameters: |
|
---|---|
Returns: | a soclib.Component object. |
Raises : | Any error if instantiation is invalid. |
Underlying class is soclib.platform.Architecture.
A component spawned by soclib.Architecture.create().
A component object is fully defined, it has an actual corresponding component implementation, it is fully parameterized. Ports are accessed as attributes (see Ports).
Adds a memory segment to the segment list targeting this component.
Parameters: | |
---|---|
Raises : | ValueError if address or size is invalid. |
Underlying class is soclib.component.Component.
In a Component, ports are available through their names, and the “p_” prefix is skipped, if present in metadata.
For instance, a module defined with the following .sd file format:
Module("caba:my_super_module",
classname = "MySuperModule",
ports = [
Port('caba:bit_out','p_irq'),
Port('caba:bit_in','p_irq_in', 10),
],
)
Instantiated through the following code:
import soclib
arch = soclib.Architecture("caba")
inst0 = arch.create("caba:my_super_module", "inst0")
exports the ports as:
# simple ports as a Port object
inst0.irq
# port arrays an array of Port objects
inst0.irq_in[0]
inst0.irq_in[1]
inst0.irq_in[2]
...
inst0.irq_in[9]
A port attached to a Component. Ports are implicitly created by component creation.
This corresponds to the following syntax:
inst0 = arch.create(...)
inst1 = arch.create(...)
new_signal = inst0.portA // inst1.portB
Spawns a signal compatible with both ports and connect them to it.
Parameters: | other (Port) – another port |
---|---|
Returns: | spawned Signal object |
Exports the port to the boundary of the architecture. This permits to build hierarchical netlists.
Parameters: |
|
---|
Underlying class is soclib.component.Port.
A signal. Signals are created by the connection of two ports together (See Port // operator). Reference is here for the two following methods:
The // operator.
This corresponds to the following syntax:
inst0 = arch.create(...)
inst1 = arch.create(...)
inst2 = arch.create(...)
new_signal = inst0.portA // inst1.portB
new_signal // inst2.portB
# Equivalent to:
inst0.portA // inst1.portB // inst2.portB
Connects the signal to the given port.
Parameters: | port (Port) – a compatible port |
---|---|
Returns: | the signal itself (so that you can use the return value for another connection). |
Exports the signal to the boundary of the architecture. This permits to build hierarchical netlists.
Parameters: |
|
---|
Underlying class is soclib.component.Signal.
Coprocessors can be instantiated from their matching dsx.application.TaskModel object. This is done the following way:
Retrieve a model by its type, and get an implementation by its class:
import dsx.application
import soclib
arch = soclib.Architecture(...)
model = dsx.application.TaskModel.getByName("task_model_name")
impl = model.getImpl(soclib.HwTask)
See dsx.application.taskmodel.TaskModel.getByName() and dsx.application.taskmodel.TaskModel.getImpl().
Instantiate the coprocessor component and its interface controller:
ctrl, coproc = model.instanciate(arch,
"coproc_instance_name",
"controller_instance_name")
Assign a segment to the controller:
ctrl.addSegment("ctrl_seg", 0x42000000, 0x200, False)
Connect the controller to the NoC:
ctrl.vci_initiator // noc.to_initiator.new()
ctrl.vci_target // noc.to_target.new()
See Ports.
Note
Connections between the coprocessor and its controller are automatically done on instantiation.