efeslab / hardware-bugbase

16 stars 7 forks source link

A possible bug about the verilator reproducing Makefile #10

Closed JacyCui closed 5 months ago

JacyCui commented 5 months ago

Following the steps described in artifact README, I got the following error message:

~/asplos22-hardware-debugging-artifact/hardware-bugbase/d1-buffer-overflow-rsd$ make -j8
echo sources.txt
sources.txt
../../veripass/verilator/bin/verilator -cc -timescale-override 10ps/10ps -Wno-WIDTH -Wno-LITENDIAN -Wno-UNPACKED -Wno-BLKANDNBLK -Wno-CASEINCOMPLETE -Wno-CASEX -Wno-TIMESCALEMOD -Wno-BLKLOOPINIT -Wno-PINMISSING -Wno-ALWCOMBORDER -Wno-VLTAG -trace-fst -trace-structs -comp-limit-syms 0 -assert -trace-max-array 65536 -trace-max-width 65536 -F sources.txt -top-module ccip_std_afu_wrapper --Mdir work
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
make -C work -f Vccip_std_afu_wrapper.mk
make[1]: Entering directory '/home/jacy/asplos22-hardware-debugging-artifact/hardware-bugbase/d1-buffer-overflow-rsd/work'
Vccip_std_afu_wrapper.mk:52: /usr/local/share/verilator/include/verilated.mk: No such file or directory
make[1]: *** No rule to make target '/usr/local/share/verilator/include/verilated.mk'.  Stop.
make[1]: Leaving directory '/home/jacy/asplos22-hardware-debugging-artifact/hardware-bugbase/d1-buffer-overflow-rsd/work'
make: *** [Makefile:34: verilator] Error 2

Then I had a look at the makefile asplos22-hardware-debugging-artifact/hardware-bugbase/d1-buffer-overflow-rsd/work/Vccip_std_afu_wrapper.mk and found that there was a mis-definition

VERILATOR_ROOT = /usr/local/share/verilator

which was automatically generated by verilator.

So I turned to /asplos22-hardware-debugging-artifact/hardware-bugbase/d1-buffer-overflow-rsd/Makefile:33 and changed

$(MAKE) -C $(RTL_WORK_DIR) -f V$(TOP_MODULE).mk

to

$(MAKE) -C $(RTL_WORK_DIR) -f V$(TOP_MODULE).mk VERILATOR_ROOT=$(VERILATOR_ROOT)

in order to override the mis-definition automatically generated by verilator.

I'm wondering if this is a bug that need to be fixed or it just applies for my pc. If it could possibly happen again and needs to be fixed, I'm willing to make a pr.

JacyCui commented 5 months ago

There're similar problems concerning verilator path with other Makefiles too.

mjc0608 commented 5 months ago

Yeah it looks indeed a problem in the makefile. Can you make a pr?

JacyCui commented 5 months ago

Sure!

mjc0608 commented 5 months ago

Pull request merged in #11