Makefile 10.8 KB
#
# This makefile has rules for making both the executables
# which make up the simulator, and for running test cases.
#

COMMONPREF = rcp
BBDEPTH = ../../..

include $(BBDEPTH)/BBdefs

# Directory to store verilog output files (simv and c files).
# All *.o and *.c files will be placed in $(SIMVDIR)/$(SIMCDIR).
# User can overide this variable on make command line, ie.
# 'make SIMVDIR=/tmp' or environment variable.

SIMCDIR = c
SIMVDIR ?= .

# paths to vendor library;

VLIB = lib-rcp/verilog

# how to run the simulator binary executable;

SIMV = LD_LIBRARY_PATH=$(VCS_HOME)/lib $(SIMVDIR)/simv -q

# C include directories;

LCINCS = 
GCINCS =

# C compiler options

OPTIMIZER = -g
LCOPTS = -fullwarn

# all vcs dirt;

VCSDIRT = $(VCS_NAME).log \
	$(SIMVDIR)/$(SIMCDIR) $(SIMVDIR)/simv* \
	tokens.v

# path to rcp pli library;

LIBRCPPLI = $(BBDEPTH)/lib/librcppli

# override global vcs flags:

GVCSOPTS = -l $(VCS_NAME).log \
	-M -Mupdate \
	-V

# vcs options for behavioral simulator;

LVCSOPTS = -y . \
	-y $(BBDEPTH)/hw/chip/rcp/src \
	-y $(BBDEPTH)/hw/chip/rcp/rdp/src \
	-y $(BBDEPTH)/hw/chip/rcp/ri/src \
	-y $(BBDEPTH)/hw/chip/rcp/rsp/src \
	-y $(BBDEPTH)/hw/chip/rcp/ar/src \
	-y $(BBDEPTH)/hw/chip/rcp/mi/src \
	-y $(BBDEPTH)/hw/chip/rcp/vi/src \
	-y $(BBDEPTH)/hw/chip/rcp/ai/src \
	-y $(BBDEPTH)/hw/chip/rcp/pi/src \
	-y $(BBDEPTH)/hw/chip/rcp/si/src \
	-y $(BBDEPTH)/hw/chip/rcp/cs/src \
	-y $(BBDEPTH)/hw/chip/rcp/ew/src \
	-y $(BBDEPTH)/hw/chip/rcp/ep/src \
	-y $(BBDEPTH)/hw/chip/rcp/cv/src \
	-y $(BBDEPTH)/hw/chip/rcp/st/src \
	-y $(BBDEPTH)/hw/chip/rcp/tc/src \
	-y $(BBDEPTH)/hw/chip/rcp/tm/src \
	-y $(BBDEPTH)/hw/chip/rcp/tf/src \
	-y $(BBDEPTH)/hw/chip/rcp/cc/src \
	-y $(BBDEPTH)/hw/chip/rcp/bl/src \
	-y $(BBDEPTH)/hw/chip/rcp/at/src \
	-y $(BBDEPTH)/hw/chip/rcp/bl/src \
	-y $(BBDEPTH)/hw/chip/rcp/ms/src \
	-y $(BBDEPTH)/hw/chip/rcp/rsp/src \
	-y $(BBDEPTH)/hw/chip/rcp/su/src \
	-y $(BBDEPTH)/hw/chip/rcp/vu/src \
	-y $(BBDEPTH)/hw/chip/rcp/ls/src \
	-y $(BBDEPTH)/hw/chip/rcp/is/src \
	-y $(BBDEPTH)/hw/chip/rcp/io/src \
	-y $(BBDEPTH)/hw/chip/rcp/dm/src \
	-y $(BBDEPTH)/hw/chip/rcp/sb/src \
	-y $(BBDEPTH)/hw/chip/rcp/su/fixes \
	-y $(BBDEPTH)/hw/chip/rcp/div/src \
	-y $(BBDEPTH)/hw/chip/rcp/tst/src \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/T2pads \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/pads \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/dp \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/stdcell \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/ram \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/user \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/rac/gate \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/rdram/behavioral \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/rdram_8mb/behavioral \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/rom/behavioral \
	-y $(BBDEPTH)/hw/chip/$(VLIB)/pif \
	-v $(BBDEPTH)/hw/chip/$(VLIB)/rac/gate/rac.v \
	+libext+.v+.vzd+.vmd \
	+incdir+$(BBDEPTH)/hw/chip/rcp/inc \
	+incdir+$(BBDEPTH)/hw/chip/rcp/su/src \
	+incdir+$(BBDEPTH)/hw/chip/rcp/vu/src \
	+incdir+$(BBDEPTH)/hw/chip/rcp/ms/src \
	-Mdir=$(SIMVDIR)/$(SIMCDIR)

