pynq.pl_server.global_state Module

The pynq.pl_server.global_state module manages the global state file for the device. Using PYNQ-Metadata, it creates a JSON representation of the currently loaded Overlay in the install location of the module. This global state file is checked on overlay download to determine if any AXI shutdown IP Cores need to be triggered before the bitstream is loaded onto the device. The global state file also provides a way for processes outside the one that loaded the Overlay to inspect the state of the PL and interact with IP.

class pynq.pl_server.global_state.GlobalState(**kwargs)[source]

Bases: pydantic.main.BaseModel

A class that is used to globally keep track on some details of the currently configured bitstream

add(name: str, addr: int) → None[source]

Adds a shutdown_ip to the global state

class pynq.pl_server.global_state.ShutdownIP[source]

Bases: pydantic.main.BaseModel

pynq.pl_server.global_state.bitstream_hash(filename: str) → int[source]

Returns a hash of the bitstream

pynq.pl_server.global_state.clear_global_state() → None[source]

Clears the global state file, used on boot

pynq.pl_server.global_state.global_state_file_exists() → bool[source]

Returns true if the global_pl_state file is present in the system False otherwise

pynq.pl_server.global_state.initial_global_state_file_boot_check() → None[source]

Performs a check to see if this is a coldstart, if it is then clear the config file.

pynq.pl_server.global_state.load_global_state() → Optional[pynq.pl_server.global_state.GlobalState][source]

Reads the global state of the PL from a known location, returns None if it cannot be found

pynq.pl_server.global_state.save_global_state(state: pynq.pl_server.global_state.GlobalState) → None[source]

Saves the global state of the PL in a known location.

This includes details on whether the current configured IP needs a shutdown before a reconfiguration can happen, along with where the shutdown logic lives.