2006-08-26 11:35:28 +00:00
|
|
|
#*****************************************************************************
|
|
|
|
#
|
|
|
|
# DESCRIPTION: Verilator Example: Makefile for inside source directory
|
|
|
|
#
|
|
|
|
# This calls the object directory makefile. That allows the objects to
|
|
|
|
# be placed in the "current directory" which simplifies the Makefile.
|
|
|
|
#
|
2023-01-01 15:18:39 +00:00
|
|
|
# Copyright 2003-2023 by Wilson Snyder. This program is free software; you
|
2020-03-21 15:24:24 +00:00
|
|
|
# can redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
# Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
# Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2006-08-26 11:35:28 +00:00
|
|
|
#
|
|
|
|
#****************************************************************************/
|
|
|
|
|
2006-12-18 20:33:10 +00:00
|
|
|
default: test
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
# This must point to the root of the VERILATOR kit
|
|
|
|
VERILATOR_ROOT := $(shell pwd)/..
|
|
|
|
export VERILATOR_ROOT
|
|
|
|
|
2006-12-18 20:33:10 +00:00
|
|
|
# Pick up PERL and other variable settings
|
|
|
|
include $(VERILATOR_ROOT)/include/verilated.mk
|
2006-08-26 11:35:28 +00:00
|
|
|
|
2006-12-18 20:33:10 +00:00
|
|
|
######################################################################
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
ifneq ($(VCS_HOME),)
|
2020-01-25 01:10:44 +00:00
|
|
|
#Default to off, even with vcs; not all tests are ensured to be working
|
2009-09-16 13:28:09 +00:00
|
|
|
#PRODUCTS += --vcs
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(NC_ROOT),)
|
2020-01-25 01:10:44 +00:00
|
|
|
#Default to off, even with vcs; not all tests are ensured to be working
|
2009-09-16 13:28:09 +00:00
|
|
|
#PRODUCTS += --nc
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
2011-10-07 10:48:40 +00:00
|
|
|
# Run tests in parallel. Requires Parallel::Forker to be installed.
|
|
|
|
ifeq ($(CFG_WITH_LONGTESTS),yes)
|
2019-10-16 09:32:47 +00:00
|
|
|
DRIVER_FLAGS ?= -j 0 --quiet --rerun
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-28 22:33:01 +00:00
|
|
|
.SUFFIXES:
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
######################################################################
|
|
|
|
|
2019-06-29 11:22:04 +00:00
|
|
|
SCENARIOS ?= --vlt --vltmt --dist
|
2020-03-08 02:38:44 +00:00
|
|
|
DRIVER_HASHSET ?=
|
2019-06-27 15:26:25 +00:00
|
|
|
|
2008-03-19 00:44:54 +00:00
|
|
|
.PHONY: test
|
2006-08-26 11:35:28 +00:00
|
|
|
test:
|
2020-03-08 02:38:44 +00:00
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) $(SCENARIOS) $(DRIVER_HASHSET)
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
vcs:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --vcs --stop
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
nc:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --nc --stop
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
2010-01-06 13:54:56 +00:00
|
|
|
vlt:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --vlt --stop
|
2006-08-26 11:35:28 +00:00
|
|
|
|
2018-07-23 00:54:28 +00:00
|
|
|
vltmt:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --vltmt --stop
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
######################################################################
|
|
|
|
|
|
|
|
random:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --optimize : --stop
|
|
|
|
|
|
|
|
random_forever:
|
|
|
|
while ( VERILATOR_NO_DEBUG=1 CPPFLAGS_ADD=-Wno-error $(MAKE) random ) ; do \
|
|
|
|
echo ; \
|
|
|
|
done
|
|
|
|
|
2017-10-26 23:14:05 +00:00
|
|
|
#######################################################################
|
|
|
|
# Informational - used by some tests
|
|
|
|
|
|
|
|
print-cxx-version:
|
|
|
|
$(CXX) --version
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
######################################################################
|
|
|
|
maintainer-copy::
|
|
|
|
clean mostlyclean distclean maintainer-clean::
|
2018-05-08 00:42:28 +00:00
|
|
|
-rm -rf obj_* simv* simx* csrc cov_work INCA_libs *.log *.key logs vc_hdrs.h
|
2020-05-16 17:28:03 +00:00
|
|
|
-rm -rf t/obj_*
|