Skip to content

Python client API reference

This is the host-side API at commit 4415f39, separate from the target-side PYNQ API. Methods marked await are asynchronous.

Connection and design

Import: from noa.noa import Noa.

Call Behavior
Noa(addr, log=None) Construct a client; does not connect immediately
async with Noa(addr) as device Connect on entry, disconnect on exit
await device.connect(host_id=None) Connect and claim a session; default ID includes login and computer name
await device.disconnect() Release the session and drain the connection
device.is_connected() Check whether a connection object is present
device.is_running() Check whether the manager reports a running design
await device.device_info() Return DeviceInfo
await device.load_bitstream(bit, hwh) Upload local files and program the target

DeviceInfo fields: model, serial_number, software_version, uptime, disk_usage, current_time.

Registers

Call Behavior
await device.setup_read_register(name, offset, cb=None, dtype="uint32") Subscribe and wait for the initial value
device.read_register(name) Return the last cached value
await device.setup_write_register(name, offset, dtype="uint32") Configure a named write register
await device.write_register(name, value) Publish a value using the configured type

The read callback is async def callback(name, value). Addresses and types depend on the design.

Analog outputs

Call Behavior
await device.A0.setup(signal, signal_range, voltage_range) Map and scale a design signal to A0
await device.enable_analog_outputs(A0_to_A3=True, A4_to_A7=True, A8_to_A11=True) Enable/disable groups of four outputs

The same setup() exists on A0–A11 in the reference client; physical availability depends on hardware/design. See I/O.

Digital I/O

Imports: from noa.digital_io import PinMap, Voltage.

PinMap(sig, bit, pin, v=Voltage.D3V3) describes a mapping. Voltage choices are D3V3 and D5V0.

await device.DA.setup(inputs, outputs) and await device.DB.setup(inputs, outputs) take lists of PinMap. Each call replaces the port configuration; bank direction and voltage constraints apply.

DAQ

Imports: from noa.daq import DaqTrigger, TriggerKind.

Call Behavior
await device.daq.setup_data(window_size=1000, decimation=1, delay=0) Configure acquisition; requires a running design
await device.daq.enable_channel(channel, dtype="uint32", cb=None, max_queue_size=100) Subscribe in queue or callback mode
await device.daq.trigger(opts) Start with a DaqTrigger; call setup_data() first
await device.daq.read(channel) Wait for one queued window
device.daq.read_ready(channel) Check for a queued window
await device.daq.disable_channel(channel) Unsubscribe from a channel
await device.daq.reset() Reset acquisition and clear local queue state

DaqTrigger(kind, channel=None, a=None, b=None, threshold=None, hysteresis=None) carries trigger parameters. TriggerKind values: Immediate, RisingEdge, FallingEdge, BothEdges, TriggerIn, EqualTo, GreaterThan, LessThan, Between.

Callbacks are async def callback(channel, samples). The client accepts channel indices 0–63; this API bound does not mean every channel exists in every design.

Streaming

Call Behavior
await device.stream_in.write(buf, dtype="uint32") Encode an array as 32-bit words and send chunks
await device.stream_in.write_chunk(data, last=True) Send raw bytes: multiple of four, at most 1,000,000 bytes

Data types

Typecast recognizes int8, int16, int32, uint8, uint16, uint32, single / float32, logical / boolean, and fixdt(signed, wordlength, fractionlength).

fixdt(1,32,29) is signed fixed point with 32 bits and 29 fractional bits. Every transferred element occupies a 32-bit word, including narrower integers. Match the type to the FPGA representation and supply correctly typed NumPy arrays when streaming.

These types describe encoding, not physical units; they do not convert DAQ trigger thresholds to volts.