111 lines
3.2 KiB
Text
111 lines
3.2 KiB
Text
###################################################################
|
|
# Makefile for Virtual Processor VHDL testcode in NVC
|
|
#
|
|
# Copyright (c) 2005-2024 Simon Southwell.
|
|
#
|
|
# This file is part of VProc.
|
|
#
|
|
# VProc is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# VProc is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with VProc. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
###################################################################
|
|
|
|
#------------------------------------------------------
|
|
# User overridable definitions
|
|
|
|
MAX_NUM_VPROC = 64
|
|
USRFLAGS =
|
|
SRCDIR = ../code
|
|
USRCDIR = usercode
|
|
TESTDIR = .
|
|
VOBJDIR = $(TESTDIR)/obj
|
|
|
|
# User test source code file list
|
|
USER_C = VUserMain0.c VUserMain1.cpp
|
|
|
|
#------------------------------------------------------
|
|
# Settings specific to target simulator
|
|
|
|
# Simulator/Language specific C/C++ compile and link flags
|
|
ARCHFLAG = -m64
|
|
OPTFLAG = -g
|
|
HDLLANGUAGE = -DVPROC_VHDL
|
|
SIMULATOR = -DNVC
|
|
SIMINCLUDEFLAG =
|
|
SIMFLAGSSO =
|
|
|
|
# Optional Memory model definitions
|
|
MEM_C =
|
|
MEMMODELDIR = .
|
|
|
|
# Common logic simulator flags
|
|
VPROC_TOP = test
|
|
|
|
WAVEFILE = waves.fst
|
|
WAVESAVEFILE = $(WAVEFILE:%.fst=%.gtkw)
|
|
|
|
# Runtime flags for nvc
|
|
SIMFLAGS = --ieee-warnings=off \
|
|
--format=fst --wave=$(WAVEFILE) \
|
|
--load=$(VPROC_PLI) \
|
|
$(VPROC_TOP)
|
|
|
|
# Get OS type
|
|
OSTYPE := $(shell uname)
|
|
|
|
#------------------------------------------------------
|
|
# BUILD RULES
|
|
#------------------------------------------------------
|
|
|
|
all: vhdl
|
|
|
|
# Include common build rules
|
|
include makefile.common
|
|
|
|
# Analyse VHDL files
|
|
.PHONY: vhdl
|
|
vhdl: $(VPROC_PLI)
|
|
@nvc --std=08 -a -f files_nvc.tcl -e $(VPROC_TOP)
|
|
|
|
#------------------------------------------------------
|
|
# EXECUTION RULES
|
|
#------------------------------------------------------
|
|
|
|
run: vhdl
|
|
@nvc -r $(SIMFLAGS)
|
|
|
|
rungui: vhdl
|
|
@nvc -r $(SIMFLAGS)
|
|
@if [ -e $(WAVESAVEFILE) ]; then \
|
|
gtkwave -A $(WAVEFILE); \
|
|
else \
|
|
gtkwave $(WAVEFILE); \
|
|
fi
|
|
|
|
gui: rungui
|
|
|
|
help:
|
|
@$(info make help Display this message)
|
|
@$(info make Build C/C++ and HDL code without running simulation)
|
|
@$(info make run Build and run batch simulation)
|
|
@$(info make rungui/gui Build and run GUI simulation)
|
|
@$(info make clean clean previous build artefacts)
|
|
|
|
#------------------------------------------------------
|
|
# CLEANING RULES
|
|
#------------------------------------------------------
|
|
|
|
clean:
|
|
@rm -rf $(VPROC_PLI) $(VLIB) $(VOBJDIR) waves.fst work
|
|
|
|
|