Makefile 2.73 KB
#!smake -J 5

PRDEPTH = ../../../../..
include $(PRDEPTH)/PRdefs

#
# Directories
#
TCTM    = ../..
INDATA  = ../../InData

RTLOPTS = -y ../../fixture/src                                 \
          -y $(PRDEPTH)/hw/chip/rcp/tc/src                     \
          -y $(PRDEPTH)/hw/chip/rcp/tm/src                     \
          -y $(PRDEPTH)/hw/chip/lib/verilog/stdcell            \
          -y $(PRDEPTH)/hw/chip/lib/verilog/ram                \
           +libext+.v+.vzd                                     \
           +incdir+$(PRDEPTH)/hw/chip/rcp/inc

SYNOPTS = -y ../../fixture/src                                 \
          -y $(PRDEPTH)/hw/chip/rcp/tc/syn                     \
          -y $(PRDEPTH)/hw/chip/rcp/tm/syn                     \
          -y $(PRDEPTH)/hw/chip/lib/verilog/stdcell            \
          -y $(PRDEPTH)/hw/chip/lib/verilog/ram                \
           +libext+.v+.vzd+.vsyn


LDIRT = driver*.v *.mem *.out vcs.log *.dump $(TMPDIR)/$(USER)_tc_lod014 $(TMPDIR)/$(USER)_tc_lod014_syn *.tab simv*

RTESTS = tc_lod014 
STESTS = tc_lod014_syn
FAST  = fast014 

ERROR = \
	@if grep "ERROR IN SIMULATION" FILE ;		\
	then						\
		echo "";				\
	else						\
		echo "NO ERRORS IN SIMULATION";		\
	fi

default: $(RTESTS)

stests: $(STESTS)

include $(PRDEPTH)/PRrules

.mem.out:

$(RTESTS): simv014

$(STESTS): simv014_syn

tc_lod014.tab: $(TCTM)/tctm $(INDATA)/inp015.tab $(INDATA)/inp016.tab $(INDATA)/inp004.tab $@.base.Z
	(cd ../..; make test014)
	/usr/bsd/uncompress $@.base.Z
	cmp $@ $@.base
	/usr/bsd/compress $@.base

driver014.v: tc_lod014.tab $(TAB2VMEM)
	$(TAB2VMEM) -o /dev/null -s 100 tc_lod014.tab > driver014.v

simv014: top_level.v driver014.v tc_lod014.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o simv014 -Mdir="$(TMPDIR)/$(USER)_tc_lod014" top_level.v driver014.v 
	@ if [ "$(DUMP)" ]; \
	then \
	(echo "simv014 +mem=tc_lod014.mem > simv014.out"; simv014 -vcd verilog014.dump +mem=tc_lod014.mem > simv014.out;) \
	else \
	(echo "simv014 +mem=tc_lod014.mem > simv014.out"; simv014 +mem=tc_lod014.mem +vcs+dumpvarsoff > simv014.out;) \
	fi 
	$(ERROR:FILE=simv014.out)
	$(LOG_ERROR)

simv014_syn: top_level.vsyn driver014.v tc_lod014.mem $(_FORCE)
	VCS_RUNTIME=$(VCSDIR)/lib/libvcs.so \
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ \
	-Mdir="$(TMPDIR)/$(USER)_tc_lod014_syn" \
	top_level.vsyn driver014.v 
	@ if [ "$(DUMP)" ]; \
        then \
	(LD_LIBRARY_PATH=$(VCSDIR)/lib echo "$@ +mem=tc_lod014.mem > $@.out"; $@ -vcd verilog014_syn.dump +mem=tc_lod014.mem > $@.out;) \
        else \
        (LD_LIBRARY_PATH=$(VCSDIR)/lib echo "$@ +mem=tc_lod014.mem > $@.out"; $@ +mem=tc_lod014.mem +vcs+dumpvarsoff > $@.out;) \
        fi 
	$(ERROR:FILE=simv014_syn.out)
	$(LOG_ERROR)


fast: $(FAST)	

fast014: tc_lod014.mem
	simv014 +mem=$? | tee $*.out