Open mkurc-ant opened 5 years ago
This is currently a warning:
Warning: wire '\q' is assigned in a block at foo.v:8.
Warning: wire '\q' is assigned in a block at foo.v:9.
This was decided when this feature was added to mitigate against false positives (given the complexity of the Verilog standard and frontend), and because Yosys has incorrectly accepted this without any warning for some time beforehand (several other tools do accept this too). If you really need this to be an error, you can use -e 'is assigned in a block'
to make this warning into an error.
In my opinion it should be an error by default and there should be the -w
option to make it a warning. But since you are aware of that issue than I leave it up to you.
+1 for default error, if I’m not mistaken it violates IEEE 1800-2017 (6.5 nets and variables)
Consider the following Verilog design.
It contains an obvious error, the signal
q
in the modulebar
declared as wire instead of reg and used as l-value for procedural assignment in the always block.Expected behavior
For the following call:
Yosys should throw an error that the nonblocking procedural assignment cannot be used on a non-memory signal (eg. wire)
Actual behavior
Yosys infers that the signal
q
is a register and throws no error.When the design is written to Verilog again using the
write_verilog
command, the signalq
appears as reg: