Line 430... |
Line 430... |
$(Q)echo; echo "\t### Launching simulation ###"; echo
|
$(Q)echo; echo "\t### Launching simulation ###"; echo
|
$(Q)vsim $(VSIM_ARGS) tb
|
$(Q)vsim $(VSIM_ARGS) tb
|
|
|
|
|
.PHONY: rtl-test
|
.PHONY: rtl-test
|
rtl-test: clean-sim-test-sw sw clean-test-defines $(TEST_DEFINES_VLG) \
|
rtl-test: clean-sim-test-sw sw-vmem clean-test-defines $(TEST_DEFINES_VLG) \
|
$(SIMULATOR)
|
$(SIMULATOR)
|
|
|
# Run an RTL test followed by checking of generated results
|
# Run an RTL test followed by checking of generated results
|
rtl-test-with-check: rtl-test
|
rtl-test-with-check: rtl-test
|
$(Q)$(MAKE) check-test-log; \
|
$(Q)$(MAKE) check-test-log; \
|
Line 478... |
Line 478... |
# default to the software tests in the root directory
|
# default to the software tests in the root directory
|
TEST_MODULE=$(shell echo $(TEST) | cut -d "-" -f 1)
|
TEST_MODULE=$(shell echo $(TEST) | cut -d "-" -f 1)
|
BOARD_SW_TEST_DIR=$(BOARD_SW_DIR)/tests/$(TEST_MODULE)/sim
|
BOARD_SW_TEST_DIR=$(BOARD_SW_DIR)/tests/$(TEST_MODULE)/sim
|
COMMON_SW_TEST_DIR=$(COMMON_SW_DIR)/tests/$(TEST_MODULE)/sim
|
COMMON_SW_TEST_DIR=$(COMMON_SW_DIR)/tests/$(TEST_MODULE)/sim
|
# Do this by testing for the file's existence
|
# Do this by testing for the file's existence
|
SW_TEST_DIR=$(shell if [ -e $(BOARD_SW_TEST_DIR)/$(TEST).[cS] ]; then echo $(BOARD_SW_TEST_DIR); else echo $(COMMON_SW_TEST_DIR); fi)
|
TEST_SW_DIR=$(shell if [ -e $(BOARD_SW_TEST_DIR)/$(TEST).[cS] ]; then echo $(BOARD_SW_TEST_DIR); else echo $(COMMON_SW_TEST_DIR); fi)
|
|
|
print-test-sw-dir:
|
print-test-sw-dir:
|
@echo; echo "\tTest software is in the following path"; echo;
|
@echo; echo "\tTest software is in the following path"; echo;
|
@echo $(BOARD_SW_DIR); echo;
|
@echo $(BOARD_SW_DIR); echo;
|
@echo $(BOARD_SW_TEST_DIR); echo;
|
@echo $(BOARD_SW_TEST_DIR); echo;
|
@echo $(SW_TEST_DIR); echo;
|
@echo $(TEST_SW_DIR); echo;
|
|
|
print-sw-tests:
|
print-sw-tests:
|
$(Q) $(MAKE) -C $(COMMON_SW_DIR)/lib print-sw-tests
|
$(Q) $(MAKE) -C $(COMMON_SW_DIR)/lib print-sw-tests
|
$(Q) $(MAKE) -C $(COMMON_SW_DIR)/lib print-sw-tests-subdirs
|
$(Q) $(MAKE) -C $(COMMON_SW_DIR)/lib print-sw-tests-subdirs
|
|
|
Line 497... |
Line 497... |
# system function.
|
# system function.
|
|
|
# Set PRELOAD_RAM=1 to preload the system memory - be sure the bootROM program
|
# Set PRELOAD_RAM=1 to preload the system memory - be sure the bootROM program
|
# chosen in board.h is the one booting from the reset vector.
|
# chosen in board.h is the one booting from the reset vector.
|
ifeq ($(PRELOAD_RAM), 1)
|
ifeq ($(PRELOAD_RAM), 1)
|
SIM_SW_IMAGE ?=sram.vmem
|
SIM_DIR_VMEM_IMAGE ?=sram.vmem
|
else
|
else
|
SIM_SW_IMAGE ?=flash.in
|
SIM_DIR_VMEM_IMAGE ?=flash.in
|
endif
|
endif
|
|
|
# Amount to pad the image we'll load into the SPI flash
|
# Ability to bypass all stuffing around involved with generating software and
|
HEX_IMAGE_PADDING ?=0x1c0000
|
# directly specify an ELF
|
|
ifeq ($(USER_ELF),)
|
|
ELF_FILE=$(TEST_SW_DIR)/$(TEST).elf
|
|
else
|
|
ELF_FILE=$(USER_ELF)
|
|
ELF_FILE_NOTDIR=$(notdir $(USER_ELF))
|
|
ELF_FILE_NOTDIR_BASENAME=$(basename $(ELF_FILE_NOTDIR))
|
|
endif
|
|
|
.PHONY : sw
|
|
sw: $(SIM_SW_IMAGE)
|
|
|
|
|
# Rules allowing user to specify a pre-existing VMEM file to load into the
|
|
# simulation, instead of compiling a test.
|
|
ifeq ($(USER_VMEM),)
|
|
|
|
|
|
ifeq ($(PRELOAD_RAM), 1)
|
|
VMEM_FILE ?= $(TEST_SW_DIR)/$(TEST).vmem
|
|
else
|
|
VMEM_FILE ?= $(TEST_SW_DIR)/$(TEST).flashin
|
|
endif
|
|
.PHONY: $(VMEM_FILE)
|
|
|
flash.in: $(SW_TEST_DIR)/$(TEST).flashin
|
|
$(Q)if [ -L $@ ]; then unlink $@; fi
|
|
$(Q)ln -s $< $@
|
|
|
|
sram.vmem: $(SW_TEST_DIR)/$(TEST).vmem
|
# If USER_ELF was specified, then we need a slightly different way of
|
|
# generating the VMEM file from it than a usual test
|
|
ifeq ($(USER_ELF),)
|
|
$(SIM_DIR_VMEM_IMAGE): $(VMEM_FILE)
|
$(Q)if [ -L $@ ]; then unlink $@; fi
|
$(Q)if [ -L $@ ]; then unlink $@; fi
|
|
$(Q)if [ -e $@ ]; then rm $@; fi
|
$(Q)ln -s $< $@
|
$(Q)ln -s $< $@
|
|
else # !($(USER_ELF),) - USER_ELF set on command line
|
|
$(SIM_DIR_VMEM_IMAGE): $(USER_ELF)
|
|
$(Q)$(MAKE) -C $(COMMON_SW_DIR)/lib \
|
|
USER_ELF_BIN=`pwd`/$(ELF_FILE_NOTDIR_BASENAME).bin \
|
|
USER_ELF_VMEM=`pwd`/$(ELF_FILE_NOTDIR_BASENAME).vmem \
|
|
gen-user-elf-vmem
|
|
$(Q)cp -v $(ELF_FILE_NOTDIR_BASENAME).vmem $@
|
|
|
|
TEST=$(ELF_FILE_NOTDIR_BASENAME)
|
|
endif
|
|
|
|
else # !($(USER_VMEM),) - USER_VMEM set on command line
|
|
VMEM_FILE=$(USER_VMEM)
|
|
USER_VMEM_NOTDIR=$(notdir $(USER_VMEM))
|
|
TEST=$(basename $(USER_VMEM_NOTDIR))
|
|
|
|
$(SIM_DIR_VMEM_IMAGE): $(VMEM_FILE)
|
|
cp -v $< $@
|
|
|
|
endif
|
|
|
|
|
|
# Amount to pad the image we'll load into the SPI flash for ML501 sims
|
|
HEX_IMAGE_PADDING ?=0x1c0000
|
|
|
|
.PHONY : sw-vmem sw-elf
|
|
sw-vmem: $(SIM_DIR_VMEM_IMAGE)
|
|
|
.PHONY: $(SW_TEST_DIR)/$(TEST).flashin
|
.PHONY: $(TEST_SW_DIR)/$(TEST).flashin
|
$(SW_TEST_DIR)/$(TEST).flashin:
|
$(TEST_SW_DIR)/$(TEST).flashin:
|
$(Q) echo; echo "\t### Compiling software ###"; echo;
|
$(Q) echo; echo "\t### Compiling software ###"; echo;
|
$(Q)$(MAKE) -C $(SW_TEST_DIR) $(TEST).flashin \
|
$(Q)$(MAKE) -C $(TEST_SW_DIR) $(TEST).flashin \
|
HEX_IMAGE_PADDING=$(HEX_IMAGE_PADDING)
|
HEX_IMAGE_PADDING=$(HEX_IMAGE_PADDING)
|
|
|
.PHONY: $(SW_TEST_DIR)/$(TEST).vmem
|
.PHONY: $(TEST_SW_DIR)/$(TEST).vmem
|
$(SW_TEST_DIR)/$(TEST).vmem:
|
$(TEST_SW_DIR)/$(TEST).vmem:
|
$(Q) echo; echo "\t### Compiling software ###"; echo;
|
$(Q) echo; echo "\t### Compiling software ###"; echo;
|
$(Q)$(MAKE) -C $(SW_TEST_DIR) $(TEST).vmem
|
$(Q)$(MAKE) -C $(TEST_SW_DIR) $(TEST).vmem
|
|
|
# Create test software disassembly
|
# Create test software disassembly
|
|
|
sw-dis: $(SW_TEST_DIR)/$(TEST).dis
|
sw-dis: $(TEST_SW_DIR)/$(TEST).dis
|
$(Q)cp -v $< .
|
$(Q)cp -v $< .
|
|
|
$(SW_TEST_DIR)/$(TEST).dis:
|
$(TEST_SW_DIR)/$(TEST).dis:
|
$(Q)$(MAKE) -C $(SW_TEST_DIR) $(TEST).dis
|
$(Q)$(MAKE) -C $(TEST_SW_DIR) $(TEST).dis
|
|
|
#
|
#
|
# Cleaning rules
|
# Cleaning rules
|
#
|
#
|
clean: clean-sim clean-sim-test-sw clean-bootrom clean-out clean-sw
|
clean: clean-sim clean-sim-test-sw clean-bootrom clean-out clean-sw
|
Line 556... |
Line 600... |
|
|
clean-test-defines:
|
clean-test-defines:
|
$(Q)rm -f $(TEST_DEFINES_VLG)
|
$(Q)rm -f $(TEST_DEFINES_VLG)
|
|
|
clean-sim-test-sw:
|
clean-sim-test-sw:
|
$(Q)if [ -e $(SIM_SW_IMAGE) ]; then unlink $(SIM_SW_IMAGE); fi
|
$(Q)if [ -L $(SIM_DIR_VMEM_IMAGE) ]; then unlink $(SIM_DIR_VMEM_IMAGE); fi
|
|
|
clean-sw:
|
clean-sw:
|
$(Q) echo; echo "\t### Cleaning simulation sw directories ###"; echo;
|
$(Q) echo; echo "\t### Cleaning simulation sw directories ###"; echo;
|
$(Q) $(MAKE) -C $(COMMON_SW_DIR)/lib distclean
|
$(Q) $(MAKE) -C $(COMMON_SW_DIR)/lib distclean
|
|
|