Table Of Contents

Previous topic

The soclib metadata description module

Next topic

Parameters

This Page

Module protocols

This module contains the description of the APIs of modules referenced in the Module Index.

class soclib_desc.module.ModuleCommon(name, source_filename, source_lineno=0)

This is the base class of all Module (and Signal or Ports) implementations. This class provides sane defaults for most methods.

cleanup()

Resets transient state attached to this module, like debug mode.

debug_mode

Current debug mode

name

Fully qualified module name in the Module Index.

path_is(path)

Tells whether the given file path is the file where module got declared.

Parameters:path – an absolute filename
related_files()

Gets a collection of files related to this module. This method must be implemeted in subclasses.

set_debug_mode(debug=True)

Sets module to debug mode, what happens in specialized modules when they are in debug mode is implementation-dependant

Parameters:debug – next debug mode
class soclib_desc.module.ModuleInterface

This is the protocol that must be implemented by Modules. Modules must inherit soclib_desc.module.ModuleCommon.

get_template_parameters()

Returns a list of parameter objects to define in order to be able to specialize this module.

is_used()

Returns whether the module got specialized at least once.

specialize(**params)

Creates a Specialization for the module, with the given parameters.

Parameters:params – a mapping of key/values.
Returns:a Specialization object.
class soclib_desc.module.PortInterface

This is the protocol that must be implemented by Ports. Ports must inherit ModuleCommon, and implement the ModuleInterface.

class soclib_desc.module.SignalInterface

This is the protocol that must be implemented by Signals. Signals must inherit ModuleCommon, and implement the ModuleInterface.

Specialization protocols

This module contains the description of the APIs of specialized modules.

class soclib_desc.specialization.SpecializationInterface
builder()

Retrieves the soclib_cc builder instance able to compile the specialization.

get_entity_name()

Retrieves a string corresponding to the whole entity name.

  • For SystemC modules, this is a class name with qualified namespace and template parameters.
  • For rtl modules, this is a simple entity name
get_extensions(namespace)

Gets extensions defined for a given namespace. Extensions are each in a string.

get_header_files()

Retrieves a collection of absolute header file paths to include when using this module.

get_instance_parameters()

List of parameters to be passed at run time, these are the necessary parameters for getting a valid module instanciation. Depending on the module implementation language, this may be a string, a list of parameters, or a dictionary.

get_interface_files()

Retrieves a collection of absolute interface file paths to include from software using this module.

get_used_modules()

Returns set of specializations used as dependancy of this one. This is the exhaustive list of needed modules, even if deep in the subtree.

implementation_language()

Retrieves the native language of the module. It should probably be vhdl, systemc, verilog, ...

port_list()

Retrieves the port list. Some ports may depend from instance parameters.

Component Builder protocol

This module contains the description of the APIs of specialized modules builders.

class soclib_desc.component_builder.ComponentBuilderInterface
results()

Returns a list of soclib_builder.bblock.BBlock objects corresponding to products of module compilation.