-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (44 loc) · 1.61 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
PP = iverilog -E
VC = iverilog
test_mode_ppv_recipes = gen_nw.v gen_packet_creator.v
normal_ppv_recipes = gen_nw.v gen_packet_creator.v common/* t/* pi/*
ifeq ($(TEST_MODE),1)
ppv_recipes=$(test_mode_ppv_recipes)
else
ppv_recipes=$(normal_ppv_recipes)
endif
# Simulates any testbench and generates waveform, outputs to stdout and logfile
gen_nw.vcd: gen_nw.vvp
vvp -l simulation.log $^ > /dev/null
#-----------# Generated networks Only #---------------------------------------#
gen_nw.vvp: gen_nw_tb.v gen_nw.ppv
$(VC) $^ -o $@
# gen_nw.ppv: gen_nw.v gen_packet_creator.v \
# common/* t/* pi/*
# $(PP) $^ -o $@
gen_nw.ppv: $(ppv_recipes)
$(PP) $^ -o $@
gen_packet_creator.v:
echo "must generate packet creator"
gen_nw_tb.v:
echo "must generate testbench"
gen_nw.v:
echo "must generate network"
#-----------# Non-Generated Modules Below #-----------------------------------#
##-----------# Creates vvp files for testing modules #------------------------#
#
# Note that non-generated testbenches are all contained in tb directory
%.vvp: tb/%_tb.v %.ppv
$(VC) $^ -o $@
##-----------# Creates pre-processed modules #--------------------------------#
%_cluster.ppv: %/*_cluster.v %_switch.ppv
$(PP) $^ -o $@
%_switch.ppv: %/*_switch.v direction_determiner.ppv %_arbiter.ppv
$(PP) $^ -o $@
direction_determiner.ppv: \
common/direction_determiner.v common/direction_params.vh
$(PP) $^ -o $@
%_arbiter.ppv: %/*_arbiter.v common/direction_params.vh
$(PP) $^ -o $@
clean:
rm -f *.vvp *.ppv *.vcd gen_* simulation.log *.txt *.v