GNUmakefile 2.17 KB
#  Make file for RSP simulator
#     
#  all    --- vall 
#  clean  --- clean both rsptest directories


##### 
TOP_PATH = $(shell echo `pwd`)
RSP_PATH = ${TOP_PATH}/rsptest
BIN_PATH = ${TOP_PATH}/bin

default:
	@echo "run: make [all|su|vu|pin|dma|...] to start the test"

#
#  Build Verilog test 
#
all: su su_single vu vu_single pin pin_single dma

# verilog su test 
su: rsp
	rm -rf ${RSP_PATH}/SUTest/regression.log
	mkdir -p ${RSP_PATH}/SUTest/tests
	cp -rf ${ROOT}/PR/hw2/chip/vsim/tests/divrom.dat ${RSP_PATH}/SUTest/tests
	cd ${RSP_PATH}/SUTest; \
	${BIN_PATH}/rsp_regression +ctrace -SU

su_single: rsp
	rm -rf ${RSP_PATH}/SUTestSingle/regression.log
	mkdir -p ${RSP_PATH}/SUTestSingle/tests
	cp -rf ${ROOT}/PR/hw2/chip/vsim/tests/divrom.dat ${RSP_PATH}/SUTestSingle/tests
	cd ${RSP_PATH}/SUTestSingle; \
	${BIN_PATH}/rsp_regression +ctrace +single_step -SU 

# verilog vu test
vu: rsp d2asm
	rm -rf ${RSP_PATH}/VUTes/regression.log
	mkdir -p ${RSP_PATH}/VUTest/tests
	cp -rf ${ROOT}/PR/hw2/chip/vsim/tests/divrom.dat ${RSP_PATH}/VUTest/tests
	cd ${RSP_PATH}/VUTest; \
	${BIN_PATH}/rsp_regression +ctrace -VU

vu_single: rsp d2asm
	rm -rf ${RSP_PATH}/VUTestSingle/regression.log
	mkdir -p ${RSP_PATH}/VUTestSingle/tests
	cp -rf ${ROOT}/PR/hw2/chip/vsim/tests/divrom.dat ${RSP_PATH}/VUTestSingle/tests
	cd ${RSP_PATH}/VUTestSingle; \
	${BIN_PATH}/rsp_regression +ctrace +single_step -VU

# verilog pinRSP test
pin: rsp reorder d2asm
	mkdir -p ${RSP_PATH}/pinTest
	cd ${RSP_PATH}/pinTest; \
	${BIN_PATH}/bcp_test pin
	
pin_single: rsp reorder d2asm
	mkdir -p ${RSP_PATH}/pinTestSingle
	cd ${RSP_PATH}/pinTestSingle; \
	${BIN_PATH}/bcp_test pin_single


# verilog dma test
dma: rsp reorder 
	rm -rf ${RSP_PATH}/dmatest/regression.log
	mkdir -p ${RSP_PATH}/dmatest
	cd ${RSP_PATH}/dmatest; \
	${BIN_PATH}/bcp_test dma

dma_rand: rsp reorder 
	rm -rf ${RSP_PATH}/dmatest/regression.log
	mkdir -p ${RSP_PATH}/dmatest
	cd ${RSP_PATH}/dmatest; \
	export IOSIM_ADDR=0; \
	export IOSIM_MEM_SIZE=16384; \
	${BIN_PATH}/bcp_test dma rand

#  Clean the RSP test 
#
clean: 
	@rm -rf ${RSP_PATH}
reorder:
	@(cd bin; make)

rsp:
	@echo "check if ROOT is defined"
	test "" != "${ROOT}" 
	@(cd ..; make)

d2asm:
	cd csrc; make