-
Notifications
You must be signed in to change notification settings - Fork 175
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
add API to get simulation time for debugging #443
Comments
Sounds reasonable. |
API suggestion: m = Module()
m.d.sync += Signal().eq(0)
sim = Simulator(m)
def process():
yield Delay(12345e-6)
now = sim.now # for use inside or outside processes
print("current time:", now)
now = (yield GetTime()) # for use inside processes -- useful when sim is not visible
print("current time:", now)
sim.add_sync_process(process)
sim.add_clock(1e-6)
with sim.write_vcd("out.vcd", "out.gtkw", traces=[]):
sim.run() |
There's a good reason to not expose Regarding |
I filed #535 to track the time representation issue. |
We're currently just printing it, though it would be handy to have it (or a formatted version) available in case you want to have the output go somewhere other than |
I was thinking that Simulator would have an API to capture Display statements (as well as Assert, etc) from PySim as well as CXXSim. |
Closing in favor of being able to print time via If new use cases arise we can reconsider this. |
currently,
sim._state.timeline.now
must be used for pysim. It would be nice to have an official public API entrypoint for that instead.The text was updated successfully, but these errors were encountered: