Previous topic

soclib

Next topic

Component objects

This Page

Architecture definition

class soclib.platform.Macrocell

Macrocell is a module made of a set of components plus the internal netlist. This makes an hierarchical netlist.

Macrocell inherits dsx.ware.Ware.

__init__(abstraction_level, **default_args)

Creates a new Macrocell.

Parameters:
  • abstraction_level (str) – Default abstraction level of used modules. This changes some quirks in the netlist implicit signals.
  • default_args – Default construction arguments to pass to all create() calls.
abstraction_level

The abstraction level.

create(module, name, **args)

Create a new module inside this macrocell.

Parameters:
  • module (str) – Module name in SoCLib’s Module Index.
  • name (str) – Module instance name. Will be used for netlist creation, and also for application mapping.
  • args – Key/value construction parameters that can either be compile-time or run-time parameters of the module.
Returns:

a soclib.component.Component object.

create_signal(module, name, **args)

Create a new signal inside this macrocell.

Parameters:
  • module (str) – Signal name in SoCLib’s Module Index.
  • name (str) – Signal instance name. Will be used for netlist creation, and also for application mapping.
  • args – Key/value construction parameters that can either be compile-time or run-time parameters of the signal.
Returns:

a soclib.component.Signal object.

defaults(name)

Accessor for default arguments passed at macrocell instantiation.

Parameters:name (str) – Name of the queried argument
Raises :KeyError if not found
__getitem__(name)

Retrieves a component, signal, or other environment object inside the macrocell.

Parameters:name (str) – Component name
Raises :KeyError if not found
envAdd(name, val)

Adds an object in the macrocell’s environment.

Parameters:
  • name (str) – Name of the object
  • val (any) – Object to associate to the name
envVals()

Retrieves the complete environment.

Returns:A (key, value) couple iterator.
prepare()

See dsx.ware.Ware.prepare().

mkModuleDesc(module_name, header, implementation)

Generates a sd_parser.module.Module corresponding to this macrocell.

Parameters:
  • module_name (str) – Name of module to declare
  • header (str) – Header file name (not generated)
  • implementation (str) – Implementation file name (not generated)
Returns:

a sd_parser.module.Module object.

Note

Use repr() on the return value to get a .sd file format blob.

to_systemc_module(module_name)

Creates the SystemC netlist corresponding to the macrocell.

Parameters:module_name (str) – Name of module to create
Returns:a dsx.systemc.systemc.SystemC object.
add_parameters(*parameters)

Adds parameters to the macrocell itself. This can help create a parametric macrocell netlist.

Parameters:parameters (iterable of soclib_desc.parameter.Base subinstances.) – list of parameters to add.
add_inst_parameters(*parameters)

Adds instance parameters to the macrocell itself. This can help create a parametric macrocell netlist.

Parameters:parameters (iterable of soclib_desc.parameter.Base subinstances.) – list of parameters to add.
add_tmpl_parameters(*parameters)

Adds template parameters to the macrocell itself. This can help create a parametric macrocell netlist.

Parameters:parameters (iterable of soclib_desc.parameter.Base subinstances.) – list of parameters to add.
to_hardware()

Creates the Hardware corresponding to this macrocell.

Returns:a dsx.hard.hard.Hardware object.
class soclib.platform.Architecture

This is a Macrocell with additional implicit signals created.

Architecture inherits Macrocell.

__init__(abstraction_level=None, **default_args)

Creates a new Macrocell.

Parameters:
  • abstraction_level (str) – Abstraction level of the Architecture. If "caba", a reset and a clock signal are created and exported to interface of the macrocell.
  • default_args – Default construction arguments to pass to all create() calls.
defaultSignal(name)

Retrieves an implicitly-created signal.

Parameters:name (str) – name of signal
Returns:a soclib.component.Signal
Raises :KeyError if not found
prepare()

See dsx.ware.Ware.prepare().

to_hardware()

Creates the Hardware corresponding to this macrocell.

Returns:a dsx.hard.hard.Hardware object.