# vcs options for IPC version;
# use pli interface;

GIPCOPTS = -q +acc +librescan \
	+define+MMAP_RDRAM \
	+define+IPC_PRESENT \
	-P $(LIBRCPPLI)/rcppli.tab $(LIBRCPPLI)/librcppli.a

IPCOPTS = $(GIPCOPTS) \
	+define+RSP_MON \
	+define+RSP_PRESENT \
	+define+MSPAN_MON

# default target is to build the behavioral simulator;

TARGETS = simv 

default install: $(TARGETS)

# clean all vcs files;

clean-vcs: $(_FORCE)
	$(RM) -rf $(VCSDIRT)

# thorough clean;

clean: clean-vcs

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

# include BB common rules;

include $(BBDEPTH)/BBrules

# compile the behavioral simulator;

simv: reality.v $(_FORCE)
	$(VCS) $(VCSOPTS) \
		-P $(LIBRCPPLI)/rcppli.tab $(LIBRCPPLI)/librcppli.a \
		-o $(SIMVDIR)/$@  \
		reality.v

# compile the rdp simulator;
# use dummy for rsp logic;

simv_rdp: reality.v dummy_rsp.v $(_FORCE)
	(VCS) $(VCSOPTS) \
		-o $(SIMVDIR)/$@ \
		reality.v dummy_rsp.v 

# compile the rsp simulator;
# use dummy for rdp logic;

simv_rsp: reality.v dummy_rdp.v $(_FORCE)
	$(VCS) $(VCSOPTS) \
		-o $(SIMVDIR)/$@ \
		reality.v dummy_rdp.v 

# compile the io simulator;
# use dummy for rsp and rdp logic;

simv_io: reality.v dummy_rsp.v dummy_rdp.v $(_FORCE)
	$(VCS) $(VCSOPTS) \
		-o $(SIMVDIR)/$@ \
		reality.v dummy_rsp.v dummy_rdp.v 

# compile IPC simulator;

ipc: reality.v $(_FORCE)
	$(VCS) $(VCSOPTS) $(IPCOPTS) \
		-o $(SIMVDIR)/simv2.ipc \
		reality.v

# compile IPC simulator with dummy rsp and rdp;

gipc: reality.v $(_FORCE)
	$(VCS) $(VCSOPTS) $(GIPCOPTS) \
		-o $(SIMVDIR)/simv.gipc \
		reality.v dummy_rsp.v dummy_rdp.v

iorand.rdram:	iorand.data

#
# Tests
#
pif_test: $(_FORCE)
	$(SIMV) +test_4200_pif_wr4B +load_pif
	$(SIMV) +test_4200_pif_rd4Bcpu +load_pif
	$(SIMV) +test_4200_pif_wr_rd +load_pif
	$(SIMV) +test_4200_pif_rd_lap1 +load_pif
	$(SIMV) +test_4200_pif_rd_lap2 +load_pif
	$(SIMV) +test_4200_pif_rd_lap3 +load_pif
	$(SIMV) +test_4200_pif_io_read_conflict +load_pif

nmi_test:  $(_FORCE)
	$(SIMV) +test_4200_nmi_test +enable_nmi

audio_test: $(_FORCE)
	$(SIMV) +test_4200_ai_test

video_test: $(_FORCE)
	$(SIMV) +test_4200_vi_test

bigtest: $(_FORCE)
	$(ROOT)/PR/iosim/src/iorand -d 0x241 -l io.log -i 10000 -r 10000 -t 4,7,12,8,15 -s "$(SIMVDIR)/simv2.ipc -l verilog.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=rdram_0 +vitab=vi.tab +cbus_mon +rsp_mon +show_imem_on_r1 +vi_dump -vcd /var/tmp/kluster/bigtest.dump"
	
