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

Sequential outputs as clock inputs to other Sequentials trigger late in the simulator #191

Open
mkorbel1 opened this issue Nov 1, 2022 · 1 comment · May be fixed by #192
Open

Sequential outputs as clock inputs to other Sequentials trigger late in the simulator #191

mkorbel1 opened this issue Nov 1, 2022 · 1 comment · May be fixed by #192
Assignees
Labels
bug Something isn't working

Comments

@mkorbel1
Copy link
Contributor

mkorbel1 commented Nov 1, 2022

Describe the bug

If the output of one Sequential is used as a clock trigger to another Sequential, the phased simulator can sometimes detect the edge and drive the outputs of the downstream Sequential one tick late.

This breaks clock dividers.

To Reproduce

Create a clock divider and connect a flop to the output of the divided clock.

Expected behavior

Divided clock properly triggers edge detection on Sequentials.

Actual behavior

Divided clock doesn't trigger edges properly, causing incorrect Sequential behavior.

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

No response

@mkorbel1
Copy link
Contributor Author

mkorbel1 commented Dec 5, 2024

Some useful articles:
https://forum.digilent.com/topic/18256-frequency-divider-in-systemverilog/
https://zipcpu.com/blog/2017/06/02/generating-timing.html

Perhaps rather that supporting all the same things SV does, we should restrict clock division to certain approaches and just detect when it's not one of those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant