question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with edge detection of bits belonging to a vector driven by cocotb

See original GitHub issue

I commonly come across a new to have multiple coroutines each of which monitor’s a rising edge of a specific bit of a vector. Somewhat more rarely is that same vector is driven by cocotb. If the vector is driven one bit (bit slicing) at a time by cocotb, and two bits are driven high in the same time step, only one of the bits edges will detect. For example:

   dut.vector[0] <= 1
   dut.vector[1] <= 1
   dut.vector[2] <= 1
   dut.vector[3] <= 1

Assuming there is a coroutine per bit of vector, each awaiting on a rising edge trigger, only one of them will fire. However if instead you have:

   dut.vector <= 15

All 4 will triggers fire.

I’ve attached a MWE that fails a test in Riviera. I spoke to @ktbarrett about this and he tried this example on Questa and it passes. Since that simulator uses the FLI interface, it’s not clear if this is a Riviera pro issue or an issue with Cocotb’s VHPI interface logic. @cmarqu I’m told you might be able to run this test in cadence and rule out if this is a Riviera Pro issue. If it’s an issue with Aldec I can try to work with them to resolve it.

Context: Using cocotb 1.4 and Riviera Pro 64 bit on CentOs 7 & 8.

test.zip

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marlonjamescommented, Mar 8, 2021

From my reading of the LRM, updating a bit of a std_logic_vector is an error:

23.28 vhpi_put_value It is an error if the vhpi_put_value function is called with an update mode of vhpiForcePropagate or vhpiDepositPropagate to update a member of a resolved composite signal.

cocotb uses vhpiDepositPropagate, and std_logic_vector is a resolved composite type.

It might work with std_ulogic_vector.

0reactions
ktbarrettcommented, Mar 9, 2021

I guess that means we need better support at the Python object level.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Library Reference — cocotb 1.7.2 documentation
Assuming we have a common test function that will run a test. This test function will ... The tests are appended to the...
Read more >
Preventing soft-errors and hardware trojans in embedded ...
Single-event upsets and multiple-bit upsets that are part of single-event effects, cause bit-flips and hence lead to data corruption.
Read more >
ghdl1/Lobby - Gitter
@qarlosalberto You should clarify the problem with external libraries. The command -s does both syntax and semantic checking.
Read more >
Blog Archives - Page 4 of 4 - Chips Alliance
ASIC and FPGA development is making rapid strides towards adopting fully open source, software-oriented approaches where large-scale collaboration and CI are ...
Read more >
Developing Trustworthy Hardware with Security-Driven ...
Thank you for sparking my competitive edge that keeps me motivated ... Early work focuses on post-fabrication detection of hardware Trojans in ICs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found