-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (53 loc) · 2.19 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
70
71
72
73
74
75
76
77
# Given no targets, 'make' will default to building 'simv', the simulated version
# of the pipeline
# make <- compile (and run) simv if needed
# As shortcuts, any of the following will build if necessary and then run the
# specified target
# make sim <- runs simv (after compiling simv if needed)
# make dve <- runs DVE interactively (after compiling it if needed)
#
# make clean <- remove files created during compilations (but not synthesis)
# make nuke <- remove all files created during compilation and synthesis
#
# synthesis command not included in this Makefile
#
################################################################################
## CONFIGURATION
################################################################################
VCS = SW_VCS=2017.12-SP2-1 vcs -sverilog +vc -Mupdate -line -full64
LIB = /afs/umich.edu/class/eecs470/lib/verilog/lec25dscc25.v
# SIMULATION CONFIG
SIMFILES = verilog/sys_defs.vh verilog/top_level.sv verilog/varint_ser.sv verilog/field_header.sv verilog/zigzag.sv verilog/dram.sv verilog/object_buffer.sv verilog/fetch.sv verilog/memcpy.sv verilog/top_varint.sv verilog/ser_aggregate.sv
TESTBENCH = testbench/top_level_tb.sv
# SYNTHESIS CONFIG
# Passed through to .tcl scripts:
export CLOCK_NET_NAME = clock
export RESET_NET_NAME = reset
export CLOCK_PERIOD = 50 # TODO: You will want to make this more aggresive
################################################################################
## RULES
################################################################################
# Default target:
all: simv
./simv | tee program.out
.PHONY: all
# Simulation:
sim: simv $(ASSEMBLED)
./simv | tee sim_program.out
simv: $(HEADERS) $(SIMFILES) $(TESTBENCH)
$(VCS) $^ -o simv
syn: $(SIMFILES) $(TESTBENCH)
$(VCS) $^ $(LIB) +define+SYNTH_TEST -o syn_simv
.PHONY: sim
# Debugging
dve_simv: $(HEADERS) $(SIMFILES) $(TESTBENCH)
$(VCS) +memcbk $^ -o $@ -gui
dve: dve_simv $(ASSEMBLED)
./$<
clean:
rm -rvf simv *.daidir csrc vcs.key program.out \
syn_simv syn_simv.daidir syn_program.out \
dve *.vpd *.vcd *.dump ucli.key
nuke: clean
rm -rvf *.vg *.rep *.db *.chk *.log *.out DVEfiles/
.PHONY: clean nuke dve