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

Subversion Repositories fwrisc

[/] [fwrisc/] [trunk/] [ve/] [fwrisc_fpga/] [sim/] [scripts/] [Makefile] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mballance
 
2
include $(PACKAGES_DIR)/packages.mk
3
include $(PACKAGES_DIR)/simscripts/mkfiles/plusargs.mk
4
 
5
MK_INCLUDES += $(FWRISC)/ve/fwrisc_fpga/tests/fwrisc_fpga_tests.mk
6
SRC_DIRS += $(FWRISC)/ve/fwrisc/tests
7
 
8
RUN_PRE_TARGETS += rom.hex regs.hex
9
 
10
TB_MODULES_HDL=fwrisc_fpga_tb_hdl
11
 
12
SW_IMAGES := $(foreach img,$(call get_plusarg,SW_IMAGE,$(PLUSARGS)),$(subst $(BUILD_DIR)/esw/,,$(img)))
13
SW_IMAGE := $(firstword $(SW_IMAGES))
14
 
15
ifeq (zephyr.elf,$(notdir $(SW_IMAGE)))
16
  SW_IMAGE := $(subst $(BUILD_DIR)/esw/,,$(SW_IMAGE))
17
else
18
  SW_IMAGE := $(notdir $(SW_IMAGE))
19
endif
20
 
21
ifneq (,$(SW_IMAGES))
22
  BUILD_PRECOMPILE_TARGETS += embedded_sw
23
endif
24
 
25
 
26
ifeq (vl,$(SIM))
27
  VL_TB_OBJS_LIBS += libfwrisc_fpga_tests.o libgoogletest-vl.o libgoogletest.o
28
  VL_TB_OBJS_LIBS += ElfFileReader.o ElfSymtabReader.o
29
  CXXFLAGS += -I$(BUILDDIR)/obj_dir
30
endif
31
 
32
include $(PACKAGES_DIR)/simscripts/mkfiles/common_sim.mk
33
 
34
regs.hex : $(FWRISC)/rtl/regs.hex
35
        $(Q)cp $(FWRISC)/rtl/regs.hex .
36
 
37
ifneq (,$(SW_IMAGE))
38
rom.hex : $(BUILD_DIR)/esw/$(SW_IMAGE)
39
        $(Q)riscv32-unknown-elf-objcopy $^ -O verilog rom.vlog
40
        $(Q)perl $(MEMORY_PRIMITIVES)/bin/objcopyvl2vl.pl \
41
                -width 32 -offset 0x80000000 -le rom.vlog rom.hex
42
else # No software image
43
rom.hex :
44
        $(Q)echo "00000000" > $@
45
        $(Q)echo "00000000" >> $@
46
        $(Q)echo "00000000" >> $@
47
        $(Q)echo "00000000" >> $@
48
        $(Q)echo "00000000" >> $@
49
        $(Q)echo "00000000" >> $@
50
        $(Q)echo "00000000" >> $@
51
        $(Q)echo "00000000" >> $@
52
endif
53
 
54
embedded_sw :
55
        $(Q)echo SW_IMAGES=$(SW_IMAGES) SW_IMAGE=$(SW_IMAGE)
56
        $(Q)if test ! -d esw; then mkdir -p esw; fi
57
        $(Q)$(MAKE) -C esw VERBOSE=$(VERBOSE) \
58
                -f $(SIM_DIR)/scripts/embedded.mk $(SW_IMAGES)
59
 
60
include $(PACKAGES_DIR)/packages.mk
61
 

powered by: WebSVN 2.1.0

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