2008-06-10 01:25:10 +00:00
|
|
|
# -*- Makefile -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
#*****************************************************************************
|
|
|
|
#
|
|
|
|
# DESCRIPTION: Verilator Example: Makefile for inside object directory
|
|
|
|
#
|
2006-12-18 20:05:02 +00:00
|
|
|
# This is executed in the object directory, and called by ../Makefile
|
2006-08-26 11:35:28 +00:00
|
|
|
#
|
|
|
|
# Copyright 2003 by Wilson Snyder. This program is free software; you 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.
|
2006-08-26 11:35:28 +00:00
|
|
|
#
|
|
|
|
#*****************************************************************************
|
|
|
|
|
|
|
|
default: simx
|
|
|
|
include Vvgen.mk
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Use sp_log.cpp, so we can get output in sim.log
|
|
|
|
|
|
|
|
CPPFLAGS += -DUTIL_PRINTF=sp_log_printf
|
|
|
|
|
|
|
|
# Needed by tracing routines
|
|
|
|
CPPFLAGS += -DWAVES=1
|
|
|
|
CPPFLAGS += -DVL_DEBUG=1
|
|
|
|
CPPFLAGS += $(CPPFLAGS_ADD)
|
|
|
|
|
2009-10-27 00:12:09 +00:00
|
|
|
# Random code often does / 0. Unfortunately VL_DIV_I(0,0) will warn
|
|
|
|
# without this flag, even though there's a conditional to prevent the divide.
|
|
|
|
CPPFLAGS += -Wno-div-by-zero
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
#######################################################################
|
|
|
|
# Linking final exe -- presumes have a sim_main.cpp
|
|
|
|
|
|
|
|
SP_SRCS = verilated.o
|
|
|
|
# If you are using the older version of SystemPerl, you may want instead:
|
|
|
|
#SP_SRCS = sp_log.o SpTraceVcd.o
|
|
|
|
|
|
|
|
simx: sim_main.o $(SP_SRCS) $(VM_PREFIX)__ALL.a
|
2007-04-19 18:39:47 +00:00
|
|
|
$(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
sim_main.o: sim_main.cpp $(VM_PREFIX).h
|