You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not too sure if I am using the bus allocation right. I have a inout on an FPGA, ja[7:0] (thanks digilent). I have, on the fpga assigned some of those pins to a JTAG interface. I have physically verified these are working (openocd/logic analyzer).
However when I try and allocate a jtag bus to this pins in the vector, the setup doesn't work. array_idx, i think, only works with one signal, and it can only be a single int, if you have two in a list or a dict ii can't be used
./cocotb-bus/src/cocotb_bus/bus.py
def __init__(self, entity, name, signals, optional_signals=[], bus_separator="_", case_insensitive=True, array_idx=None):
"""
Args:
...
array_idx (int or None, optional): Optional index when signal is an array.
I am looking at enhancing to set the array_idx locally if detected in the string supplied
for attr_name, sig_name in _build_sig_attr_dict(signals).items():
if g := re.search(r"(.+)\[(\d+)\]", sig_name):
sig_name = g.group(1)
array_idx = int(g.group(2))
if name:
signame = name + bus_separator + sig_name
else:
signame = sig_name
self._add_signal(attr_name, signame, array_idx, case_insensitive)
array_idx = None
The text was updated successfully, but these errors were encountered:
I got this working on the released verison of cocotb, 1.9.2. However with the next release, 2.0, there are some changes on how indexing of an vector occur, subscriptable signals (LogicObject).
This presents is self in the cocotb-bus when one tries to:
if array_idx is not None:
handle = handle[array_idx]
This exception is raise when array_idx is not None.
File "/mnt/sda/projects/cocotb-bus/src/cocotb_bus/bus.py", line 99, in _add_signal
handle = handle[array_idx]
~~~~~~^^^^^^^^^^^
TypeError: 'LogicObject' object is not subscriptable
I am not too sure if I am using the bus allocation right. I have a inout on an FPGA, ja[7:0] (thanks digilent). I have, on the fpga assigned some of those pins to a JTAG interface. I have physically verified these are working (openocd/logic analyzer).
However when I try and allocate a jtag bus to this pins in the vector, the setup doesn't work. array_idx, i think, only works with one signal, and it can only be a single int, if you have two in a list or a dict ii can't be used
I am looking at enhancing to set the
array_idx
locally if detected in the string suppliedThe text was updated successfully, but these errors were encountered: