Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AXI4LiteMaster: AttributeError: 'NoneType' object has no attribute 'setimmediatevalue' #51

Open
LeChuck42 opened this issue Jun 28, 2022 · 2 comments

Comments

@LeChuck42
Copy link

LeChuck42 commented Jun 28, 2022

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:

self.bus.AWVALID.setimmediatevalue(0)

with AttributeError: 'NoneType' object has no attribute 'setimmediatevalue'

I traced the cause to this function:

def _caseInsensGetattr(self, obj, attr):
for a in dir(obj):
if a.casefold() == attr.casefold():
return getattr(obj, a)
return None

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.
BusDriver.__init__(self, entity, name, clock, **kwargs)

@LeChuck42
Copy link
Author

LeChuck42 commented Jun 28, 2022

#45 #42 #39 may be related

@Elefseus
Copy link

same to me, the obj() method does not return all signal names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants