-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (51 loc) · 2.23 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
.DEFAULT_GOAL := no_arguments
no_arguments:
@echo "Please specify a target to build"
@echo " - init: Initialize submodules"
@echo " - handin: Create a zip file for handin"
@echo " - test-lab1: Run lab1 test"
init:
git submodule update --init --recursive
handin:
@if [ ! -f docs/report.pdf ]; then \
echo "Please write your report in the 'docs' folder and convert it to 'report.pdf' first"; \
exit 1; \
fi; \
echo "Please enter your 'student id-name' (e.g., 12345678910-someone)"; \
read filename; \
echo "Please enter lab number (e.g., 1)"; \
read lab_n; \
zip -q -r "docs/$$filename-lab$$lab_n.zip" \
include vsrc docs/report.pdf
sim-verilog:
@echo "I don't know why, just make difftest happy..."
emu:
$(MAKE) -C ./difftest emu $(DIFFTEST_OPTS)
export NOOP_HOME=$(abspath .)
export NEMU_HOME=$(abspath ./ready-to-run)
sim:
rm -rf build
mkdir -p build
make EMU_TRACE=1 emu -j12 NOOP_HOME=$(NOOP_HOME) NEMU_HOME=$(NEMU_HOME)
test-lab1: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/lab1/lab1-test.bin $(VOPT) || true
test-lab2: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/lab2/lab2-test.bin $(VOPT) || true
test-lab3: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/lab3/lab3-test.bin $(VOPT) || true
test-lab4: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/lab4/lab4-test.bin $(VOPT) || true
test-lab5: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/lab5/lab5-test.bin $(VOPT) || true
test-labnorm: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/labnorm/labnorm-test.bin $(VOPT) || true
all-test-rv64im: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/all-test-rv64im/all-test-rv64im.bin $(VOPT) || true
test-os: sim
TEST=$(TEST) ./build/emu --diff $(NEMU_HOME)/riscv64-nemu-interpreter-so -i ./ready-to-run/test-os/kernel $(VOPT) || true
clean:
rm -rf build
include verilate/Makefile.include
include verilate/Makefile.verilate.mk
include verilate/Makefile.vsim.mk
.PHONY: emu clean sim