-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
49 lines (40 loc) · 1.01 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
#################
##### Files #####
#################
FILES = src/OR2.vhd src/AND2.vhd src/NOT2.vhd
SIMDIR = sim
SIMTOP = gates_tb
SIMFILES = testbench/gates_tb.vhd
##############
#### GHDL ####
##############
GHDL_CMD = ghdl
GHDL_FLAGS = --ieee=synopsys --warn-no-vital-generic
GHDL_STOP = --stop-time=40ns
#GHDL_STOP = --assert-level=error
#############
#### VIS ####
#############
VIEW_CMD = /usr/bin/gtkwave
###############
#### SYNTH ####
###############
#SYNTHFILES = bin/bus_led_ise/netgen/synthesis
##################
#### Commands ####
##################
all:
make ghdl-compile
make ghdl-run
make ghdl-view
ghdl-compile:
mkdir -p sim
$(GHDL_CMD) -i $(GHDL_FLAGS) --workdir=sim --work=work $(SIMFILES) $(FILES)
$(GHDL_CMD) -m $(GHDL_FLAGS) --workdir=sim --work=work $(SIMTOP)
mv $(SIMTOP) sim/$(SIMTOP)
ghdl-run:
$(SIMDIR)/$(SIMTOP) $(GHDL_STOP) --vcdgz=$(SIMDIR)/$(SIMTOP).vcdgz
ghdl-view:
gunzip --stdout $(SIMDIR)/$(SIMTOP).vcdgz | $(VIEW_CMD) --vcd
ghdl-clean:
$(GHDL_CMD) --clean --workdir=sim