equivalent of systemC wait( time ) or SystemVerilog #time #449
AdamRose66
started this conversation in
General
Replies: 3 comments 2 replies
-
Thanks for the question! I think you could achieve this with something like this: Future<void> wait(int delay) async {
final toComplete = Completer();
Simulator.registerAction(Simulator.time + delay, toComplete.complete);
await toComplete.future;
} Now you can just This is a useful utility, and I think something like it should be added to ROHD's I filed an issue tracking it here: #450 |
Beta Was this translation helpful? Give feedback.
0 replies
-
minor naming comment : if we want to expose the await syntax, then maybe optionally we could also have
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes, I think I saw that in my search through the docs.Sometimes we don’t have an explicit clock. But my main concern is actually performance. I would hope that waiting for the time equivalent of 10,000 clock cycles should be much efficient than actually waiting on 10,000 individual clock edges.On 3 Jan 2024, at 17:36, Max Korbel ***@***.***> wrote:
By the way, ROHD-VF already has a waitCycles function, which is useful if you wish to wait on edges rather than simulator time
https://intel.github.io/rohd-vf/rohd_vf/LogicWaiter/waitCycles.html
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I notice that the simulator documentation for registerAction says this:
/// Registers an abritrary [action] to be executed at [timestamp] time.
///
/// The [action], if it returns a [Future], will be
await
ed.static void registerAction(int timestamp, dynamic Function() action) { ...
So I wondering if it is possible to write a wait( int delay ) function which awaits a Future to provide wait( time ) like semantics ? Or has this already been done somewhere ?
Thanks,
Adam.
Beta Was this translation helpful? Give feedback.
All reactions