Files
verilator/test_sc/Makefile
T

69 lines
1.8 KiB
Makefile
Raw Normal View History

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.
#
2015-01-07 18:25:53 -05:00
# Copyright 2003-2015 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
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
2006-08-26 11:35:28 +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
# 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-19 20:30:41 -05:00
SYSTEMC_TESTING ?= $(SYSTEMC)$(SYSTEMC_INCLUDE)
2006-08-26 11:35:28 +00:00
######################################################################
2012-01-19 20:30:41 -05:00
ifneq ($(SYSTEMC_TESTING),)
2014-11-22 09:04:14 -05:00
test_default: precopy prep compile run
test_debug: precopy prep_dbg compile run
2010-02-08 20:51:43 -05:00
else
test_default: nosc
test_debug: nosc
endif
2006-08-26 11:35:28 +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
VERILATOR_FLAGS += --trace
2006-08-26 11:35:28 +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
compile:
cd obj_dir ; $(MAKE) -j 3 -f ../Makefile_obj
2008-06-09 21:25:10 -04:00
run:
2006-08-26 11:35:28 +00:00
obj_dir/simx
######################################################################
obj_dir:
mkdir $@
2010-02-08 20:51:43 -05:00
nosc:
@echo
2012-01-19 20:30:41 -05:00
@echo %Skip: SYSTEMC_INCLUDE not in environment
2010-02-08 20:51:43 -05: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