Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make run-emulator-debug fails, even though run-emulator works #9

Open
apaj opened this issue Jul 27, 2019 · 1 comment
Open

make run-emulator-debug fails, even though run-emulator works #9

apaj opened this issue Jul 27, 2019 · 1 comment

Comments

@apaj
Copy link

apaj commented Jul 27, 2019

Hi,
everything is running smoothly until I try to do make run-emulator-debug. That results in the following:

running basedir/Makefile: make run-emulator-debug

make -C emulator/rv32_1stage/ run-debug
make[1]: Entering directory '/home/apaj/riscv-sodor/emulator/rv32_1stage'
make[1]: *** No rule to make target 'run-asm-tests-debug', needed by 'run-debug'.  Stop.
make[1]: Leaving directory '/home/apaj/riscv-sodor/emulator/rv32_1stage'
Makefile:97: recipe for target 'emulator/rv32_1stage/generated-src-debug/timestamp' failed
make: *** [emulator/rv32_1stage/generated-src-debug/timestamp] Error 2

At this webpage, I found this text:

When run in debug mode, all processors will generate .vcd information (viewable by your favorite waveform viewer). All processors can also spit out cycle-by-cycle log information. Although already done for you by the build system, to generate .vcd files, see emulator/common/Makefile.include to add the "-v${vcdfilename}" flag to the emulator-debug binary.

When I open Makefile.include, I do see this part:

output:
        mkdir -p $@

$(addprefix output/, $(global_asm_vcd)): output/%.vcd: $(global_tstdir)/% emulator-debug
        mkdir -p output
        ./emulator-debug -v$@ +max-cycles=$(asm_test_timeout) +verbose +loadmem=$< 2> /dev/null

...

$(addprefix output/, $(global_bmarks_vcd)): output/%.riscv.vcd: $(global_bmarkdir)/%.riscv emulator-debug
        mkdir -p output
        ./emulator-debug -v$@ +max-cycles=$(bmark_timeout) +verbose +loadmem=$< 2> /dev/null

but, unfortunately, I have to admit I don't really see how to add -v if it's already there...

Could someone please advise?

Thanks,
Aleksandar

@abignail
Copy link

/emulator/commom/Makefile.include

1.line 55, completion the line:

CHISEL_ARGS_DEBUG := -td emulator/${MK_TARGET_PROC}/generated-src-debug

2.line 72: add a new line (compare with 'generated-src' above line 72 ):

generated-src-debug/Top.v: $(srcDir)/src/${MK_TARGET_PROC}/.scala $(srcDir)/src/common/.scala
cd $(buildDir) &amp;&amp; $(SBT) "project ${MK_TARGET_PROC}" "run $(CHISEL_ARGS_DEBUG)"

##(before the cd is a Tab)

3.line 87: emulator-debug: generated-src/Top.v to:

emulator-debug: generated-src-debug/Top.v

4.line 191: add two new line, the rules for 'run-asm-tests-debug' and 'run-bmarks-test-debug':

run-asm-tests-debug: $(addprefix output/, $(addsuffix .vcd, $(global_asm_tests)))
@echo; perl -ne 'print " [$$1] $$ARGV \t$$2\n" if /{3}(.{8}){3}(.)/' $(patsubst %.vpd,%.out,$^); echo; run-bmarks-test-debug: $(addprefix output/, $(addsuffix .riscv.vcd, $(global_bmarks))) @echo; perl -ne 'print " [$$1] $$ARGV \t$$2\n" if /{3}(.{8}){3}(.)/' $(patsubst %.vpd,%.out,$^); echo;

##(before the @Echos is a Tab)

BTW, you can download it here,
https://gitee.com/abignail/riscv-sodor/blob/master/emulator/common/Makefile.include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants