pynq_composable.switch Module

The pynq_composable.switch module is the driver to interact with the AXI4-Stream Switch.

class pynq_composable.switch.StreamSwitch(description: dict)[source]

Bases: pynq.overlay.DefaultIP

AXI4-Stream Switch python driver

This class provides the driver to control an AXI4-Stream Switch which uses the AXI4-Lite interfaces to specify the routing table. This routing mode requires that there is precisely only one path between producer and consumer. When attempting to map the same consumer interface to multiple producer interfaces, only the lowest consumer interface is able to access the consumer interface. Unused producer interfaces are automatically disabled by the logic provided in this driver

bindto = ['xilinx.com:ip:axis_switch:1.1']
default() None[source]

Generate default configuration

Configures the AXI4-Stream Switch to connect producer[j] to consumer[j] for j = 0 to j = (max_slots-1)

disable() None[source]

Disable all connections in the AXI4-Stream Switch

property pi

AXI4-Stream Switch configuration

Configure the AXI4-Stream Switch given a numpy array Each element in the array controls a consumer interface selection. If more than one element in the array is set to the same consumer interface, then the lower producer interface wins.

Parameters

conf_array (numpy array (dtype=np.int64)) –

An array with the mapping of consumer to producer interfaces The index in the array is the producer interface and the value is the consumer interface slot The length of the array can vary from 1 to max slots Use negative values to indicate that a producer is disabled

For instance, given this input [-1, 2, 1, 0]

Consumer 2 will be routed to Producer 1

Consumer 1 will be routed to Producer 2

Consumer 0 will be routed to Producer 3

Producer 0 is disabled