-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
67 lines (54 loc) · 1.71 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
# neutrino 2019 summer
# IIE CAS
# Please have a look at README.md first
PROJ ?= nexys4ddr
#PROJ ?= nexysvideo
CONFIG ?= DefaultNexys4DDRConfig
#CONFIG ?= DefaultNexysVideoConfig
### vivado source
bootrom_img = rocket-chip/bootrom/bootrom.img
defaultconfig_v = rocket-chip/vsim/generated-src/freechips.rocketchip.system.$(CONFIG).v
firmware_hex = firmware/firmware.hex
vivado_project = $(PROJ)/$(PROJ).xpr
$(defaultconfig_v) : $(bootrom_img)
CONFIG=$(CONFIG) $(MAKE) -C rocket-chip/vsim verilog
@echo "#################################"
@echo "##### DefaultConfig.v built #####"
@echo "#################################"
$(bootrom_img) :
$(MAKE) -C rocket-chip/bootrom
@echo "#################################"
@echo "##### Bootrom.img built #####"
@echo "#################################"
$(firmware_hex) :
$(MAKE) -C firmware all
@echo "#################################"
@echo "##### firmware.hex built #####"
@echo "#################################"
$(vivado_project): $(defaultconfig_v) $(firmware_hex)
vivado -mode batch -source scripts/create_$(PROJ)_vivado_proj.tcl
vivado: $(vivado_project)
vivado $< &
### sd_image
boot_elf = boot.elf
sd_image : $(boot_elf)
$(boot_elf) : $(VMLINUX)
ifndef VMLINUX
$(error Please set VMLINUX. Please take a look at README)
endif
VMLINUX=$(VMLINUX) $(MAKE) -C riscv-pk/build && cp riscv-pk/build/bbl ./boot.elf
@echo "#################################"
@echo "##### boot.elf built #####"
@echo "#################################"
### clean
clean:
$(MAKE) -C rocket-chip/vsim clean
$(MAKE) -C firmware clean
$(MAKE) -C riscv-pk/build clean
-rm $(defaultconfig_v)
-rm $(bootrom_img)
-rm $(firmware_hex)
-rm $(boot_elf)
cleanall:
$(MAKE) clean
-rm -r $(PROJ)