Open cebarobot opened 5 days ago
How about cleaning the build directory before running verilator
? We can run clean_obj when building $(EMU_MK)
Then the common.cpp
will always be re-compiled once the DUT changes.
How about cleaning the build directory before running
verilator
? We can run clean_obj when building $(EMU_MK)Then the
common.cpp
will always be re-compiled once the DUT changes.
I think the overhead is huge. In that way, more than 25 cpp files need to be recompiled...
How about cleaning the build directory before running
verilator
? We can run clean_obj when building $(EMU_MK) Then thecommon.cpp
will always be re-compiled once the DUT changes.I think the overhead is huge. In that way, more than 25 cpp files need to be recompiled...
Compared to recompiling the DUTs, compiling only 25 C++ files is minor. I believe the current bottleneck is at compiling Verilater-generated C++ files?
Or, how about cleaning only common.o
, if you don't want recompiling 25 files?
Related component: build
Describe the bug
When running emu, it would print the emu compilation time at first. But if I modify any RTL code or c/c++ code and rebuild the emu, the compilation time which emu prints never changed. It is always the time when the project was built for the first time.
To Reproduce Steps to reproduce the behavior:
build/emu
file timestamp.src/main/scala/xiangshan/backend/fu/Alu.scala
build/emu
file timestamp.Expected behavior The
emu compiled at
timestamp should reflect the most recent compilation time. Or at least update whenever the source code (Verilog) changes.Screenshots After fisrt build:
After a modification of source code and second build:
What you expect us (DiffTest developers) to do for you
The
emu compiled at
timestamp is printed in functioncommon_init_without_assertion
in C++ filecommon.cpp
:It use two marco:
__DATE__
and__TIME__
. These two macros will be replaced with their actual values during the preprocessing step of compilingcommon.cpp
. After preprocessing, such line code may change to: (Actually,Info
should also be replaced, but it does not matter here).Therefore, after compilation, "Nov 17 2024", "19:59:39" was hardcoded into
common.o
. Unless recompile thecommon.cpp
, functioncommon_init_without_assertion
would always print outemu compiled at Nov 17 2024, 19:59:39
.Now let see whether
common.cpp
will be recompiled.The compilation of
common.cpp
is controled byVSimTop.mk
, the makefile generate by verilator. The resultcommon.o
has these dependency:It's obviously that, there is no verilog files and c++ files generated from verilog files in denpency.
Additional context
Also see #508.