Skip to content

LogicArray in cocotb has been rewritten #88

@davekeeshan

Description

@davekeeshan

There has be a few extensive changes in cocotb that have resulted in cocotbext-axi not working against the head of the repo. It related to this change cocotb #3792, which changes and deprecates how things are done.

In my testing this is the first fallover in cocotbext-axi:

File "/mnt/sda/projects/cocotbext-axi/cocotbext/axi/stream.py", line 123, in __init__
    v.binstr = 'x'*len(v)
    ^^^^^^^^
AttributeError: property 'binstr' of 'LogicArray' object has no setter

I fixed (or bypassed) that one, but there are more, I am still unclear what this base code is doing and just the start of the rabbit hole:

Traceback (most recent call last):
  File "/mnt/sda/projects/cocotbext-axi/cocotbext/axi/axi_master.py", line 592, in _process_write_resp
    bid = int(getattr(b, 'bid', 0))
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/sda/projects/cocotb/src/cocotb/types/logic_array.py", line 460, in __int__
    return self.to_unsigned()
           ^^^^^^^^^^^^^^^^^^
  File "/mnt/sda/projects/cocotb/src/cocotb/types/logic_array.py", line 361, in to_unsigned
    value = value << 1 | int(bit)
                         ^^^^^^^^
  File "/mnt/sda/projects/cocotb/src/cocotb/types/logic.py", line 243, in __int__
    raise ValueError(f"Cannot convert {self!r} to int")
ValueError: Cannot convert Logic('X') to int

Reporting to start, I may get time to see if I can propose fixes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions