Makefile 3.92 KB
#!smake -J 3
#
#

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

LCOPTS = -g

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

OLDOPTS	     =	-y $(PRDEPTH)/$(HW)/chip/rcp/vi/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                                         \
		-P $(ROOT)/PR/rdpsim/test/vi/OutData/vi_gamma/Pli/pli.tab \
		$(ROOT)/PR/rdpsim/test/vi/OutData/vi_gamma/Pli/libpli.a   \

RTLOPTS	     =	-y $(PRDEPTH)/$(HW)/chip/rcp/vi/src                        \
		-y $(PRDEPTH)/$(HW)/chip/rcp/rdp/src                       \
		-y $(PRDEPTH)/$(HW)/chip/lib/verilog/stdcell               \
		-y $(PRDEPTH)/$(HW)/chip/lib/verilog/ram                   \
		+libext+.v                                              \
		-P $(ROOT)/PR/rdpsim/test/vi/OutData/vi_gamma/Pli/pli.tab \
		$(ROOT)/PR/rdpsim/test/vi/OutData/vi_gamma/Pli/libpli.a   \

SYNOPTS	     =	-y $(PRDEPTH)/$(HW)/chip/rcp/vi/syn                        \
		-y $(PRDEPTH)/$(HW)/chip/rcp/rdp/syn                       \
		-y $(PRDEPTH)/$(HW)/chip/lib/verilog/stdcell               \
		-y $(PRDEPTH)/$(HW)/chip/lib/verilog/ram                   \
		+libext+.v+.vsyn                                        \
		-P $(ROOT)/PR/rdpsim/test/vi/OutData/vi_gamma/Pli/pli.tab \
		$(ROOT)/PR/rdpsim/test/vi/OutData/vi_gamma/Pli/libpli.a   \

LDIRT = driver*.v *.mem *.out vcs.log *.dump vi_gamma0?? *.tab simv* inp??? Pli/*.o Pli/*.a checkgamma rsimv* ssimv* rtlcsrc* syncsrc* 

SUBDIRS	= Pli

HDR	= $(ROOT)/PR/include

LCINCS	= -I. \
	-I$(HDR) \
	-I$(ROOT) 

include $(PRDEPTH)/PRrules

.mem.out: 

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

RTESTS = rsimv000
STESTS = ssimv000
OTESTS = simv000

default rtests: checkgamma $(RTESTS)

stests: $(STESTS)

otests: $(OTESTS)

$(PLI)/libpli.a: $(_FORCE)
	(cd Pli; make ; cd ..)

checkgamma: checkgamma.c vi_gamma.c
	$(CC) $(LCINCS) $(LCOPTS) -o $@ checkgamma.c -lm

inp000: inp000.c
	$(CC) $(LCINCS) -o $@ $? 

vi_gamma000.tab: inp000
	inp000 > vi_gamma000.tab

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

simv000: top_level.v driver000.v display.v vi_gamma000.mem $(PLI)/libpli.a checkgamma
	$(VCS) $(VCSOPTS) $(OLDOPTS) -o simv000 -Mdir="vi_gamma000" top_level.v driver000.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "simv -dump" ; simv000 -vcd verilog000.dump +out=test000.out +dump=yes +mem=vi_gamma000.mem > simv000.out) \
	else (echo "simv -nodump" ; simv000 +mem=vi_gamma000.mem +out=test000.out +vcs+dumpvarsoff > simv000.out) \
	fi 
	checkgamma test000.out | tee checkgamma000.out
	$(ERROR:FILE=checkgamma000.out)

rsimv000: top_level.v driver000.v display.v vi_gamma000.mem $(PLI)/libpli.a checkgamma
	$(VCS) $(VCSOPTS) $(RTLOPTS) -o rsimv000 -Mdir="rtlcsrc000" top_level.v driver000.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "rsimv -dump" ; rsimv000 -vcd rverilog000.dump +out=rtest000.out +dump=yes +mem=vi_gamma000.mem > rsimv000.out) \
	else (echo "rsimv -nodump" ; rsimv000 +mem=vi_gamma000.mem +out=rtest000.out +vcs+dumpvarsoff > rsimv000.out) \
	fi 
	checkgamma rtest000.out | tee rcheckgamma000.out
	$(ERROR:FILE=rcheckgamma000.out)

ssimv000: top_level.v driver000.v display.v vi_gamma000.mem $(PLI)/libpli.a checkgamma
	$(VCS) $(VCSOPTS) $(SYNOPTS) -o ssimv000 -Mdir="syncsrc000" top_level.v driver000.v 
	@ if [ "$(DUMP)" ]; \
	then (echo "ssimv -dump" ; ssimv000 -vcd sverilog000.dump +out=stest000.out +dump=yes +mem=vi_gamma000.mem > ssimv000.out) \
	else (echo "ssimv -nodump" ; ssimv000 +mem=vi_gamma000.mem +out=stest000.out +vcs+dumpvarsoff > ssimv000.out) \
	fi 
	checkgamma stest000.out | tee scheckgamma000.out
	$(ERROR:FILE=scheckgamma000.out)