OpenCores
URL https://opencores.org/ocsvn/fwrisc/fwrisc/trunk

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc/] [sim/] [scripts/] [Makefile] - Rev 2

Compare with Previous | Blame | View Log


include $(PACKAGES_DIR)/packages.mk
include $(PACKAGES_DIR)/simscripts/mkfiles/plusargs.mk

MK_INCLUDES += $(FWRISC)/ve/fwrisc/tests/fwrisc_tests.mk

RUN_PRE_TARGETS += ram.hex regs.hex

SRC_DIRS += $(FWRISC)/ve/fwrisc/tb

TB_MODULES_HDL=fwrisc_tb_hdl

SW_IMAGES := $(foreach img,$(call get_plusarg,SW_IMAGE,$(PLUSARGS)),$(subst $(BUILD_DIR)/esw/,,$(img)))
SW_IMAGE := $(firstword $(SW_IMAGES))

ifeq (zephyr.elf,$(notdir $(SW_IMAGE))) 
  SW_IMAGE := $(subst $(BUILD_DIR)/esw/,,$(SW_IMAGE))
else
  SW_IMAGE := $(notdir $(SW_IMAGE))
endif

ifneq (,$(SW_IMAGES))
  BUILD_PRECOMPILE_TARGETS += embedded_sw
endif


ifeq (vl,$(SIM))
  VL_TB_OBJS_LIBS += libfwrisc_tests.o libgoogletest-vl.o libgoogletest.o
  CXXFLAGS += -I$(BUILDDIR)/obj_dir
endif

include $(PACKAGES_DIR)/simscripts/mkfiles/common_sim.mk

regs.hex : $(FWRISC)/rtl/regs.hex
        $(Q)cp $(FWRISC)/rtl/regs.hex .

ifneq (,$(SW_IMAGE))
ram.hex : $(BUILD_DIR)/esw/$(SW_IMAGE)
        $(Q)riscv32-unknown-elf-objcopy $^ -O verilog ram.vlog
        $(Q)perl $(MEMORY_PRIMITIVES)/bin/objcopyvl2vl.pl \
                -width 32 -offset 0x80000000 -le ram.vlog ram.hex
else # No software image
ram.hex :
        $(Q)echo "00000000" > $@
        $(Q)echo "00000000" >> $@
        $(Q)echo "00000000" >> $@
        $(Q)echo "00000000" >> $@
        $(Q)echo "00000000" >> $@
        $(Q)echo "00000000" >> $@
        $(Q)echo "00000000" >> $@
        $(Q)echo "00000000" >> $@
endif

embedded_sw :
        $(Q)echo SW_IMAGES=$(SW_IMAGES) SW_IMAGE=$(SW_IMAGE)
        $(Q)if test ! -d esw; then mkdir -p esw; fi
        $(Q)$(MAKE) -C esw VERBOSE=$(VERBOSE) \
                -f $(SIM_DIR)/scripts/embedded.mk $(SW_IMAGES)

include $(PACKAGES_DIR)/packages.mk
        

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.