check: promote some problems to errors by default, add -permissive #5058
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 everycheck
warning an error, effectively.The user should be able to ask for the old behavior by either
check -permissive
synth -check-permissive
for any script pass runningcheck
(that'sproc
andsynth*
)yosys --check-permissive
Alternatively, to avoid strongly customized scripts, we can keep old
check
behavior and add a flag likecheck -smart
and use that in script passes. This way we still get the friendlier UX ofsynth*
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)