Skip to content
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

Correctly simulate passed time before first clock edge in verilator #50

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

lmbollen
Copy link
Member

The FFI code used a default of 50 nanoseconds as time passed before the first clock edge. This resulted in an unobservable reset pulse when used with resetGenN d1 because verilator's simulation time is off by a factor 1000.

Now derive the time before the clock edge as a single period of vexrisc clock domain.

@lmbollen lmbollen force-pushed the lucas/verilator-boot-sim-time branch 2 times, most recently from 98e1fb2 to 276c0ab Compare January 10, 2025 13:05
clash-vexriscv/src/VexRiscv.hs Outdated Show resolved Hide resolved
@martijnbastiaan martijnbastiaan changed the title Correcetly simulate passed time before first clock edge in verilator Correctly simulate passed time before first clock edge in verilator Jan 10, 2025
@lmbollen lmbollen force-pushed the lucas/verilator-boot-sim-time branch from 276c0ab to e85979a Compare January 10, 2025 13:37
@lmbollen lmbollen enabled auto-merge (squash) January 10, 2025 13:48
@lmbollen lmbollen force-pushed the lucas/verilator-boot-sim-time branch 2 times, most recently from 857259c to 3f2c0b0 Compare January 10, 2025 14:58
`9.2` barely works with clash
 `9.4.8` has the slow start problem
@lmbollen lmbollen force-pushed the lucas/verilator-boot-sim-time branch from 3f2c0b0 to 27d4e92 Compare January 10, 2025 14:59
The FFI code used a default of 50 nanoseconds as time passed before the first clock edge.
This resulted in an unobservable reset pulse when used with `resetGenN d1` because  verilator's simulation time is off by a factor 1000.

Now derive the time before the clock edge as a single period of vexrisc clock domain.
@lmbollen lmbollen force-pushed the lucas/verilator-boot-sim-time branch from 27d4e92 to 8ce18ba Compare January 10, 2025 14:59
@lmbollen lmbollen merged commit 3a26b8b into main Jan 10, 2025
9 checks passed
@lmbollen lmbollen deleted the lucas/verilator-boot-sim-time branch January 10, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants