pynq_composable.composable Module

The pynq_composable.composable module is the cornerstone of the composable overlays. This modules provides the functionality to compose overlays at runtime.

class pynq_composable.composable.BufferIP(path: str)[source]

Bases: object

Handles IP objects that are of buffering type

Expose fullpath attribute for buffering type IP such as:

  1. FIFOs

  2. Slice registers.

class pynq_composable.composable.Composable(description)[source]

Bases: pynq.overlay.DefaultHierarchy

This class keeps track of a composable overlay

The Composable class holds the state of the logic available for run-time composition through and AXI4-Stream switch

Our definition of composable overlay is: “post-bitstream configurable dataflow pipeline”. Hence, this class must expose configurability through content discovery, dataflow configuration and runtime protection.

This class stores two dictionaries: c_dict and dfx_dict

Each entry of the Composable dictionary (c_dict) is a mapping: ‘name’ -> {ci, pi, modtype, dfx, loaded, bitstream}, where name (str) is the key of the entry. ci (list) list of physical port in the switch the IP is connected to pi (list) list of physical port in the switch the IP is connected from modtype(str) IP type dfx (bool) IP is located in a DFX region loaded (bool) IP is loaded bitstream (str) location of the corresponding partial bitstream

Each entry of the PR dictionary (pr_dict) dictionary is a mapping: ‘name’ -> {decoupler, gpio, ip}, where name (str) is the name of the partial region decoupler (str) fullpath of the DFX decoupler that controls the pr region gpio (dict) index of PS GPIO that control the DFX decoupler ip (dict) dictionary of partial bitstream and IP associated to the region

graph

Graphviz Digraph representation of the current dataflow pipeline

Type

Digraph

property c_dict: dict

Returns the c_dict dictionary

All the IP cores connected to the AXI4-Stream Switch. Key is the name of the IP; value is a dictionary mapping the producer and consumer to the switch port, whether the IP is in a dfx region and loaded {str: {‘ci’ : list, ‘pi’ : list, ‘modtype’: str, ‘dfx’: bool, ‘loaded’: bool, ‘bitstream: str’}}.

static checkhierarchy(description)[source]

Function to check if the driver matches a particular hierarchy

This function should be redefined in derived classes to return True if the description matches what is expected by the driver. The default implementation always returns False so that drivers that forget don’t get loaded for hierarchies they don’t expect.

compose(cle_list: list) None[source]

Configure design to implement required dataflow pipeline

Parameters

cle_list (list) –

list of the composable IP objects Examples: [a, b, c, d] yields

-> a -> b -> c -> d ->

[a, b, [[c,d],[e]], f, g] yields

            -> c -> d -
          /            \
-> a -> b               f -> g ->
          \            /
            ---> e ----

property current_pipeline: list

List of IP objects in the current dataflow pipeline

property dfx_dict: dict

Returns the dfx_dict dictionary

All the DFX regions in the hierarchy. Key is the name of the dfx region value is a dictionary with DFX decoupler, PS GPIO that controls the DFX decoupler and partial bitstreams associated to the region {str: {‘decoupler’ : str, ‘gpio’ : {‘decouple’ : int, ‘status’ : int}, ip’: dict}}.

insert(iptuple: tuple) None[source]

Insert a new IP or list of IP into current pipeline

Parameters

iptuple (tuple) –

Tuple of two items. First: list of IP to be inserted Second: index

Examples:

([cpipe.pr_0.erode], 3) ([cpipe.pr_1.filter2d, cpipe.pr_fork.duplicate], 2)

loadIP(dfx_list: list) None[source]

Download dfx IP onto the corresponding partial regions

Parameters

dfx_list (list) –

List of IP to be downloaded onto the dfx regions. The list can contain either a string with the fullname or the IP object

Examples:

[cpipe.pr_0.fast_accel, cpipe.pr_1.dilate_accel] [‘pr_0/fast_accel’, ‘pr_1/dilate_accel’]

remove(iplist: Optional[list] = None) None[source]

Remove IP object from the current pipeline

Parameters

iplist (list) –

List of IP to be removed from the current pipeline

Examples:

[cpipe.pr_0.erode] [cpipe.pr_1.filter2d, cpipe.pr_fork.duplicate]

replace(replaceip: tuple) None[source]

Replace an IP object in the current pipeline

Parameters

replaceip (tuple) –

Tuple of two items. First: IP object to be replaced Second: new IP object

Examples:

(cpipe.pr_0.erode, cpipe.pr_1.dilate)

tap(ip: Optional[Union[Type[pynq.overlay.DefaultIP], int]] = None) None[source]

Observe the output of an IP object in the current pipeline

Tap into the output of any of the IP cores in the current pipeline Note that tap is not supported in a branch

You can tap by passing the IP name or the index of the IP in the list.

Note that tap does not modify the attribute current_pipeline

Parameters
  • ip – Either an IP object in the current pipeline to be tapped or index of IP object in the current pipeline to be tapped

  • Examples – tap(cpipe.pr_1.dilate) tap(6)

untap() None[source]

Restores current pipeline after tap happened

class pynq_composable.composable.DFXRegion(cpipe: pynq_composable.composable.Composable, name: str)[source]

Bases: object

Class that wraps attributes for IP objects on DFX regions

class pynq_composable.composable.StreamingIP(name: str)[source]

Bases: object

Handles Streaming only IP

class pynq_composable.composable.UnloadedIP(path: str)[source]

Bases: object

Handles IP objects that are not yet loaded into the hardware

This can be consider a virtual IP object