bigtest.rgb: vi.tab
	- rm Nlan1.rgb Nlan2.rgb Nlpn1.rgb Nhan1.rgb Nhpf2.rgb
	$(ROOT)/usr/sbin/vparse -i vi.tab -o big5.tab -f 2
	$(ROOT)/usr/sbin/monitor -i big5.tab000 -o Nlan1.rgb -h 0x00200044 -v 0x0050025
	$(ROOT)/usr/sbin/monitor -i big5.tab001 -o Nlan2.rgb -h 0x00200044 -v 0x0050025
	$(ROOT)/usr/sbin/monitor -i big5.tab002 -o Nlpn1.rgb -h 0x00200040 -v 0x0050025
	$(ROOT)/usr/sbin/monitor -i big5.tab003 -o Nhan1.rgb -h 0x00200044 -v 0x0050025
	$(ROOT)/usr/sbin/monitor -i big5.tab004 -o Nhpf2.rgb -h 0x00200044 -v 0x0050025
	$(ROOT)/usr/sbin/idiff Nlan1.rgb $(ROOT)/PR/rdpsim/backend/test/Iosim/lan1.rgb
	$(ROOT)/usr/sbin/idiff Nlan2.rgb $(ROOT)/PR/rdpsim/backend/test/Iosim/lan2.rgb
	$(ROOT)/usr/sbin/idiff Nlpn1.rgb $(ROOT)/PR/rdpsim/backend/test/Iosim/lpn1.rgb
	$(ROOT)/usr/sbin/idiff Nhan1.rgb $(ROOT)/PR/rdpsim/backend/test/Iosim/han1.rgb
	$(ROOT)/usr/sbin/idiff Nhpf2.rgb $(ROOT)/PR/rdpsim/backend/test/Iosim/hpf2.rgb

mlf2test: $(_FORCE)
	$(ROOT)/PR/iosim/src/iorand -d 0x241 -l io-mlf2.log -i 10000 -r 10000 -t 4,7,12,8,17 -s "$(SIMVDIR)/simv2.ipc -l verilog-mlf2.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=rdram_0 +vitab=vi-mlf2.tab +cbus_mon +rsp_mon +show_imem_on_r1 +vi_dump -vcd /var/tmp/kluster/mlf2test.dump"

mlf2test.rgb: vi-mlf2.tab
	- rm Nmlf2.rgb* mlf2.tab*
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-mlf2.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmlf2.rgb -h 0x00200044 -v 0x0050025

mlf2temp: $(_FORCE)
	$(ROOT)/PR/iosim/src/iorand -d 0x241 -l io-mlf2.log -i 10000 -r 10000 -t 4,7,8,18,17 -s "$(SIMVDIR)/simv2.ipc -l verilog-mlf2.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=rdram_0 +vitab=vi-mlf2.tab +cbus_mon -vcd /var/tmp/kluster/mlf2temp.dump"


simenv : $(_FORCE)
	echo " setenv LD_LIBRARY_PATH $(VCS_HOME)/lib "  > Setenv
	echo "enter command%  source Setenv"

# New 5 tests

mln1test: $(_FORCE)
	/usr/bsd/uncompress -c virdram.rdram.Z > virdram.rdram
	$(ROOT)/PR/iosim/src/iorand -o `date +%d%H%M%S` -C -R -d 0x241 -l io-mln1.log -i 10000 -r 10000 -t 4,7,15,8,16 -s "$(SIMVDIR)/simv2.ipc -l verilog-mln1.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=virdram +vitab=vi-mln1.tab +cbus_mon +rsp_mon +show_imem_on_r1 -vcd /var/tmp/kluster/mln1test.dump"

mln1test.rgb: vi-mln1.tab $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmln1.rgb
	- rm vi-mln1.rgb* vi-mln1.tab???
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-mln1.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmln1.rgb -h 0x00200044 -v 0x0050025

mln2test: $(_FORCE)
	/usr/bsd/uncompress -c virdram.rdram.Z > virdram.rdram
	$(ROOT)/PR/iosim/src/iorand -o `date +%d%H%M%S` -C -R -d 0x241 -l io-mln2.log -i 10000 -r 10000 -t 4,7,15,8,17 -s "$(SIMVDIR)/simv2.ipc -l verilog-mln2.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=virdram +vitab=vi-mln2.tab +cbus_mon +rsp_mon +show_imem_on_r1 -vcd /var/tmp/kluster/mln2test.dump"

