cocotb-bus
cocotb-bus copied to clipboard
AXI4LiteMaster: AttributeError: 'NoneType' object has no attribute 'setimmediatevalue'
I'm instantiating an AXI4LiteMaster in my testbench.
With the default behaviour in cocotb_bus 0.2.1 installed from pypi the following line fails:
https://github.com/cocotb/cocotb-bus/blob/2c846dca8d3293b7676c70dd51dbc9c7f51029f0/src/cocotb_bus/drivers/amba.py#L67
with AttributeError: 'NoneType' object has no attribute 'setimmediatevalue'
I traced the cause to this function:
https://github.com/cocotb/cocotb-bus/blob/2c846dca8d3293b7676c70dd51dbc9c7f51029f0/src/cocotb_bus/bus.py#L78-L82
When first called, obj
doesn't yet have the attributes (e.g. axil_AWVALID
) populated. The for loop will iterate through the dir
, but not find the signal we are looking for and the function will return None
as the handle.
I noticed that hasattr
and getattr
are not case sensitive for me. So my current workaround for this is to (counterintuitively) set case_insensitive=False
in the call to BusDriver.__init__
so this code doesn't get called.
https://github.com/cocotb/cocotb-bus/blob/2c846dca8d3293b7676c70dd51dbc9c7f51029f0/src/cocotb_bus/drivers/amba.py#L64
#45 #42 #39 may be related
same to me, the obj() method does not return all signal names.