zeroasiccorp / switchboard

Communication framework for RTL simulation and emulation.
https://zeroasiccorp.github.io/switchboard/
Apache License 2.0
255 stars 20 forks source link

Mechanism for declaring arrayed/bundled interfaces with autowrap #215

Open sgherbst opened 4 months ago

sgherbst commented 4 months ago

Issue reported by @azaidy.

Proposal is to have an optional shape field like numpy when declaring interfaces:

interfaces = {
    'umi_in': dict(type='umi', dw=dw, aw=aw, cw=cw, direction='input', shape=(m,n), txrx='umi'),
    'umi_out': dict(type='umi', dw=dw, aw=aw, cw=cw, direction='output', shape=(m,n), txrx='umi'),
    'umi_aux': dict(type='umi', dw=dw, aw=aw, cw=cw, direction='output', shape=(p,))
}

Elements in arrays should be accessible with standard array notation; this should apply to both coupled UmiTxRx interfaces and decoupled interfaces.

dut.net.intfs['umi'][i][j].write(...)
dut.net.intfs['umi_aux'][k].send(...)
sgherbst commented 4 months ago

Note: this should also be possible with bundled clocks and resets