forked from CompArchFA17/Lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (21 loc) · 765 Bytes
/
Makefile
File metadata and controls
31 lines (21 loc) · 765 Bytes
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
# Assembly simulation in Verilog unified Makefile example
include settings.mk
GTKWAVE := gtkwave
SIM := vvp
# Final waveform to produce is the combination of machine and program
WAVEFORM := $(TOPLEVEL)-$(PROGRAM).vcd
WAVEOPTS := filters/$(WAVEFORM:vcd=gtkw)
# Build memory image, compile Verilog, run simulation to produce VCD trace
$(WAVEFORM): settings.mk
$(MAKE) -C asm $(MEMDUMP)
$(MAKE) -C verilog $(TOPLEVEL).vvp
$(SIM) verilog/$(TOPLEVEL).vvp +mem_fn=asm/$(MEMDUMP) +dump_fn=$@
# Open waveform with saved formatting and filter options
scope: $(WAVEFORM) $(WAVEOPTS)
$(GTKWAVE) $(WAVEOPTS)
# Remove generated files, including from subdirectories
clean:
$(MAKE) -C asm clean
$(MAKE) -C verilog clean
rm -f $(WAVEFORM)
.PHONY: scope clean