Vproc_n1/test/makefile.vivado

104 lines
3.1 KiB
Text

###################################################################
# Makefile for Virtual Processor SystemVerilog testcode in Xsim
#
# 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_SV
SIMULATOR =
SIMINCLUDEFLAG =
SIMFLAGSSO =
# Optional Memory model definitions
MEM_C =
MEMMODELDIR = .
# Get OS type
OSTYPE:=$(shell uname)
# Common logic simulator flags
VPROC_TOP = test
# Flags for xsim
ANALYSEFLAGS = -i ../ --define VPROC_BURST_IF --define VPROC_BYTE_ENABLE --prj files.prj
ELABFLAGS = -sv_lib $(VPROC_PLI) --debug typical $(VPROC_TOP)
SIMFLAGS = $(VPROC_TOP)
#------------------------------------------------------
# BUILD RULES
#------------------------------------------------------
all: sysverilog
# Include common build rules
include makefile.common
# Analyse HDL files
.PHONY: sysverilog
sysverilog: $(VPROC_PLI)
@xvlog $(ANALYSEFLAGS)
@xelab $(ELABFLAGS)
#------------------------------------------------------
# EXECUTION RULES
#------------------------------------------------------
sim:
@xsim $(SIMFLAGS)
run: sysverilog
@xsim -R $(SIMFLAGS)
rungui: sysverilog
@xsim -g --autoloadwcfg $(SIMFLAGS)
gui: rungui
help:
@$(info make help Display this message)
@$(info make Build C/C++ and HDL code without running simulation)
@$(info make sim Build and run command line interactive (sim not started))
@$(info make run Build and run batch simulation)
@$(info make rungui/gui Build and run GUI simulation (sim not started))
@$(info make clean clean previous build artefacts)
#------------------------------------------------------
# CLEANING RULES
#------------------------------------------------------
clean:
@rm -rf $(VPROC_PLI) $(VLIB) $(VOBJDIR) xsim* vivado* *.wdb xelab.* xvlog.* .Xil