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.
|
|
|
|
#
|
2014-01-07 00:28:57 +00:00
|
|
|
# Copyright 2003-2014 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_default
|
|
|
|
|
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-09-25 15:58:17 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
DEBUG_ON = --debug
|
2012-01-20 01:30:41 +00:00
|
|
|
SYSTEMC_TESTING ?= $(SYSTEMC)$(SYSTEMC_INCLUDE)
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
######################################################################
|
2012-01-20 01:30:41 +00:00
|
|
|
ifneq ($(SYSTEMC_TESTING),)
|
2006-12-18 20:33:10 +00:00
|
|
|
test_default: precopy prep preproc compile run
|
|
|
|
test_debug: precopy prep_dbg preproc compile run
|
2010-02-09 01:51:43 +00:00
|
|
|
else
|
|
|
|
test_default: nosc
|
|
|
|
test_debug: nosc
|
|
|
|
endif
|
2006-08-26 11:35:28 +00:00
|
|
|
|
2006-12-18 20:05:02 +00:00
|
|
|
V_FLAGS = -f $(VERILATOR_ROOT)/test_v/input.vc
|
2006-08-26 11:35:28 +00:00
|
|
|
VERILATOR_FLAGS = --sc $(V_FLAGS) top.v
|
2010-01-24 23:37:01 +00:00
|
|
|
VERILATOR_FLAGS += --trace
|
2006-08-26 11:35:28 +00:00
|
|
|
|
2010-02-08 13:10:07 +00:00
|
|
|
precopy:
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
prep:
|
2006-09-25 15:58:17 +00:00
|
|
|
$(PERL) $(VERILATOR_ROOT)/bin/verilator $(VERILATOR_FLAGS)
|
2006-08-26 11:35:28 +00:00
|
|
|
prep_dbg:
|
2006-09-25 15:58:17 +00:00
|
|
|
$(PERL) $(VERILATOR_ROOT)/bin/verilator $(DEBUG_ON) $(VERILATOR_FLAGS)
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
preproc:
|
|
|
|
cd obj_dir ; $(MAKE) -j 1 -f ../Makefile_obj preproc
|
|
|
|
|
|
|
|
compile:
|
|
|
|
cd obj_dir ; $(MAKE) -j 3 -f ../Makefile_obj
|
|
|
|
|
2008-06-10 01:25:10 +00:00
|
|
|
run:
|
2006-08-26 11:35:28 +00:00
|
|
|
obj_dir/simx
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
obj_dir:
|
|
|
|
mkdir $@
|
|
|
|
|
2010-02-09 01:51:43 +00:00
|
|
|
nosc:
|
|
|
|
@echo
|
2012-01-20 01:30:41 +00:00
|
|
|
@echo %Skip: SYSTEMC_INCLUDE not in environment
|
2010-02-09 01:51:43 +00:00
|
|
|
@echo
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
######################################################################
|
|
|
|
|
|
|
|
maintainer-copy::
|
|
|
|
clean mostlyclean distclean maintainer-clean::
|
|
|
|
-rm -rf obj_dir *.log *.dmp *.vpd *.vcd core
|
|
|
|
|