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.
|
|
|
|
#
|
2010-01-06 02:15:06 +00:00
|
|
|
# Copyright 2003-2010 by Wilson Snyder. This program is free software; you can
|
2006-08-26 11:35:28 +00:00
|
|
|
# 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.
|
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),)
|
2009-09-16 13:28:09 +00:00
|
|
|
#Default to off, even with vcs; not all tests are insured to be working
|
|
|
|
#PRODUCTS += --vcs
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(NC_ROOT),)
|
2009-09-16 13:28:09 +00:00
|
|
|
#Default to off, even with vcs; not all tests are insured to be working
|
|
|
|
#PRODUCTS += --nc
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
2009-11-25 02:08:42 +00:00
|
|
|
PRODUCTS += --vl
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
ifeq ($(VERILATOR_AUTHOR_SITE),1)
|
2008-09-23 14:02:31 +00:00
|
|
|
DRIVER_FLAGS += -j 0
|
2006-08-26 11:35:28 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
2008-03-19 00:44:54 +00:00
|
|
|
.PHONY: test
|
2006-08-26 11:35:28 +00:00
|
|
|
test:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) $(PRODUCTS)
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
vcs:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --vcs --stop
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
nc:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --nc --stop
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
2009-11-25 02:08:42 +00:00
|
|
|
vl:
|
|
|
|
$(PERL) driver.pl $(DRIVER_FLAGS) --vl --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
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
maintainer-copy::
|
|
|
|
clean mostlyclean distclean maintainer-clean::
|
2009-11-25 02:08:42 +00:00
|
|
|
-rm -rf obj_dir simv* simx* csrc cov_work INCA_libs *.log *.key logs vc_hdrs.h
|