Makefile 4.21 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)_tm_mux022 $(TMPDIR)/$(USER)_tm_mux023 $(TMPDIR)/$(USER)_tm_mux022_syn $(TMPDIR)/$(USER)_tm_mux023_syn *.tab simv*

RTESTS = tm_mux022 tm_mux023
STESTS = tm_mux022_syn tm_mux023_syn
FAST  = fast022 fast023

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): simv022 simv023

$(STESTS): simv022_syn simv023_syn

tm_mux022.tab: $(TCTM)/tctm $(INDATA)/inp015.tab $(INDATA)/inp011.tab $(INDATA)/inp012.tab $@.base.Z
	(cd ../..; make test022)
	/usr/bsd/uncompress $@.base.Z
	cmp $@ $@.base
	/usr/bsd/compress $@.base

tm_mux023.tab: $(TCTM)/tctm $(INDATA)/inp015.tab $(INDATA)/inp011.tab $(INDATA)/inp013.tab $@.base.Z
	(cd ../..; make test023)
	/usr/bsd/uncompress $@.base.Z
	cmp $@ $@.base
	/usr/bsd/compress $@.base

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

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

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

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

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

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

fast: $(FAST)	

fast022: tm_mux022.mem
	simv022 +mem=$? | tee $*.out

fast023: tm_mux023.mem
	simv023 +mem=$? | tee $*.out