mln2test.rgb: vi-mln2.tab $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmln2.rgb
	- rm vi-mln2.rgb* vi-mln2.tab???
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-mln2.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmln2.rgb -h 0x00200044 -v 0x0050025

mlp1test: $(_FORCE)
	/usr/bsd/uncompress -c virdram.rdram.Z > virdram.rdram
	$(ROOT)/PR/iosim/src/iorand -o `date +%d%H%M%S` -C -R -d 0x241 -l io-mlp1.log -i 10000 -r 10000 -t 4,7,15,8,18 -s "$(SIMVDIR)/simv2.ipc -l verilog-mlp1.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=virdram +vitab=vi-mlp1.tab +cbus_mon +rsp_mon +show_imem_on_r1  -vcd /var/tmp/kluster/mlp1test.dump"

mlp1test.rgb: vi-mlp1.tab $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmlp1.rgb
	- rm vi-mlp1.rgb* vi-mlp1.tab???
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-mlp1.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmlp1.rgb -h 0x00200040 -v 0x0050025

mhn1test: $(_FORCE)
	/usr/bsd/uncompress -c virdram.rdram.Z > virdram.rdram
	$(ROOT)/PR/iosim/src/iorand -o `date +%d%H%M%S` -C -R -d 0x241 -l io-mhn1.log -i 10000 -r 10000 -t 4,7,15,8,19 -s "$(SIMVDIR)/simv2.ipc -l verilog-mhn1.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=virdram +vitab=vi-mhn1.tab +cbus_mon +rsp_mon +show_imem_on_r1  -vcd /var/tmp/kluster/mhn1test.dump"

mhn1test.rgb: vi-mhn1.tab $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmhn1.rgb
	- rm vi-mhn1.rgb* vi-mhn1.tab???
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-mhn1.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmhn1.rgb -h 0x00200044 -v 0x0050025

mhf2test: $(_FORCE)
	/usr/bsd/uncompress -c virdram.rdram.Z > virdram.rdram
	$(ROOT)/PR/iosim/src/iorand -o `date +%d%H%M%S` -C -R -d 0x241 -l io-mhf2.log -i 10000 -r 10000 -t 4,7,15,8,20 -s "$(SIMVDIR)/simv2.ipc -l verilog-mhf2.log +load_imem +load_dmem +load_pif +load_rom +mmap_rdram=virdram +vitab=vi-mhf2.tab +cbus_mon +rsp_mon +show_imem_on_r1  +vi_dump -vcd /var/tmp/kluster/mhf2test.dump"

mhf2test.rgb: vi-mhf2.tab $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmhf2.rgb
	- rm vi-mhf2.rgb* vi-mhf2.tab???
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-mhf2.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Nmhf2.rgb -h 0x00200044 -v 0x0050025

#dth2test: $(_FORCE)
#	- /usr/bsd/uncompress -c dither.rdram.Z > dither.rdram
#	$(ROOT)/PR/iosim/src/iorand -C -d 0x241 -l io-dth2.log -i 10000 -r 10000 -t 21 -s "$(SIMVDIR)/simv2.ipc -l verilog-dth2.log +mmap_rdram=dither +vitab=vi-dth2.tab +cbus_mon"

dth2test: $(_FORCE)
	- /usr/bsd/uncompress -c dither.rdram.Z > dither.rdram
	$(ROOT)/PR/iosim/src/iorand -m 6 -C -d 0x241 -l io-dth2.log -t 9 -s "$(SIMVDIR)/simv2.ipc -l verilog-dth2.log +mmap_rdram=dither +vitab=vi-dth2.tab +cbus_mon"


dth2test.rgb: vi-dth2.tab $(ROOT)/PR/rdpsim/backend/test/Iosim/Ndth2.rgb
	- rm vi-dth2.rgb* vi-dth2.tab???
	$(ROOT)/PR/rdpsim/backend/diffvideo -i vi-dth2.tab -g $(ROOT)/PR/rdpsim/backend/test/Iosim/Ndth2.rgb -h 0x00200044 -v 0x0050025