OpenCores
URL https://opencores.org/ocsvn/tinycpu/tinycpu/trunk

Subversion Repositories tinycpu

[/] [tinycpu/] [trunk/] [Makefile] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 earlz
# vhdl files
2
FILES = src/*
3
VHDLEX = .vhd
4
 
5
# testbench
6
TESTBENCHPATH = testbench/${TESTBENCH}$(VHDLEX)
7
 
8
#GHDL CONFIG
9
GHDL_CMD = ghdl
10
GHDL_FLAGS  = --ieee=synopsys --warn-no-vital-generic
11
 
12
SIMDIR = simulation
13
# Simulation break condition
14
#GHDL_SIM_OPT = --assert-level=error
15
GHDL_SIM_OPT = --stop-time=500ns
16
 
17
WAVEFORM_VIEWER = gtkwave
18
 
19
all: compile run view
20
 
21
new :
22
        echo "Setting up project ${PROJECT}"
23
        mkdir src testbench simulation
24
 
25
compile :
26
ifeq ($(strip $(TESTBENCH)),)
27
                @echo "TESTBENCH not set. Use TESTBENCH=value to set it."
28
                @exit 2
29
endif
30
 
31
        mkdir -p simulation
32
        $(GHDL_CMD) -i $(GHDL_FLAGS) --workdir=simulation --work=work $(TESTBENCHPATH) $(FILES)
33
        $(GHDL_CMD) -m  $(GHDL_FLAGS) --workdir=simulation --work=work $(TESTBENCH)
34
        @mv $(TESTBENCH) simulation/$(TESTBENCH)
35
 
36
run :
37 12 earlz
        @$(SIMDIR)/$(TESTBENCH) $(GHDL_SIM_OPT) --wave=$(SIMDIR)/$(TESTBENCH).ghw
38 2 earlz
 
39
view :
40 12 earlz
        $(WAVEFORM_VIEWER) --dump=$(SIMDIR)/$(TESTBENCH).ghw
41 2 earlz
 
42
clean :
43
        $(GHDL_CMD) --clean --workdir=simulation

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.