-
Notifications
You must be signed in to change notification settings - Fork 12
Add an RFC for async testbench functions. #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fd167b4
to
1a31cd7
Compare
I'm de-nominating this RFC since it depends on #27 which isn't ready yet. |
1a31cd7
to
b1e1810
Compare
Updated to match the changes in #27. |
b1e1810
to
4de07a2
Compare
We have discussed this RFC on the 2024-02-26 weekly meeting. Several concerns were raised about the RFC:
|
I think this should add a function |
I think that is a good idea, but orthogonal enough to this RFC that it deserves its own RFC. I can write it if you'd like. |
Sounds good to me! |
4046ee9
to
cfb4744
Compare
cfb4744
to
54e6a60
Compare
What is the type of the returned value? |
Presumably seconds as a |
Using |
In that case I propose we change all simulation time units to seconds as a |
Sounds good to me. It should internally use femtoseconds though. |
Shouldn't what's used internally be an implementation detail left to the simulation engine? That said, using femtoseconds would throw away the benefit of using a Is it worth using a more complicated type than |
CXXRTL uses femtoseconds internally (with a custom data type wrapping them into a integral seconds plus fractional second as femtoseconds) and I'd like the rounding error to match between Python and C++. |
Some comments in advance of the Monday meeting.
This example has the glaring issue of not having any way of specifying the clock domain at all. This needs to be called out in the RFC text as an avenue for future work; i.e. that the example isn't the outcome directly enabled by the RFC but a desirable future result. A better solution perhaps is to reframe these functions as not methods on the streams themselves but as helpers that could be eventually put onto the streams. Then you can just have the clock domain as an argument (or ignore it like I did in some single-clock code I worked on recently) and the example motivates the RFC well.
Should Alternatives:
I particularly like the 2nd alternative since it further cements the distinction in the application of the two APIs, which I would like to make as clear as possible.
It's not completely clear to me, but when do we want passive testbenches? If we remove
Now that we've amended the RFC to have a different API for legacy and async processes we can pass the argument positionally.
This does not just work on signals, right? I think the actual signature is best described by the two overloads:
RFC #51 has been accepted.
Similarly I would propose:
(Emphasis on argument names here.)
I think this needs a better type specification. I don't recall what we currently support so I'll leave it as-is. Should
There are two significant design issues with The design issues are:
Some strawman proposals I can come up with:
We probably need some way to trigger on up to two signals with specific values (for sync processes), or an arbitrary number of values without specific values (for comb processes). Strawman proposals:
I think my final proposal is a variation on some of the above, namely the combination of:
Examples:
Proposed new name: Alternative:
Given the lack of consensus on what it should return in the current codebase (with the proposed solution being a new type,
Addressed in this comment.
Seems OK to me to include with this name. People who use autocompletion on
This is trivial to work around with the current syntax: for _ in range(5): await sim.tick() Adding syntax for this would be an optimization, but pysim doesn't need it and cxxsim isn't anywhere near the stage where it can be used. I think this concern can be safely ignored in this RFC (and moved to "Future work"). |
General comment: a new simulation interface also needs to be defined for |
After thinking a bit on the Since
|
I'd also like to again raise the point that I brought up on the last meeting, and that apparently got lost. We have effectively two kinds of processes, in which |
… domain trigger objects and combinable trigger objects.
We have discussed this RFC on the 2024-03-18 weekly meeting. The disposition was to merge. Unresolved questions were resolved as follows:
|
8dacc44
to
09771a0
Compare
Rendered