Table Of Contents

Previous topic

Ports

Next topic

dsx.systemc

This Page

Coprocessors

Base class

class soclib.hwtask.HwTask

This is an hardware-implemented task. This class serves as a common base class for all soclib-implemented hardware tasks. See MwmrCoproc or SyntheticTask for more information.

This inherits dsx.application.taskmodel.TaskImpl

__init__(config=[], status=[], fifo_to_coproc_depth=None, fifo_from_coproc_depth=None)

Create a new HwTask implementation.

Parameters:
  • config (list) – List of MWMR controller’s config registers names
  • statis (list) – List of MWMR controller’s status register names
  • fifo_to_coproc_depth (int) – Depth of fifos to coprocessor (bytes)
  • fifo_from_coproc_depth (int) – Depth of fifos from coprocessor (bytes)
instanciate(pf, name, ctrl_name=None, plaps=64, portmap={}, defines={})

Create the coprocessor and its controller. Also connect all the signals in between:

  • fifos
  • config registers
  • status registers
Parameters:
  • pf (soclib.platform.Macrocell) – The platform where to create the components
  • name (str) – Coprocessor instance name
  • ctrl_name (str) – Controller instance name
  • plaps (int) – Time lapse (cycles) between pollings of mwmr channels
  • portmap (dict) – Port mapping (usable only for dsx.application.widgets.Constants)
  • defiles (dict) – A key/value mapping for defines
Returns:

a couple of soclib.component.Component (controller, coprocessor)

MWMR-based coprocessors

class soclib.hwtask.MwmrCoproc

An MWMR-based coprocessor implementation.

This inherits HwTask

__init__(module, from_coproc=[], to_coproc=[], config=[], status=[], fifo_to_coproc_depth=None, fifo_from_coproc_depth=None, **kwargs)

Creates a new MwmrCoproc task implementation definition.

Parameters:
  • module (str) – Module name in Module Index to use as coprocessor
  • from_coproc (list) – Name of fifo ports going from the coprocessor to the MWMR channel in memory, in order
  • to_coproc (list) – Name of fifo ports going to the coprocessor from the MWMR channel in memory, in order
  • config (list) – List of MWMR controller’s config registers names
  • statis (list) – List of MWMR controller’s status register names
  • fifo_to_coproc_depth (int) – Depth of fifos to coprocessor (bytes)
  • fifo_from_coproc_depth (int) – Depth of fifos from coprocessor (bytes)
  • kwargs – Other parameters to pass to coprocessor creation

Synthetic tasks

class soclib.hwtask.SyntheticTask

SyntheticTask is a MwmrCoproc using the software implementation as an hardware coprocessor.

Internally, DSX creates an hardware transactor module which speaks to a specially-compiled executable containing the user’s code. Hardware components “talk” to the transactor through hardware fifos, while user code “talks” through MWMR API.

This inherits HwTask

__init__(portmap={}, defines={})

Creates a new SyntheticTask

Parameters:
  • portmap (dict) – Mapping of ports, only used for constants.
  • defines (dict) – Mapping of defines to set in order to compile the SwTask implementation