Open solomatnikov opened 1 month ago
Note: if --hierarchical
is removed from test_regress/t/t_hier_trace.pl
then it works:
./test_regress/t/t_hier_trace.pl
==SUMMARY: Left 2 Passed 0 Failed 0 Time 0:00
======================================================================
dist/t_hier_trace: ==================================================
-Skip: dist/t_hier_trace: scenario 'dist' not enabled for test
dist/t_hier_trace: -Skip: Skip: scenario 'dist' not enabled for test
==SUMMARY: Left 1 Passed 0 Failed 0 Time 0:00
======================================================================
vlt/t_hier_trace: ==================================================
perl .../verilator/test_regress/../bin/verilator --prefix Vt_hier_trace ../obj_vlt/t_hier_trace/Vt_hier_trace__main.cpp --exe --make gmake --x-assign unique -cc -Mdir obj_vlt/t_hier_trace --fdedup --debug-check --comp-limit-members 10 --trace -j 4 t/t_hier_trace_sub/t_hier_trace.vlt --top-module t -F t/t_hier_trace_sub/top.F --clk clk -f input.vc +define+TEST_OBJ_DIR=obj_vlt/t_hier_trace +define+TEST_DUMPFILE=obj_vlt/t_hier_trace/simx.vcd t/t_hier_trace.v > obj_vlt/t_hier_trace/vlt_compile.log
- V e r i l a t i o n R e p o r t: Verilator 5.025 devel rev v5.024-47-gce5cad17a
- Verilator: Built from 0.028 MB sources in 4 modules, into 0.034 MB in 9 C++ files needing 0.000 MB
- Verilator: Walltime 0.023 s (elab=0.001, cvt=0.007, bld=0.000); cpu 0.000 s on 4 threads; alloced 14.734 MB
make -C obj_vlt/t_hier_trace -f .../verilator/test_regress/Makefile_obj --no-print-directory VM_PREFIX=Vt_hier_trace TEST_OBJ_DIR=obj_vlt/t_hier_trace CPPFLAGS_DRIVER=-DT_HIER_TRACE OPT_FAST=-O0 OPT_GLOBAL=-O0 Vt_hier_trace > obj_vlt/t_hier_trace/vlt_gcc.log
driver: Entering directory '.../verilator/test_regress/obj_vlt/t_hier_trace'
g++ -I. -MMD -I.../verilator/test_regress/../include -I.../verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_hier_trace -DVM_PREFIX=Vt_hier_trace -DVM_PREFIX_INCLUDE="<Vt_hier_trace.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_hier_trace___024root.h>" -DT_HIER_TRACE -DVL_LOCK_SPINS=10000 -O0 -c -o Vt_hier_trace__main.o ../../obj_vlt/t_hier_trace/Vt_hier_trace__main.cpp
g++ -O0 -I. -MMD -I.../verilator/test_regress/../include -I.../verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_hier_trace -DVM_PREFIX=Vt_hier_trace -DVM_PREFIX_INCLUDE="<Vt_hier_trace.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_hier_trace___024root.h>" -DT_HIER_TRACE -DVL_LOCK_SPINS=10000 -c -o verilated.o .../verilator/test_regress/../include/verilated.cpp
g++ -O0 -I. -MMD -I.../verilator/test_regress/../include -I.../verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_hier_trace -DVM_PREFIX=Vt_hier_trace -DVM_PREFIX_INCLUDE="<Vt_hier_trace.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_hier_trace___024root.h>" -DT_HIER_TRACE -DVL_LOCK_SPINS=10000 -c -o verilated_vcd_c.o .../verilator/test_regress/../include/verilated_vcd_c.cpp
g++ -O0 -I. -MMD -I.../verilator/test_regress/../include -I.../verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_hier_trace -DVM_PREFIX=Vt_hier_trace -DVM_PREFIX_INCLUDE="<Vt_hier_trace.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_hier_trace___024root.h>" -DT_HIER_TRACE -DVL_LOCK_SPINS=10000 -c -o verilated_threads.o .../verilator/test_regress/../include/verilated_threads.cpp
/usr/bin/python3 .../verilator/test_regress/../bin/verilator_includer -DVL_INCLUDE_OPT=include Vt_hier_trace.cpp Vt_hier_trace___024root__DepSet_h8d33681b__0.cpp Vt_hier_trace___024root__DepSet_h58621984__0.cpp Vt_hier_trace__Trace__0.cpp Vt_hier_trace___024root__Slow.cpp Vt_hier_trace___024root__DepSet_h58621984__0__Slow.cpp Vt_hier_trace__Syms.cpp Vt_hier_trace__Trace__0__Slow.cpp Vt_hier_trace__TraceDecls__0__Slow.cpp > Vt_hier_trace__ALL.cpp
g++ -O0 -I. -MMD -I.../verilator/test_regress/../include -I.../verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_hier_trace -DVM_PREFIX=Vt_hier_trace -DVM_PREFIX_INCLUDE="<Vt_hier_trace.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_hier_trace___024root.h>" -DT_HIER_TRACE -DVL_LOCK_SPINS=10000 -c -o Vt_hier_trace__ALL.o Vt_hier_trace__ALL.cpp
echo "" > Vt_hier_trace__ALL.verilator_deplist.tmp
g++ Vt_hier_trace__main.o verilated.o verilated_vcd_c.o verilated_threads.o Vt_hier_trace__ALL.a -pthread -lpthread -latomic -o Vt_hier_trace
rm Vt_hier_trace__ALL.verilator_deplist.tmp
driver: Leaving directory '.../verilator/test_regress/obj_vlt/t_hier_trace'
obj_vlt/t_hier_trace/Vt_hier_trace -j 4 > obj_vlt/t_hier_trace/vlt_sim.log
*-* All Finished *-*
- t/t_hier_trace.v:22: Verilog $finish
Can't exec "vcddiff": No such file or directory at ./driver.pl line 2429.
-Skip: vlt/t_hier_trace: No vcddiff installed
vlt/t_hier_trace: -Skip: Skip: No vcddiff installed
==SUMMARY: Passed 0 Failed 0 Skipped 1 Time 0:12
======================================================================
#vlt/t_hier_trace: -Skip: Skip: No vcddiff installed
==TESTS DONE, PASSED w/SKIPS: Passed 0 Failed 0 Skipped 1 Time 0:12
Hierarchical changes the current directory (via make -C), so this is not surprising. It needs to either adjust all paths it might possibly reference, or probably better avoid changing directories when performing the hier make and instead reference the subdirectory as necessary via a new command line option.
Might you be willing to make a pull to do the latter?
Which source files would you suggest to look at?
This is what puts the makefile line with -C for Verilator recursively: https://github.com/verilator/verilator/blob/19cccd170ec546ee4e136e20012e9023f47bc8f5/src/V3EmitMk.cpp#L320
In file test_regress/obj_vlt/t_hier_trace/Vdetail_code__hierMkArgs.f
there are:
"-F" "t/t_hier_trace_sub/top.F"
"-F" "sub.F"
the 2nd is incorrect.
@wsnyder where is m_gparams
in V3HierBlock
set?
The constructor: https://github.com/search?q=repo%3Averilator%2Fverilator%20m_gparams&type=code
Obviously, I knew where the constructor was.
The question was where/how m_gparams
are set.
It looks like m_gparams
is redundant and always empty:
- V3Ast.cpp:1324: Dumping obj_vlt/t_hier_trace/Vt_hier_trace_015_linkdotparam.tree
- V3LinkLValue.cpp:328:linkLValue:
- V3Dead.cpp:542: deadifyModules:
- V3HierBlock.cpp:264:Checking 't' from null
- V3HierBlock.cpp:264:Checking 'sub_top' from null
- V3HierBlock.cpp:264:Checking 'detail_code' from 'sub_top'
- V3HierBlock.cpp:117:gparams() 'detail_code'
- V3HierBlock.cpp:325:Add 'detail_code' with 0 parameters
- V3HierBlock.cpp:117:gparams() 'sub_top'
- V3HierBlock.cpp:325:Add 'sub_top' with 0 parameters
- V3HierBlock.cpp:337:Found usage relation 'sub_top' uses 'detail_code'
- V3HierBlock.cpp:264:Checking '@CONST-POOL@' from null
- V3StatsReport.cpp:231:statsReport:
- V3Ast.cpp:1324: Dumping obj_vlt/t_hier_trace/Vt_hier_trace_990_final.tree
- V3HierBlock.cpp:117:gparams() 'sub_top'
- V3HierBlock.cpp:117:gparams() 'sub_top'
- V3HierBlock.cpp:117:gparams() 'detail_code'
- V3HierBlock.cpp:117:gparams() 'detail_code'
- V3HierBlock.cpp:117:gparams() 'detail_code'
- V3HierBlock.cpp:117:gparams() 'sub_top'
- V3HierBlock.cpp:117:gparams() 'detail_code'
- V3EmitMk.cpp:423: emitHierVerilation:
- V3Os.cpp:427: Running system: make -C obj_vlt/t_hier_trace -f Vt_hier_trace_hier.mk -j 4 hier_verilation
[Detaching after vfork from child process 399937]
make: Entering directory '/work/sols/work/verilator/test_regress/obj_vlt/t_hier_trace'
make[1]: Entering directory '/work/sols/work/verilator/test_regress'
/work/sols/work/verilator/bin/verilator -f obj_vlt/t_hier_trace/Vdetail_code__hierMkArgs.f
Starting Verilator 5.025 devel rev v5.024-52-gde950329b (mod)
Starting Verilator 5.025 devel rev v5.024-52-gde950329b (mod)
- V3Options.cpp:1752: Reading Options File t/t_hier_trace_sub/top.F
- V3Options.cpp:1752: Reading Options File t/t_hier_trace_sub/sub.F
- V3PreProc.cpp:342: DEFINE 'TEST_OBJ_DIR' as 'obj_vlt/t_hier_trace' params ''
- V3PreProc.cpp:342: DEFINE 'TEST_DUMPFILE' as 'obj_vlt/t_hier_trace/simx.vcd' params ''
- V3Options.cpp:1752: Reading Options File sub.F
- V3File.cpp:100: -Info: File not statable: sub.F
%Error: Cannot open -f command file: sub.F
where gparams()
is modified as:
const V3HierBlock::GParams& V3HierBlock::gparams() const {
std::stringstream pss;
for (const auto& p : stringifyParams(m_gparams, false)) {
pss << p.first << " " << p.second << "\n";
}
UINFO(3, "gparams() " << modp()->prettyNameQ() << " " << pss.str() << std::endl);
return m_gparams;
}
The problem is that V3Options::allArgsStringForHierBlock
returns
"--make" "gmake" "--x-assign" "unique" "--fdedup" "--debug-check" "--comp-limit-members" "10" "--debug" "--debugi" "8" "--gdb" "--trace" "-F" "t/t_hier_trace_sub/top.F" "+define+TEST_OBJ_DIR=obj_vlt/t_hier_trace" "+define+TEST_DUMPFILE=obj_vlt/t_hier_trace/simx.vcd" "-F" "sub.F" "t_hier_trace.v" "+librescan" "+notimingchecks" "+libext+.v" "-y" "t" "+incdir+t"
with incorrect "-F" "sub.F"
Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)
What 'verilator' command line do we use to run your example?
See above
What 'verilator --version' are you using? Did you try it with the git master version?
v5.024-gce5cad17a
What OS and distribution are you using?
Linux 5.14.0-427.13.1.el9_4.x86_64
May we assist you in trying to fix this in Verilator yourself?