-
Notifications
You must be signed in to change notification settings - Fork 175
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
Amaranth emitted invalid Verilog (Amaranth conditionals containing only comb assignments results in Verilog "empty case" error) #931
Comments
Cleared pdm.lock, upgraded to Amaranth 0.4.dev214+gc7da6c1. No apparent change. Can re-upload errors/core.v from new code if helpful. |
Looking at the error site: In my code, I have this complex tree of checking conditions such as "bottom_left_diag" "top_left_diag" |
I... don't think that's accurate at all? |
The Verilog grammar does not allow an empty case. Most synthesis tools are quite permissive about this, but Quartus is not. This causes problems for amaranth with Quartus (see amaranth-lang/amaranth#931).
Okay. Well in any case these case statements were empty as if their contents had been optimized away. |
In my testing, this is fixed by YosysHQ/yosys#3992 (With that patch, my code will successfully build. When run, the code paints a black screen. Because this is the first time I have compiled it, it is as of yet unclear to me whether that is correct.) |
Update: Fixed some logic bugs so the screen is no longer back and can confirm, yosys#3992 fixes the issue |
@wanda-phi Is this something that was broken in Yosys since forever, or is this relatively new? Asking because we might want to update the Yosys version constraint in response to this issue. |
I'm reasonably sure that has been broken since forever. |
Thanks. In that case once the upstream PR gets merged I'll need to bump amaranth-yosys dependency and also required Yosys version. |
It has already been merged. |
Ah right. In that case I'm waiting until the next version bump so that I can do something reasonably consistent in face of this monstrosity. |
Yosys 0.35 was released, so that can become our new Yosys requirement. |
The Verilog grammar does not allow an empty case. Most synthesis tools are quite permissive about this, but Quartus is not. This causes problems for amaranth with Quartus (see amaranth-lang/amaranth#931).
Using Amaranth (0.4.dev198+g05cb82b) to target Cyclone V (Analogue Pocket), which means generating Verilog which gets parsed by Quartus. Got an error of invalid Verilog from Quartus.
Errors contained phrases such as
Repro code:
https://github.com/mcclure/analogue-core-template-amaranth/tree/control-test COMMIT 2354a5e
Build steps (contains system local paths):
Error messages:
quartus_errors.txt
Referenced amaranth_core.v:
amaranth_core.v.txt
This code is a slight modification of code which worked.
I have not yet tried clearing my pdm.lock.
The text was updated successfully, but these errors were encountered: