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
Currently, cocotb-bus lacks the ability to wire a bus driver or monitor (e.g., AvalonSTPkts) to a SystemVerilog struct. Many users prefer to use structs for their interfaces, and as a result, have to create wrappers specifically for cocotb simulation, which can be cumbersome.
I've developed a fix for this issue. The solution basically passes a handle dict to the Bus class constructor. In this dict, keys represent the signal names like StartOfPacket, while the values are the corresponding cocotb handles.
For example, here is a helper function that generates a handle dict for an Avalon bus:
For example, I have this helpful function for avalon bus:
Using structs/records for buses is for sure the mainstream way in the industry. Has this been included?
Btw how would this work with a split struct/record type in the scheme of request and response?
split struct/record for request and response shouldn't be a problem. You basically pass two struct names, not just one, to the handlers to extract signals of both directions.
Using structs/records for buses is for sure the mainstream way in the industry. Has this been included? Btw how would this work with a split struct/record type in the scheme of request and response?
split struct/record for request and response shouldn't be a problem. You basically pass two struct names, not just one, to the handlers to extract signals of both directions.
Using structs/records for buses is for sure the mainstream way in the industry. Has this been included? Btw how would this work with a split struct/record type in the scheme of request and response?
You mean the current release supports split struct/record buses? Sorry for the hijacking, but could you please give an example on this issue I have opened: #90 ?Cheers!
Currently, cocotb-bus lacks the ability to wire a bus driver or monitor (e.g., AvalonSTPkts) to a SystemVerilog struct. Many users prefer to use structs for their interfaces, and as a result, have to create wrappers specifically for cocotb simulation, which can be cumbersome.
I've developed a fix for this issue. The solution basically passes a handle dict to the Bus class constructor. In this dict, keys represent the signal names like
StartOfPacket
, while the values are the corresponding cocotb handles.For example, here is a helper function that generates a handle dict for an Avalon bus:
For example, I have this helpful function for avalon bus:
The fix modifies the Bus class. For example, here are some of the changes:
This modification has worked great in my local tests. Would the maintainers be interested in this addition? If so, may I go ahead and create a PR?
The text was updated successfully, but these errors were encountered: