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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [icarus_version/] [simulation/] [Makefile] - Blame information for rev 162

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

Line No. Rev Author Line
1 162 diegovalve
 
2
VERILOGEX = .v # Verilog file extension
3
 
4
# testbench path TESTBENCH is passed from the command line
5
SCENEPATH =
6
TESTBENCH = TestBench_THEIA
7
TESTBENCHPATH = ../testbench/${TESTBENCH}$(VERILOGEX)
8
SOURCEPATH = ../src
9
 
10
#iverilog CONFIG
11
VERILOG_CMD = iverilog
12
#VERILOG_FLAGS  =
13
 
14
# VVP (iverilog runtime engine)
15
VVP_CMD = vvp
16
#VVP_FLAGS =
17
 
18
#Simulation Vars
19
SIMDIR = .
20
DUMPTYPE = none
21
DEBUG_CORE_ID = 0
22
 
23
#Viewer
24
WAVEFORM_VIEWER = gtkwave # Waveform viewer executable
25
 
26
 
27
all: compile run view
28
 
29
file_check:
30
ifeq ($(strip $(FILES)),)
31
                @echo "FILES not set. Use FILES=value to set it. Put mutltiple files in quotes"
32
                @exit 2
33
endif
34
 
35
testbench_check:
36
ifeq ($(strip $(TESTBENCH)),)
37
                @echo "TESTBENCH not set. Use TESTBENCH=value to set it."
38
                @exit 2
39
endif
40
 
41
 
42
check: file_check
43
        $(VERILOG_CMD) -t null $(FILES)
44
 
45
# Setup up project directory
46
new :
47
        echo "Setting up project ${PROJECT}"
48
        mkdir src testbench simulation
49
 
50
 
51
compile : testbench_check
52
        cp $(SOURCEPATH)/aDefinitions.v .
53
ifeq ($(strip $(DEBUG_CORE_ID)),)
54
        $(VERILOG_CMD) -o  $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
55
else
56
         $(VERILOG_CMD) -DDEBUG=1 -DDUMP_CODE=1 -DDEBUG_CORE=$(DEBUG_CORE_ID) -o  $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
57
endif
58
        rm -f aDefinitions.v
59
 
60
run : testbench_check
61
 
62
        $(VVP_CMD) ./$(TESTBENCH) -$(DUMPTYPE) $(VVP_FLAGS)
63
 
64
view : testbench_check
65
        $(WAVEFORM_VIEWER)  $(SIMDIR)/$(TESTBENCH).$(DUMPTYPE)
66
 
67
clean : test_bench_check
68
        rm $(SIM_DIR)/$(TESTBENCH)*

powered by: WebSVN 2.1.0

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