-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
44 lines (32 loc) · 1019 Bytes
/
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
# project name
PROJECT=neander
# vhdl files
FILES := $(shell find . -name "*.vhdl")
SIMTOP = tb_neander
SIMFILES = ./src/neander/testbench/tb_neander.vhdl
GHDL_SIM_OPT = --assert-level=error -fsynopsys --elab-run --wave $(WAVE_FILE).ghw
SIMDIR = ./dist/sim
WAVEDIR = ./assets/waves
MEMDIR = ./assets/mem
ASSETSDIR = ./assets
WAVE_FILE=tb_neander.ghw
GTKW_FILE=neander.gtkw
GHDL_CMD = ghdl
GHDL_FLAGS = --ieee=synopsys --warn-no-vital-generic
VIEW_CMD = gtkwave
all: compile
compile:
mkdir -p $(SIMDIR)
$(GHDL_CMD) -i $(GHDL_FLAGS) --workdir=$(SIMDIR) $(FILES)
$(GHDL_CMD) -m $(GHDL_FLAGS) --workdir=$(SIMDIR) $(SIMTOP)
@mv *$(SIMTOP)* $(SIMDIR)
.SILENT:
run :
@cp $(MEMDIR)/$(MEM) ./neanderram.mem
$(GHDL_CMD) --elab-run $(GHDL_FLAGS) --workdir=$(SIMDIR) $(SIMTOP) --wave=$(WAVEDIR)/$(WAVE_FILE) --stop-time=$(STOPTIME)ns
@mv *$(SIMTOP)* $(SIMDIR)
view:
nohup $(VIEW_CMD) $(ASSETSDIR)/$(GTKW_FILE) 0<&- &>/dev/null &
clean :
rm -rf ./dist
# $(GHDL_CMD) --clean $(GHDL_FLAGS) --workdir=$(SIMDIR)