You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attached example shows a localparam assigned by a constant function which returns a nested struct.
The code results in the following Verilator error:
%Error: Internal Error: ../V3Number.cpp:641: toUQuad with 4-state 32'bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
There are two tweaks that cause the code to work:
Get rid of the nested struct (`define USE_FLAT), or
Keep the nested struct but leave only 1 element in the nested struct (`define ONE_FIELD)
In a larger system, this incompatibility is not actually causing a compile error, but it is causing a problem where a generate statement that uses this nested struct field as an upper bound on a for loop is not iterating properly. I got this Internal Error when trying to create a small test case.
Run the test with:
verilator +1800-2012ext+sv -Wall --cc struct_param.sv --exe sim_main.cpp --top-module struct_test; make -j -C obj_dir -f Vstruct_test.mk Vstruct_test; obj_dir/Vstruct_test
The text was updated successfully, but these errors were encountered:
Author Name: Matt Myers
Original Redmine Issue: 1149 from https://www.veripool.org
The attached example shows a localparam assigned by a constant function which returns a nested struct.
The code results in the following Verilator error:
There are two tweaks that cause the code to work:
In a larger system, this incompatibility is not actually causing a compile error, but it is causing a problem where a generate statement that uses this nested struct field as an upper bound on a for loop is not iterating properly. I got this Internal Error when trying to create a small test case.
Run the test with:
verilator +1800-2012ext+sv -Wall --cc struct_param.sv --exe sim_main.cpp --top-module struct_test; make -j -C obj_dir -f Vstruct_test.mk Vstruct_test; obj_dir/Vstruct_test
The text was updated successfully, but these errors were encountered: