Open parker-research opened 1 month ago
Icarus does check for and report some possible infinite loops, but it does not currently search for combinational infinite loops. We have added instrumentation in the code the compiler generates that can help debug these kind of issues when it is enabled, but I can't remember if continuous assignments are instrumented. I think it is currently just procedural code so you would need to change from an assign to always_comb to find the actual loop. The other possible way to track this down is to figure out which transition is triggering the combinational loop and then think about how the variables are changing and how it could create a combinational oscillation.
I've been looking at LLM generated code for a bit and for some things the generated code is okay, but there are often cases where the code is incorrect from an implementation perspective or just plain invalid Verilog. If you tell the LLM it has generated invalid code it will come back and say yes you are correct, but that seems more of a socially acceptable response when the validity of the generated code is challenged.
Is this code even valid Verilog? I assumed it wasn't (as it's outside of an always_comb
, which could be used to make a ring oscillator with this sort of code intentionally), but I could be wrong.
The following code contains a bug, where signals reference each other in a sort of non-deterministic infinite loop. Currently, IVerilog stalls during the
vvp
execution stage. I believe that it should instead provide an error during compile, or end in an error during the exeuction.IVerilog version: OSSCAD Release 2024-05-01
Execution commands:
Input File 1:
attempted_solution_code.sv
(generated by a large language model):Input File 2:
testbench_code.sv
: