qick.ip

Support classes for dealing with FPGA IP blocks.

Classes

BusParser(root)

Parses the HWH XML file to extract information on the buses connecting IP blocks.

QickMetadata(soc)

Provides information about the connections between IP blocks, extracted from the HWH file.

SocIp(*args, **kwargs)

Base class for firmware IP drivers.

class qick.ip.SocIp(*args: Any, **kwargs: Any)[source]

Bases: DefaultIP, DummyIp

Base class for firmware IP drivers. Registers are accessed as attributes. Configuration constants are accessed as dictionary items.

class qick.ip.QickMetadata(soc)[source]

Bases: object

Provides information about the connections between IP blocks, extracted from the HWH file. The HWH parser is very different between PYNQ 2.6/2.7 and 3.0+, so this class serves as a common interface.

get_fclk(blockname, portname)[source]

Find the frequency of a clock port.

Parameters:
  • parser – HWH parser object (from Overlay.parser, or BusParser)

  • blockname (string) – the IP block of interest

  • portname (string) – the port we want to trace

Returns:

frequency in MHz

Return type:

float

get_param(blockname, parname)[source]

Find the value of an IP parameter. This works for all IPs, including those that do not show up in ip_dict because they’re not addressable.

Parameters:
  • parser – HWH parser object (from Overlay.parser, or BusParser)

  • blockname (string) – the IP block of interest

  • parname (string) – the parameter of interest

Returns:

parameter value

Return type:

string

trace_back(start_block, start_port, goal_types)[source]

Follow the AXI-Stream bus backwards from a given block and port. Raise an error if none of the requested IP types is found.

Parameters:
  • start_block (str) – The fullpath for the block to start tracing from.

  • start_port (str) – The name of the input port to start tracing from,

  • goal_types (list of str) – IP types that we’re interested in.

Returns:

  • str – The fullpath for the block we found.

  • str – The output port on the block we found.

  • str – The IP type we found.

trace_forward(start_block, start_port, goal_types)[source]

Follow the AXI-Stream bus forwards from a given block and port. If a broadcaster is encountered, follow all outputs. Raise an error if ~=1 matching block is found.

Parameters:
  • start_block (str) – The fullpath for the block to start tracing from.

  • start_port (str) – The name of the output port to start itracing from,

  • goal_types (list of str) – IP types that we’re interested in.

Returns:

  • str – The fullpath for the block we found.

  • str – The input port on the block we found.

  • str – The IP type we found.

class qick.ip.BusParser(root)[source]

Bases: object

Parses the HWH XML file to extract information on the buses connecting IP blocks.