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.

Wait on event and condition in `c/c++`?

See original GitHub issue

For performance reasons, it would be probably useful to have the ability to wait on condition in c/c++. Looking at monitors/drivers that could have a performance gain if used correctly.

Something like below to wait in c and not in python:

while condition == x:
    await event

Example python syntes can be like in #1250:

await RisingEdge(dut.clock).until_after(lambda: dut.ack.value)

I think @eric-wieser @ktbarrett have some ideas.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
themperekcommented, Nov 17, 2020

I think #1689 and #2208 are enough.

1reaction
eric-wiesercommented, Apr 20, 2020

I’m also starting to suspect that ReadOnly is wrong, and that the signal should be captured immediately at the rising edge of clock, to match how the verilog would capture it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the best way to to wait until event happen in c++?
I can think of three solutions: Sleeps, Condition Variables, and WaitSets. Using sleeps, however, seems to me like the less efficient one ...
Read more >
std::condition_variable::wait - cppreference.com
std::condition_variable::wait​​ wait causes the current thread to block until the condition variable is notified or a spurious wakeup occurs, ...
Read more >
Applying C - Condition Variables - I Programmer
All of the threads waiting on the condition variable are suspended until another thread uses the signal function: pthread_cond_signal(&myConVar);.
Read more >
Representing a "wait until" in an activity diagram in UML
Any activity needs a certain time until it is completed. If a customer representative is available immediately, the time for the wait activity ......
Read more >
Given a mutex lock m , and a condition variable c , | Chegg.com
Question: Given a mutex lock m , and a condition variable c , the following events happen in the order of occurrence shown...
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