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 211

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 172 diegovalve
TESTBENCH = TestBench_verilog
7 162 diegovalve
TESTBENCHPATH = ../testbench/${TESTBENCH}$(VERILOGEX)
8 167 diegovalve
SOURCEPATH = ../rtl
9
GPUCONFIGURATIONSCRIPT=../scripts/configure_gpu.pl
10
INPUTCONFIGURATIONSCRIPT=../scripts/configure_params.pl
11 162 diegovalve
#iverilog CONFIG
12
VERILOG_CMD = iverilog
13 167 diegovalve
GPUCORES = 4
14 195 diegovalve
WIDTH = 200
15
HEIGHT = 200
16 177 diegovalve
GPUMEMBANKS = $(GPUCORES)
17 162 diegovalve
#VERILOG_FLAGS  =
18
 
19
# VVP (iverilog runtime engine)
20
VVP_CMD = vvp
21
#VVP_FLAGS =
22
 
23
#Simulation Vars
24
SIMDIR = .
25
DUMPTYPE = none
26 165 diegovalve
DEBUG_CORE_ID =
27 167 diegovalve
SCENEPATH =
28 162 diegovalve
#Viewer
29
WAVEFORM_VIEWER = gtkwave # Waveform viewer executable
30
 
31
 
32
all: compile run view
33
 
34
file_check:
35
ifeq ($(strip $(FILES)),)
36
                @echo "FILES not set. Use FILES=value to set it. Put mutltiple files in quotes"
37
                @exit 2
38
endif
39
 
40
testbench_check:
41
ifeq ($(strip $(TESTBENCH)),)
42
                @echo "TESTBENCH not set. Use TESTBENCH=value to set it."
43
                @exit 2
44 167 diegovalve
endif
45 170 diegovalve
 
46 162 diegovalve
 
47
 
48 172 diegovalve
check:
49 162 diegovalve
        $(VERILOG_CMD) -t null $(FILES)
50
 
51
# Setup up project directory
52
new :
53
        echo "Setting up project ${PROJECT}"
54 167 diegovalve
        mkdir rtl testbench simulation
55 162 diegovalve
 
56
 
57
compile : testbench_check
58 177 diegovalve
        perl $(GPUCONFIGURATIONSCRIPT) $(GPUCORES) $(GPUMEMBANKS)
59 167 diegovalve
 
60 162 diegovalve
        cp $(SOURCEPATH)/aDefinitions.v .
61
ifeq ($(strip $(DEBUG_CORE_ID)),)
62
        $(VERILOG_CMD) -o  $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
63
else
64
         $(VERILOG_CMD) -DDEBUG=1 -DDUMP_CODE=1 -DDEBUG_CORE=$(DEBUG_CORE_ID) -o  $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
65
endif
66
        rm -f aDefinitions.v
67
 
68
run : testbench_check
69 170 diegovalve
ifeq ($(strip $(SCENEPATH)),)
70
                @echo "SCENEPATH not set. Use SCENEPATH=value to set it"
71
                @exit 2
72
endif
73
        cp -f $(SCENEPATH)/*.mem .
74 195 diegovalve
        perl $(INPUTCONFIGURATIONSCRIPT) $(GPUCORES) $(WIDTH) $(HEIGHT)
75 162 diegovalve
        $(VVP_CMD) ./$(TESTBENCH) -$(DUMPTYPE) $(VVP_FLAGS)
76
 
77
view : testbench_check
78
        $(WAVEFORM_VIEWER)  $(SIMDIR)/$(TESTBENCH).$(DUMPTYPE)
79
 
80 172 diegovalve
clean :
81 177 diegovalve
        rm *.{mem,ppm,log}

powered by: WebSVN 2.1.0

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