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

Approximate synchronization of simulation time for waveform comparisons #220

Open
sgherbst opened this issue May 10, 2024 · 1 comment
Open

Comments

@sgherbst
Copy link
Contributor

Issue reported by @azaidy

Problem is that simulators may run at slightly different rates and drift in terms of cycle count, making it hard to compare events between simulators.

Option 1

Change --max-rate so that clock tick N cannot occur before time N/rate vs. the current meaning, where each clock tick cannot be shorter than 1/rate. Have to think about what happens when one simulation falls behind - does it get stuck behind permanently and hog CPU resources, bringing down the rest of the simulation?

Option 2

Record the wall time of each clock tick and "fix" the VCD so that clock ticks are scaled according to the wall time taken. Scale factor could be max_rate/Fclk. To see why, imagine that a clock tick takes 1/max_rate of wall time; that will correspond to 1/Fclk of simulation time. Will result in strange-looking VCDs, but they will be correct in terms of event ordering.

@sgherbst
Copy link
Contributor Author

sgherbst commented May 11, 2024

Option 3 from @azaidy

Send clock tick number along with SB packets and accelerate the local tick count if the incoming tick value is higher. Then add gaps in the waveforms with postprocessing based on the tick value.

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

No branches or pull requests

1 participant