Makefile 10.9 KB
#!smake -J 8
#
#  This makefile has rules for making both the executables
#  which make up the simulator, and for running test cases.
#
#  This makefile should do a make in InData/ before making
#  any test in this directory.
#
# $Revision: 1.1.1.1 $
#

LCOPTS = -g
COMMONPREF=RDPSIM
PRDEPTH = ../../..
include $(PRDEPTH)/PRdefs
include $(PRDEPTH)/PRrules

#
#  Subdirectories
#
include $(ROOT)/usr/include/make/ismcommondefs

LVCSOPTS     =  -y . \
		+incdir+$(PRDEPTH)/hw/chip/rcp/inc		

OLDOPTS     =   -y $(PRDEPTH)/hw/chip/rcp/st/src                      \
		-y $(PRDEPTH)/hw/chip/rcp/rdp/src                     \
		-y $(PRDEPTH)/hw/chip/lib/verilog/sc                  \
		-y $(PRDEPTH)/hw/chip/lib/verilog/ram                 \
		-v $(PRDEPTH)/hw/chip/lib/verilog/udp/compass_udps.v  \
		+libext+.v+.vzd                                       \

RTLOPTS     =   -y $(PRDEPTH)/hw/chip/rcp/st/src                      \
		-y $(PRDEPTH)/hw/chip/lib/verilog/stdcell             \
		-y $(PRDEPTH)/hw/chip/lib/verilog/ram                 \
		+libext+.v                                            \

SYNOPTS     =   -y $(PRDEPTH)/hw/chip/rcp/st/syn                      \
		-y $(PRDEPTH)/hw/chip/lib/verilog/stdcell             \
		-y $(PRDEPTH)/hw/chip/lib/verilog/ram                 \
		+libext+.v+.vsyn                                      \

SHELL=/sbin/ksh

#
#  Tools
#
XNET   		= ../../tools/xnet

#
#  Directories
#
SIMLIB		= ../../simlib
SRC    		= ../../src
HDR    		= ../../hdr
VERILOG		= ../rdp
WIR    		= Wir
INDATA 		= InData
OUTDATA		= OutData
QSIM            = qsim

SUBDIRS		= $(INDATA) $(WIR) 

#
#  Check for objects in this directory
#
.PATH:		$(SRC)

#
#  C Sources
#
TEST_FILES 	= \
        	$(SRC)/st.c \
		expand.c \
        	driver.c \
        	st_test_0.c

#
#  Object Files
#
TEST_OBJ 	= ${TEST_FILES:.c=.o}
TEST_OBJS    	= ${TEST_OBJ:T}

#
#  Header file Directories
#
LCINCS 		= -I. \
	 	-I$(SIMLIB) \
	 	-I$(HDR)

GCINCS 		=
#
#  Linker Directories and Options
# 
LLDOPTS 	= -L. -L$(SIMLIB)
GLDOPTS 	=
LLDLIBS 	= -lsimlib -lgl -limage
LNFLAGS 	= $(CFLAGS) 

