Repository: steveicarus/iverilog

Issue #1156: During simulation, iverilog mistakenly assigned a value to an undriven variable.
Created: 2024-08-06T12:33:09Z
We are practicing the basic function of' verilog', so we use three different tools,' iverilog',' vivado' and' quartus', to simulate the same comprehensive file' Subsystem.v' to verify the simulation results of our model. Theoretically, the same verilog project should have the same simulation results in three different simulation tools, but we found that the results were not the same after verification. Among them, the simulation results of' vivado' and' quartus' are consistent, while' iverilog' is inconsistent with the simulation results of the other two tools.

quarterssimulation results.

iverilogsimulation results.

vivadosimulation results.
Specifically, as shown in the following figure, the difference lies in' 0ns-100ns'. It can be clearly seen in the tools of' vivado' and' quartus' that the assignment of' hdl_out' is' x', while in' 0ns-50ns', a fixed value is given in the tool of' iverilog', and after '50ns', it is. Iverilog' seems to have incorrectly assigned a variable that is not driven. Currently for the same.
Our source files are as follows, in which Subsystem.v is our main file.
source.zip

Duplicate issue #1161: During simulation, hdl_out was incorrectly assigned a value.
Created: 2024-08-25T08:59:35Z
We are practicing the basic functions of Verilog. To verify the simulation results of our model, we are using three different tools, namely iverilog, vivado, and quartus, to simulate the same synthesis file, Subsystem. v, in order to validate our model. In this Verilog code, a module called Subsystem is defined, which implements a series of numerical calculations and logical operations. Internally, the module processes input signals (clock, reset, enable) by instantiating multiple submodules and some computational logic. The data is stored and updated through two register arrays (cfblk185_deg and cfblk184_deg), and cfblk153_out1 is calculated as the difference between cfblk184_out1 and cfblk177_out1. Then, the module cfblk157 generates cfblk157_out1, which is assigned to Hdl_out to generate an 8-bit output signal Hdl_out.
In theory, the same Verilog project should have the same simulation results in three different simulation tools, but after verification, we found that the results were not the same. Among them, the simulation results of 'vivado' and 'quartus' are consistent, while the simulation results of' iverilog 'are inconsistent with the other two tools. As shown in the following figure, the difference is that after '0ns', it can be clearly seen in the' vivado 'and' quartus' tools that the assignment of 'hdl_out' is' x ', but in the' iverilog 'tool, a fixed value is given` It seems that iverilog has incorrectly assigned a value to a variable that is not driven. At present, we believe that the inconsistency in running the same Verilog project on different tools is a potential defect of the iverilog tool.
Running process of iverilog: We simulate the Verilog code by entering the commands iverilog - o wave - y Subsystem. v Subsystem. tb. v and vvp - n wave - lxt2 (source file: Subsystem. v, excitation file: Subsystem. tb. v), and finally enter gtkwave wave. vcd to view the waveform.
Iverilog version number: Icarus Verilog version 12.0 (develop) (s20150603-1110-g18392A46).
GTKWave Analyzer v3.3.108 (w)1999-2020 BSI.

iverilog simulation results Waveform.

quartus simulation results Waveform.

vavidosimulation results Waveform.
Our source files are as follows, where Subsystem. v is our main file.
source_1.zip

Closing comment (2024-08-26T06:49:56Z): This looks to be exactly the same as #1156 and #1151. iverilog is working 100% as defined by the standard and the other tools are not matching the functionality specified in the standard (though this could be how they have been configured). I verified this using an industry standard tool (configured to follow the standard) and manually looking at the code. I will not give an answer to what you are missing since that is likely part of the assignment.
You may want to focus on fixing the floating signals in your design and once everything is driven correctly I expect all the simulators will give the same result.