Line 3... |
Line 3... |
|
|
# testbench path TESTBENCH is passed from the command line
|
# testbench path TESTBENCH is passed from the command line
|
SCENEPATH =
|
SCENEPATH =
|
TESTBENCH = TestBench_THEIA
|
TESTBENCH = TestBench_THEIA
|
TESTBENCHPATH = ../testbench/${TESTBENCH}$(VERILOGEX)
|
TESTBENCHPATH = ../testbench/${TESTBENCH}$(VERILOGEX)
|
SOURCEPATH = ../src
|
SOURCEPATH = ../rtl
|
|
GPUCONFIGURATIONSCRIPT=../scripts/configure_gpu.pl
|
|
INPUTCONFIGURATIONSCRIPT=../scripts/configure_params.pl
|
#iverilog CONFIG
|
#iverilog CONFIG
|
VERILOG_CMD = iverilog
|
VERILOG_CMD = iverilog
|
|
GPUCORES = 4
|
#VERILOG_FLAGS =
|
#VERILOG_FLAGS =
|
|
|
# VVP (iverilog runtime engine)
|
# VVP (iverilog runtime engine)
|
VVP_CMD = vvp
|
VVP_CMD = vvp
|
#VVP_FLAGS =
|
#VVP_FLAGS =
|
|
|
#Simulation Vars
|
#Simulation Vars
|
SIMDIR = .
|
SIMDIR = .
|
DUMPTYPE = none
|
DUMPTYPE = none
|
DEBUG_CORE_ID =
|
DEBUG_CORE_ID =
|
|
SCENEPATH =
|
#Viewer
|
#Viewer
|
WAVEFORM_VIEWER = gtkwave # Waveform viewer executable
|
WAVEFORM_VIEWER = gtkwave # Waveform viewer executable
|
|
|
|
|
all: compile run view
|
all: compile run view
|
Line 35... |
Line 37... |
testbench_check:
|
testbench_check:
|
ifeq ($(strip $(TESTBENCH)),)
|
ifeq ($(strip $(TESTBENCH)),)
|
@echo "TESTBENCH not set. Use TESTBENCH=value to set it."
|
@echo "TESTBENCH not set. Use TESTBENCH=value to set it."
|
@exit 2
|
@exit 2
|
endif
|
endif
|
|
ifeq ($(strip $(SCENEPATH)),)
|
|
@echo "SCENEPATH not set. Use SCENEPATH=value to set it"
|
|
@exit 2
|
|
endif
|
|
|
|
|
check: file_check
|
check: file_check
|
$(VERILOG_CMD) -t null $(FILES)
|
$(VERILOG_CMD) -t null $(FILES)
|
|
|
# Setup up project directory
|
# Setup up project directory
|
new :
|
new :
|
echo "Setting up project ${PROJECT}"
|
echo "Setting up project ${PROJECT}"
|
mkdir src testbench simulation
|
mkdir rtl testbench simulation
|
|
|
|
|
compile : testbench_check
|
compile : testbench_check
|
|
perl $(GPUCONFIGURATIONSCRIPT) $(GPUCORES)
|
|
|
cp $(SOURCEPATH)/aDefinitions.v .
|
cp $(SOURCEPATH)/aDefinitions.v .
|
ifeq ($(strip $(DEBUG_CORE_ID)),)
|
ifeq ($(strip $(DEBUG_CORE_ID)),)
|
$(VERILOG_CMD) -o $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
|
$(VERILOG_CMD) -o $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
|
else
|
else
|
$(VERILOG_CMD) -DDEBUG=1 -DDUMP_CODE=1 -DDEBUG_CORE=$(DEBUG_CORE_ID) -o $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
|
$(VERILOG_CMD) -DDEBUG=1 -DDUMP_CODE=1 -DDEBUG_CORE=$(DEBUG_CORE_ID) -o $(SIMDIR)/$(TESTBENCH) $(TESTBENCHPATH) $(SOURCEPATH)/*
|
endif
|
endif
|
rm -f aDefinitions.v
|
rm -f aDefinitions.v
|
|
|
run : testbench_check
|
run : testbench_check
|
|
cp $(SCENEPATH)/*.mem .
|
|
perl $(INPUTCONFIGURATIONSCRIPT) $(GPUCORES)
|
$(VVP_CMD) ./$(TESTBENCH) -$(DUMPTYPE) $(VVP_FLAGS)
|
$(VVP_CMD) ./$(TESTBENCH) -$(DUMPTYPE) $(VVP_FLAGS)
|
|
|
view : testbench_check
|
view : testbench_check
|
$(WAVEFORM_VIEWER) $(SIMDIR)/$(TESTBENCH).$(DUMPTYPE)
|
$(WAVEFORM_VIEWER) $(SIMDIR)/$(TESTBENCH).$(DUMPTYPE)
|
|
|