forked from Wren6991/Hazard3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (31 loc) · 991 Bytes
/
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
APP := coremark
MAX_CYCLES := 100000000
CROSS_PREFIX ?= riscv32-unknown-elf-
TBEXEC ?= ../tb_cxxrtl/tb
TBDIR := $(dir $(abspath $(TBEXEC)))
###############################################################################
.SUFFIXES:
.PHONY: all run waves view bin tb clean clean_tb
all: run
run: $(APP).bin
$(TBEXEC) --bin $(APP).bin --cycles $(MAX_CYCLES)
waves: $(APP).bin
$(TBEXEC) $(APP).bin $(APPNAME)_run.vcd --cycles $(MAX_CYCLES)
view: run
gtkwave $(APP)_run.vcd
bin: $(APP).bin
tb:
$(MAKE) -C $(TBDIR) tb
clean:
rm -f $(APP).elf $(APP).bin $(APP).dis $(APP)_run.vcd
rm -rf dist/build/
clean_tb: clean
$(MAKE) -C $(TBDIR) clean
###############################################################################
$(APP).bin: $(APP).elf
$(CROSS_PREFIX)objcopy -O binary $^ $@
$(CROSS_PREFIX)objdump -h $(APP).elf > $(APP).dis
$(CROSS_PREFIX)objdump -d $(APP).elf >> $(APP).dis
$(APP).elf:
make -C dist
cp dist/build/coremark.elf $(APP).elf