#
#  Default Targets
#
TARGETS 	= st_test
LDIRT   	= st_test st_test_0.c driver*.v *.mem *.out vcs.log *.dump st_all??? *.tab simv* rsimv* ssimv* rtlcsrc* syncsrc* ${OUTDATA}/st_all/*.tab ${OUTDATA}/st_all/*.mem ${QSIM}/*.tab ${QSIM}/*.tbl* ${QSIM}/*.wvs* ${QSIM}/*.sim* ${QSIM}/*.trc* ${QSIM}/*.simlog* ${QSIM}/*.cln ${QSIM}/*.idx ${QSIM}/*.db ${QSIM}/*.atr ${QSIM}/*.log

RTESTS = rsimv000 rsimv001 rsimv004 rsimv005 rsimv006

STESTS = ssimv000 ssimv001 ssimv004 ssimv005 ssimv006

QTESTS = qsimv000 qsimv001 qsimv004 qsimv005 qsimv006

default: $(RTESTS)

stests: $(STESTS)

qtests: $(QTESTS)

$(COMMONTARGS): $(COMMONPREF)$$@
	$(SUBDIRS_MAKERULE)

#
#  Target for creating all .tab files
#
tab_files: $(_FORCE)
	cd InData; $(MAKE) tab_files

#
#  Target for creating all .1 files, Viewlogic netlists
#

$(WIR)/st_test.1: $(_FORCE)
	cd $(WIR); $(MAKE)

#
#  Compile 'C' processes
#

st_test_0.c: $(WIR)/st_test.1 st_test.config $(XNET)
	$(XNET) -d $(WIR) st_test -c st_test.config

st_test: st_test_0.c $(SIMLIB) $(TEST_OBJS)
	$(HOST_CC) $(TEST_OBJS) $(LDFLAGS) -o $@ $(LLDLIBS)

driver000.v: $(OUTDATA)/st_all/st_all000.tab $(TAB2VMEM)
	$(TAB2VMEM) -o /dev/null -s 100 $(OUTDATA)/st_all/st_all000.tab > driver000.v

driver001.v: $(OUTDATA)/st_all/st_all001.tab $(TAB2VMEM)
	$(TAB2VMEM) -o /dev/null -s 100 $(OUTDATA)/st_all/st_all001.tab > driver001.v

driver004.v: $(OUTDATA)/st_all/st_all004.tab $(TAB2VMEM)
	$(TAB2VMEM) -o /dev/null -s 100 $(OUTDATA)/st_all/st_all004.tab > driver004.v

driver005.v: $(OUTDATA)/st_all/st_all005.tab $(TAB2VMEM)
	$(TAB2VMEM) -o /dev/null -s 100 $(OUTDATA)/st_all/st_all005.tab > driver005.v

driver006.v: $(OUTDATA)/st_all/st_all006.tab $(TAB2VMEM)
	$(TAB2VMEM) -o /dev/null -s 100 $(OUTDATA)/st_all/st_all006.tab > driver006.v

simv000: top_level.v driver000.v $(OUTDATA)/st_all/st_all000.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(OLDOPTS) -o $@ -Mdir="st_all000" top_level.v driver000.v 
	simv000 +mem=$(OUTDATA)/st_all/st_all000.mem +vcs+dumpvarsoff > simv000.out; 
	$(ERROR:FILE=simv000.out)
	$(LOG_ERROR)

rsimv000: top_level.v driver000.v $(OUTDATA)/st_all/st_all000.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o $@ -Mdir="rtlcsrc000" top_level.v driver000.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "rsimv000 -dump"; rsimv000 -vcd rverilog000.dump +mem=$(OUTDATA)/st_all/st_all000.mem > rsimv000.out;) \
	else \
	(echo "rsimv000 -nodump"; rsimv000 +mem=$(OUTDATA)/st_all/st_all000.mem +vcs+dumpvarsoff > rsimv000.out;) \
	fi 
	$(ERROR:FILE=rsimv000.out)
	$(LOG_ERROR)

ssimv000: top_level.v driver000.v $(OUTDATA)/st_all/st_all000.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ -Mdir="syncsrc000" top_level.v driver000.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "ssimv000 -dump"; ssimv000 -vcd rverilog000.dump +mem=$(OUTDATA)/st_all/st_all000.mem > ssimv000.out;) \
	else \
	(echo "ssimv000 -nodump"; ssimv000 +mem=$(OUTDATA)/st_all/st_all000.mem +vcs+dumpvarsoff > ssimv000.out;) \
	fi 
	$(ERROR:FILE=ssimv000.out)
	$(LOG_ERROR)

qsimv000: $(_FORCE)
	(cd qsim; make st_all000.trc)


simv001: top_level.v driver001.v $(OUTDATA)/st_all/st_all001.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(OLDOPTS) -o $@ -Mdir="st_all001" top_level.v driver001.v 
	simv001 +mem=$(OUTDATA)/st_all/st_all001.mem +vcs+dumpvarsoff > simv001.out; 
	$(ERROR:FILE=simv001.out)
	$(LOG_ERROR)

rsimv001: top_level.v driver001.v $(OUTDATA)/st_all/st_all001.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o $@ -Mdir="rtlcsrc001" top_level.v driver001.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "rsimv001 -dump"; rsimv001 -vcd rverilog001.dump +mem=$(OUTDATA)/st_all/st_all001.mem > rsimv001.out;) \
	else \
	(echo "rsimv001 -nodump"; rsimv001 +mem=$(OUTDATA)/st_all/st_all001.mem +vcs+dumpvarsoff > rsimv001.out;) \
	fi 
	$(ERROR:FILE=rsimv001.out)
	$(LOG_ERROR)

ssimv001: top_level.v driver001.v $(OUTDATA)/st_all/st_all001.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ -Mdir="syncsrc001" top_level.v driver001.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "ssimv001 -dump"; ssimv001 -vcd rverilog001.dump +mem=$(OUTDATA)/st_all/st_all001.mem > ssimv001.out;) \
	else \
	(echo "ssimv001 -nodump"; ssimv001 +mem=$(OUTDATA)/st_all/st_all001.mem +vcs+dumpvarsoff > ssimv001.out;) \
	fi 
	$(ERROR:FILE=ssimv001.out)
	$(LOG_ERROR)

qsimv001: $(_FORCE)
	(cd qsim; make st_all001.trc)

simv004: top_level.v driver004.v $(OUTDATA)/st_all/st_all004.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(OLDOPTS) -o $@ -Mdir="st_all004" top_level.v driver004.v 
	simv004 +mem=$(OUTDATA)/st_all/st_all004.mem +vcs+dumpvarsoff > simv004.out; 
	$(ERROR:FILE=simv004.out)
	$(LOG_ERROR)

rsimv004: top_level.v driver004.v $(OUTDATA)/st_all/st_all004.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o $@ -Mdir="rtlcsrc004" top_level.v driver004.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "rsimv004 -dump"; rsimv004 -vcd rverilog004.dump +mem=$(OUTDATA)/st_all/st_all004.mem > rsimv004.out;) \
	else \
	(echo "rsimv004 -nodump"; rsimv004 +mem=$(OUTDATA)/st_all/st_all004.mem +vcs+dumpvarsoff > rsimv004.out;) \
	fi 
	$(ERROR:FILE=rsimv004.out)
	$(LOG_ERROR)

ssimv004: top_level.v driver004.v $(OUTDATA)/st_all/st_all004.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ -Mdir="syncsrc004" top_level.v driver004.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "ssimv004 -dump"; ssimv004 -vcd rverilog004.dump +mem=$(OUTDATA)/st_all/st_all004.mem > ssimv004.out;) \
	else \
	(echo "ssimv004 -nodump"; ssimv004 +mem=$(OUTDATA)/st_all/st_all004.mem +vcs+dumpvarsoff > ssimv004.out;) \
	fi 
	$(ERROR:FILE=ssimv004.out)
	$(LOG_ERROR)

qsimv004: $(_FORCE)
	(cd qsim; make st_all004.trc)


simv005: top_level.v driver005.v $(OUTDATA)/st_all/st_all005.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(OLDOPTS) -o $@ -Mdir="st_all005" top_level.v driver005.v 
	simv005 +mem=$(OUTDATA)/st_all/st_all005.mem +vcs+dumpvarsoff > simv005.out; 
	$(ERROR:FILE=simv005.out)
	$(LOG_ERROR)

rsimv005: top_level.v driver005.v $(OUTDATA)/st_all/st_all005.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o $@ -Mdir="rtlcsrc005" top_level.v driver005.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "rsimv005 -dump"; rsimv005 -vcd rverilog005.dump +mem=$(OUTDATA)/st_all/st_all005.mem > rsimv005.out;) \
	else \
	(echo "rsimv005 -nodump"; rsimv005 +mem=$(OUTDATA)/st_all/st_all005.mem +vcs+dumpvarsoff > rsimv005.out;) \
	fi 
	$(ERROR:FILE=rsimv005.out)
	$(LOG_ERROR)

ssimv005: top_level.v driver005.v $(OUTDATA)/st_all/st_all005.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ -Mdir="syncsrc005" top_level.v driver005.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "ssimv005 -dump"; ssimv005 -vcd rverilog005.dump +mem=$(OUTDATA)/st_all/st_all005.mem > ssimv005.out;) \
	else \
	(echo "ssimv005 -nodump"; ssimv005 +mem=$(OUTDATA)/st_all/st_all005.mem +vcs+dumpvarsoff > ssimv005.out;) \
	fi 
	$(ERROR:FILE=ssimv005.out)
	$(LOG_ERROR)

qsimv005: $(_FORCE)
	(cd qsim; make st_all005.trc)


simv006: top_level.v driver006.v $(OUTDATA)/st_all/st_all006.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(OLDOPTS) -o $@ -Mdir="st_all006" top_level.v driver006.v 
	simv006 +mem=$(OUTDATA)/st_all/st_all006.mem +vcs+dumpvarsoff > simv006.out; 
	$(ERROR:FILE=simv006.out)
	$(LOG_ERROR)

rsimv006: top_level.v driver006.v $(OUTDATA)/st_all/st_all006.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o $@ -Mdir="rtlcsrc006" top_level.v driver006.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "rsimv006 -dump"; rsimv006 -vcd rverilog006.dump +mem=$(OUTDATA)/st_all/st_all006.mem > rsimv006.out;) \
	else \
	(echo "rsimv006 -nodump"; rsimv006 +mem=$(OUTDATA)/st_all/st_all006.mem +vcs+dumpvarsoff > rsimv006.out;) \
	fi 
	$(ERROR:FILE=rsimv006.out)
	$(LOG_ERROR)

ssimv006: top_level.v driver006.v $(OUTDATA)/st_all/st_all006.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ -Mdir="syncsrc006" top_level.v driver006.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "ssimv006 -dump"; ssimv006 -vcd rverilog006.dump +mem=$(OUTDATA)/st_all/st_all006.mem > ssimv006.out;) \
	else \
	(echo "ssimv006 -nodump"; ssimv006 +mem=$(OUTDATA)/st_all/st_all006.mem +vcs+dumpvarsoff > ssimv006.out;) \
	fi 
	$(ERROR:FILE=ssimv006.out)
	$(LOG_ERROR)

qsimv006: $(_FORCE)
	(cd qsim; make st_all006.trc)


#
#  Targets
#

nuke:
	- rm InData/inp000.tab InData/inp001.tab OutData/st_all/st_all* 2> /dev/null

#
#  Tab targets
#

$(INDATA)/inp000.tab $(INDATA)/inp001.tab $(INDATA)/inp004.tab $(INDATA)/inp005.tab $(INDATA)/inp006.tab : $(_FORCE)
	cd $(INDATA); make `basename $@`

#
#  Test Targets
#

test000: $(OUTDATA)/st_all/st_all000.tab 
$(OUTDATA)/st_all/st_all000.tab :  $(INDATA)/inp000.tab st_test
	st_test -i 0 -o all,comp,test=000	

test001: $(OUTDATA)/st_all/st_all001.tab 
$(OUTDATA)/st_all/st_all001.tab :  $(INDATA)/inp001.tab st_test 
	st_test -i 1 -o all,test=001	

test004: $(OUTDATA)/st_all/st_all004.tab 
$(OUTDATA)/st_all/st_all004.tab :  $(INDATA)/inp004.tab st_test
	st_test -i 4 -o all,test=004

test005: $(OUTDATA)/st_all/st_all005.tab 
$(OUTDATA)/st_all/st_all005.tab :  $(INDATA)/inp005.tab st_test
	st_test -i 5 -o all,test=005

test006: $(OUTDATA)/st_all/st_all006.tab 
$(OUTDATA)/st_all/st_all006.tab :  $(INDATA)/inp006.tab st_test
	st_test -i 6 -o all,test=006

#
#  Suffix Rules
#

.c.o:
	$(HOST_CC) $(CFLAGS) -c $*.c