Makefile 2.8 KB
#!smake -J 1

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

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)_ram_bist_tmem000 $(TMPDIR)/$(USER)_ram_bist_tmem000_syn simv*

RTESTS = ram_bist_tmem000 
STESTS = ram_bist_tmem000_syn
FAST  = fast000 

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): simv000

$(STESTS): simv000_syn

driver000.v: ram_bist_tmem000.tab.Z $(TAB2VMEM)
	/usr/bsd/uncompress ram_bist_tmem000.tab.Z
	$(TAB2VMEM) -o /dev/null -s 100 ram_bist_tmem000.tab > driver000.v
	/usr/bsd/compress ram_bist_tmem000.tab

ram_bist_tmem000.mem: ram_bist_tmem000.tab.Z
	/usr/bsd/uncompress ram_bist_tmem000.tab.Z
	$(TAB2VMEM) -o $*.mem -s 100 ram_bist_tmem000.tab > /dev/null
	/usr/bsd/compress ram_bist_tmem000.tab

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

simv000_syn: top_level.vsyn driver000.v ram_bist_tmem000.mem $(_FORCE)
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o $@ -Mdir="$(TMPDIR)/$(USER)_ram_bist_tmem000_syn" top_level.vsyn driver000.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "$@ +mem=ram_bist_tmem000.mem > $@.out"; $@ -vcd $(TMPDIR)/$(USER)_verilog000_syn.dump +mem=ram_bist_tmem000.mem > $@.out;) \
	else \
	(echo "$@ +mem=ram_bist_tmem000.mem > $@.out"; $@ +mem=ram_bist_tmem000.mem +vcs+dumpvarsoff > $@.out;) \
	fi 
	$(ERROR:FILE=simv000_syn.out)
	$(LOG_ERROR)

fast: $(FAST)	

fast000: ram_bist_tmem000.mem
	simv000 +mem=$? | tee $*.out