-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
141 lines (104 loc) · 2.5 KB
/
Makefile
File metadata and controls
141 lines (104 loc) · 2.5 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
PRJ = $(realpath ./)
PMON = $(PRJ)/sw/pmon
LIB = $(PRJ)/sw/lib
INCLUDES = -I hw
TB = hw/tm
TOP = tm
include prj.mk
AW ?= 16
TOOLS = sw/tools
MODS = hw/defs hw/hwconf hw/version \
hw/computer/decoder \
hw/computer/comp \
hw/computer/addrdec1 \
hw/computer/addrdec2 \
hw/computer/memory \
hw/computer/mems \
hw/computer/reset_2btn \
hw/cpu1/cpu1 \
hw/cpu1/regm \
hw/cpu1/adder \
hw/cpu1/alu1 \
hw/cpu1/pc1 \
hw/cpu1/rfm1 \
hw/cpu1/schedm \
hw/cpu2/cpu2 \
hw/cpu2/alu2 \
hw/cpu2/reg2in \
hw/cpu2/rfm2 \
hw/cpu2/getb \
hw/cpu2/putb \
hw/cpu2/sfr \
hw/computer/gpio_out4 \
hw/computer/brd_ctrl \
hw/computer/gpio_in \
hw/computer/timer \
hw/computer/simif \
hw/computer/arm_fifo \
hw/computer/uart \
hw/computer/uart_rx \
hw/computer/uart_tx \
hw/computer/clock
TB_VER = $(patsubst %,%.v,$(TB))
MODS_VER = $(patsubst %,%.v,$(MODS))
VVP = $(patsubst %,%.vvp,$(TB))
VCD = $(patsubst %,%.vcd,$(TB))
GTKW = $(patsubst %,%.gtkw,$(TB))
include $(PRJ)/sw/common.mk
.PHONY: sw hw pmon
all: progs sw show
compile: sw hw
progs: comp_mon comp_lib
$(MAKE) -C sw/examples all
$(MAKE) -C sw/progs2 all
doc:
$(MAKE) -C $(DOCS) all
comp_pmon:
$(MAKE) -C sw/pmon all
comp_mon: comp_pmon
comp_lib:
$(MAKE) -C sw/lib all
comp_app: comp_mon comp_lib $(PRG).p2h $(PRG).asc $(PRG).cdb
$(PRG).p2h: $(PRG).asm $(LIB)/plib.p2l
php $(TOOLS)/p2as.php -l -o $@ $(PRG).asm $(LIB)/plib.p2l
sw: comp_app
source:
php $(TOOLS)/source.php $(PRG).asc
show: simul
gtkwave $(VCD) $(GTKW)
simul: $(VCD)
sim: $(VCD)
synth: $(VVP)
hw: synth
iss: sw
$(ISS) $(PRG)
emu: sw
$(EMU) $(PRG)
$(VCD): $(VVP)
vvp -n $(VVP)
$(VVP): $(TB_VER) $(MODS_VER) prj.mk sw
iverilog \
-DPRG='"$(PRG).asc"' \
-DINSTS=$(INSTS) \
-DIVERILOG=1 \
$(INCLUDES) \
-o $(VVP) -s $(TOP) $(TB_VER) $(MODS_VER)
hw/version.v: .version $(TOOLS)/tool.php
php $(TOOLS)/tool.php -vg >$@
#compile: $(HEX_FILES) $(ASC_FILES) $(CDB_FILES)
# prepare implementation
impl: progs hw/version.v
clean_files = *~ .cproject .project \
*.cmd_log *.html *.lso *.ngc *.ngr *.prj \
*.stx \
hex2asc source.txt
clean:
$(MAKE) -C sw/examples clean
$(MAKE) -C sw/progs2 clean
$(MAKE) -C sw/pmon clean
$(MAKE) -C sw/tools clean
$(MAKE) -C sw/lib clean
$(MAKE) -C hw clean
$(MAKE) -C docs clean
$(RM) $(clean_files)
$(RM) vivado*.jou vivado*.log