Skip to content

rfsoc_overlay

PYNQ overlay management — loads the bitstream and exposes IP cores to higher-level tasks.

rfsoc_rfdc.rfsoc_overlay

Classes

RFSoCOverlay(path_to_bitstream=None, **kwargs)

Bases: Overlay

Represents an RFSoC overlay.

This class extends the Overlay class and provides additional functionality specific to RFSoC devices.

Parameters:

Name Type Description Default
path_to_bitstream str

Path to the bitstream file (.bit). If not provided, the default bitstream file in the current directory will be used.

None
**kwargs

Additional keyword arguments to be passed to the Overlay class constructor.

{}

Initializes the RFSoCOverlay object.

Parameters:

Name Type Description Default
path_to_bitstream str

Path to the bitstream file (.bit). If not provided, the default bitstream file in the current directory will be used.

None
**kwargs

Additional keyword arguments to be passed to the Overlay class constructor.

{}
Source code in rfsoc_rfdc/rfsoc_overlay.py
def __init__(self, path_to_bitstream=None, **kwargs):
    """
    Initializes the RFSoCOverlay object.

    Args:
        path_to_bitstream (str): Path to the bitstream file (.bit). If not provided, the default bitstream file in the current directory will be used.
        **kwargs: Additional keyword arguments to be passed to the `Overlay` class constructor.
    """

    # Generate default bitfile name
    if path_to_bitstream is None:
        curr_dir = os.path.dirname(os.path.abspath(__file__))
        bitstream_fname, hwh_fname = self._find_matching_files(curr_dir)
        logging.info(f'"Writing bitstream {bitstream_fname} to RFSoC."')
        path_to_bitstream = os.path.join(curr_dir, bitstream_fname)
    # Create Overlay
    super().__init__(path_to_bitstream, ignore_version=True, **kwargs)

    # Print out all IPs in bit stream file
    for i in self.ip_dict:
        print(i)
Functions