Skip to content

check: promote some problems to errors by default, add -permissive #5058

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

widlarizer
Copy link
Collaborator

Some problems check discovers are too severe to keep as warnings by default.

Yosys is expected to continue to cover dodgy scenarios, such as combinational loops in flip flop models[1]. multiple drivers for a signal[2], and undriven signals. When you mix a couple of these you can end up with nasty results[3]. For greater user experience, we should treat multiple drivers and possibly combinational loops as an error at any point we may encounter it, unless the user specifies otherwise. This is different from check -assert which makes every check warning an error, effectively.

The user should be able to ask for the old behavior by either

  • directly using a flag like check -permissive
  • indirectly using a flag like synth -check-permissive for any script pass running check (that's proc and synth*)
  • maybe as a driver option like yosys --check-permissive

Alternatively, to avoid strongly customized scripts, we can keep old check behavior and add a flag like check -smart and use that in script passes. This way we still get the friendlier UX of synth* with less breakage.

A change to check like this could also be a step towards design-level invariant flags ("design has no loops", "design only includes fine-grained cells" etc) that have been brought up a couple of times by now

[1] tests/asicworld/code_hdl_models_d_ff_gates.v, this should make the CI red on this draft
[2] opt_clean.cc
[3] #4979 (comment)

@KrystalDelusion
Copy link
Member

I think having the option of making more problems as errors, without making all problems as errors, is good. I don't know if doing it by default is the best way (not that I think it shouldn't be the default, I'm just not sure how much breakage there would be vs benefit of avoiding later problems)

@widlarizer
Copy link
Collaborator Author

One pattern I'm seeing twice in the failing tests already is a latch with a comb path from Q to D, that isn't ever activated all the way through:
tests/various/dynamic_part_select/latch_002_gate.v
abc9_test009 and others in tests/simple_abc9/abc9.v

@widlarizer
Copy link
Collaborator Author

The tests are passing except for quicklogic, but it really looks like we're not quite ready yet. We have to fix #5106 and #4792 first, or just work around #5106 in quicklogic sim files. If we only work around it though, we're going to be breaking more user designs to require permissive checks

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