-
Notifications
You must be signed in to change notification settings - Fork 55
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
Working in simulation but incorrect synthesis output? #4
Comments
Sounds like a yosys bug of some sort. Synplify also has issues. This code works in ISE, Vivado, Quartus Prime, and Quartus Prime Pro. |
Okay, I have fixed the issue and it was quite simple. I removed the initialization to zero of |
Very odd. Well, at some point I need to look in to rewriting this module to use a constant function instead of the initial block so that synplify is happy. I have had several people complain about that, IMO it's a synplify bug as most other tools are perfectly fine with constant elaboration from initial blocks. I mainly need to make sure it that will still work in ISE. But if all that looks good, then presumably yosys will also be happy with that. |
Variable declaration assignments such as reg foo = 1; are interpreted by some tools as reg foo; always @(*) foo = 1; and not as reg foo; initial foo = 1; This can cause simulation-synthesis mismatches, as the resultant value of foo depends on how the tool is feeling. Variable declaration assignments are used in four places. However, the variables in question are subsequently assigned in their entirety, Remove these assignments. Closes: alexforencich#4
Alright, I think I finally have a rewrite done that uses constant functions instead of initial blocks, and also does some other reorganizing. Please let me know if it works any better in Yosys. I need to do some more testing, but so far it looks like it works in ISE, Vivado, Quartus Prime, and Quartus Prime Pro. |
The combinatorial LFSR module works perfectly in the following testbench:
I obtain the output
state_out = 0x4AC9A203
, which is correct compared to an online CRC-32 calculator. When I use the following code to synthesize and program an iCE40HX-8K device using the IceStorm toolchain, the output is different.I now obtain
state_out = 0x4E08BFB4
from the hardware. Interestingly, I get the correct results when.data_in(FF)
. Also (may be unrelated), synthesis does not complete with.STYLE("LOOP")
, failing on the error:ERROR: Conflicting init values for signal 1'0 (\crc.i [0] = 1'1, \crc.data_out_reg [0] = 1'0).
Has anyone got this to work correctly on this FPGA/toolchain?
The text was updated successfully, but these errors were encountered: