-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
78 lines (55 loc) · 2.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
SCALA_FILE = $(shell find ./src/main/scala -name '*.scala' 2>/dev/null)
VERILOG_FILE = $(shell find ./vsrc -name '*.v')
SYSTEMVERILOG_FILE = $(shell find ./vsrc -name '*.sv')
USE_READY_TO_RUN_NEMU = true
.DEFAULT_GOAL = verilog
include Makefile.include
ifeq ($(wildcard src/*), )
SCALA_CODE = "false"
else
SCALA_CODE = "true"
endif
build/SimTop.v: $(SCALA_FILE)
mkdir -p build
ifeq ($(SCALA_CODE), "true")
mill chiselModule.runMain $(SCALA_OPTS)
endif
# cp -r vsrc/* build
verilog: build/SimTop.v
sim-verilog: verilog
emu: verilog
$(MAKE) -C ./difftest emu $(DIFFTEST_OPTS)
clean:
rm -rf build out
export NOOP_HOME=$(abspath .)
# export FST_HOME=~
sim:
rm -rf build
mkdir -p build
# cp -r vsrc/* build
make EMU_TRACE=1 emu -j12 NOOP_HOME=$(NOOP_HOME) NEMU_HOME=.
test-lab1a: sim
TEST=$(TEST) ./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/lab1/lab1-test-a.bin $(VOPT) || true
test-lab1: sim
TEST=$(TEST) ./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/lab1/lab1-test.bin $(VOPT) || true
test-lab2: sim
TEST=$(TEST) ./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/lab2/all-test-rv64i.bin $(VOPT) || true
test-lab3: sim
TEST=$(TEST) ./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/lab3/all-test-rv64im.bin $(VOPT) || true
microbench:
make sim BENCHMARK=1
./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/challenge/microbench-riscv64-nutshell.bin $(VOPT) || true
test-lab4: sim
TEST=$(TEST) ./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/lab4/all-test-priv.bin $(VOPT) || true
test-lab4full: sim
TEST=$(TEST) ./build/emu --diff ./riscv64-nemu-interpreter-so -i ./ready-to-run/lab4/all-test-privfull.bin $(VOPT) || true
include verilate/Makefile.include
include verilate/Makefile.verilate.mk
include verilate/Makefile.vsim.mk
test-cache:
@rm -rf build && make vsim -j4
test-cache-gdb:
@rm -rf build && make vsim-gdb -j4
test-refcache:
@rm -rf build && make vsim -j4 REFERENCE_CACHE=1
.PHONY: verilog emu clean sim