From 1e7df67a9cf7e98bcc0750a566796b3a2a51c61f Mon Sep 17 00:00:00 2001 From: cgsfv Date: Tue, 19 Mar 2019 16:43:47 +0100 Subject: Added .map + .lst + .rtl extra output files --- Makefile | 2 ++ scripts/standalone.mk | 22 ++++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 7eb7229..d573825 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,8 @@ SRC_DIR = $(PROGRAM_ROOT)/software/$(PROGRAM) PROGRAM_ELF = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).elf PROGRAM_HEX = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).hex +PROGRAM_LST = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).lst +PROGRAM_RTL = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).rtl ############################################################# # BSP Loading diff --git a/scripts/standalone.mk b/scripts/standalone.mk index 06063b9..cb8ffdb 100644 --- a/scripts/standalone.mk +++ b/scripts/standalone.mk @@ -97,6 +97,8 @@ RISCV_CXXFLAGS += -I$(abspath $(BSP_DIR)/install/include/) # Turn on garbage collection for unused sections RISCV_LDFLAGS += -Wl,--gc-sections +# Turn on linker map file generation +RISCV_LDFLAGS += -Wl,-Map,$(PROGRAM).map # Turn off the C standard library RISCV_LDFLAGS += -nostartfiles -nostdlib # Find the archive files and linker scripts @@ -118,6 +120,8 @@ include $(CONFIGURATION).mk PROGRAM_ELF ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).elf PROGRAM_HEX ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).hex +PROGRAM_LST ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).lst +PROGRAM_RTL ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).rtl .PHONY: all all: software @@ -125,8 +129,8 @@ all: software .PHONY: software software: $(PROGRAM_ELF) -ifneq ($(filter jlink rtl,$(TARGET_TAGS)),) -software: $(PROGRAM_HEX) +ifneq ($(filter rtl,$(TARGET_TAGS)),) +software: $(PROGRAM_RTL) endif PROGRAM_SRCS = $(wildcard $(SRC_DIR)/*.c) $(wildcard $(SRC_DIR)/*.h) $(wildcard $(SRC_DIR)/*.S) @@ -145,23 +149,17 @@ $(PROGRAM_ELF): \ CXXFLAGS="$(RISCV_CXXFLAGS)" \ LDFLAGS="$(RISCV_LDFLAGS)" \ LDLIBS="$(RISCV_LDLIBS)" + mv $(SRC_DIR)/$(basename $(notdir $@)).map $(dir $@) mv $(SRC_DIR)/$(basename $(notdir $@)) $@ touch -c $@ - + $(RISCV_OBJCOPY) -O ihex $(PROGRAM_ELF) $(PROGRAM_HEX) + $(RISCV_OBJDUMP) --source --all-headers --demangle --line-numbers --wide $@ > $(PROGRAM_LST) $(RISCV_SIZE) $@ -# If we're using Segger J-Link OB, use objcopy to create an Intel hex file for programming -ifneq ($(filter jlink,$(TARGET_TAGS)),) -$(PROGRAM_HEX): \ - $(RISCV_OBJCOPY) \ - $(PROGRAM_ELF) - $< -O ihex $(PROGRAM_ELF) $@ -endif - # Use elf2hex if we're creating a hex file for RTL simulation ifneq ($(filter rtl,$(TARGET_TAGS)),) .PHONY: software -$(PROGRAM_HEX): \ +$(PROGRAM_RTL): \ scripts/elf2hex/install/bin/$(CROSS_COMPILE)-elf2hex \ $(PROGRAM_ELF) $< --output $@ --input $(PROGRAM_ELF) --bit-width $(COREIP_MEM_WIDTH) -- cgit v1.2.3 From 1631c82bd9d458b532ce79e15b9c3950e6706747 Mon Sep 17 00:00:00 2001 From: cgsfv Date: Tue, 19 Mar 2019 23:31:12 +0100 Subject: Reverted to naming verilog hex files .hex --- Makefile | 1 - scripts/standalone.mk | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d573825..4089f21 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ SRC_DIR = $(PROGRAM_ROOT)/software/$(PROGRAM) PROGRAM_ELF = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).elf PROGRAM_HEX = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).hex PROGRAM_LST = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).lst -PROGRAM_RTL = $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).rtl ############################################################# # BSP Loading diff --git a/scripts/standalone.mk b/scripts/standalone.mk index cb8ffdb..296d1ff 100644 --- a/scripts/standalone.mk +++ b/scripts/standalone.mk @@ -121,7 +121,6 @@ include $(CONFIGURATION).mk PROGRAM_ELF ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).elf PROGRAM_HEX ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).hex PROGRAM_LST ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).lst -PROGRAM_RTL ?= $(SRC_DIR)/$(CONFIGURATION)/$(PROGRAM).rtl .PHONY: all all: software @@ -129,9 +128,7 @@ all: software .PHONY: software software: $(PROGRAM_ELF) -ifneq ($(filter rtl,$(TARGET_TAGS)),) -software: $(PROGRAM_RTL) -endif +software: $(PROGRAM_HEX) PROGRAM_SRCS = $(wildcard $(SRC_DIR)/*.c) $(wildcard $(SRC_DIR)/*.h) $(wildcard $(SRC_DIR)/*.S) @@ -152,7 +149,6 @@ $(PROGRAM_ELF): \ mv $(SRC_DIR)/$(basename $(notdir $@)).map $(dir $@) mv $(SRC_DIR)/$(basename $(notdir $@)) $@ touch -c $@ - $(RISCV_OBJCOPY) -O ihex $(PROGRAM_ELF) $(PROGRAM_HEX) $(RISCV_OBJDUMP) --source --all-headers --demangle --line-numbers --wide $@ > $(PROGRAM_LST) $(RISCV_SIZE) $@ @@ -163,6 +159,10 @@ $(PROGRAM_RTL): \ scripts/elf2hex/install/bin/$(CROSS_COMPILE)-elf2hex \ $(PROGRAM_ELF) $< --output $@ --input $(PROGRAM_ELF) --bit-width $(COREIP_MEM_WIDTH) +else +$(PROGRAM_HEX): \ + $(PROGRAM_ELF) + $(RISCV_OBJCOPY) -O ihex $(PROGRAM_ELF) $@ endif -- cgit v1.2.3 From 89df2ba74486c947b345494aecd96e51ff78497d Mon Sep 17 00:00:00 2001 From: cgsfv Date: Tue, 19 Mar 2019 23:33:21 +0100 Subject: Missed one search and replace --- scripts/standalone.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/standalone.mk b/scripts/standalone.mk index 296d1ff..8098122 100644 --- a/scripts/standalone.mk +++ b/scripts/standalone.mk @@ -155,7 +155,7 @@ $(PROGRAM_ELF): \ # Use elf2hex if we're creating a hex file for RTL simulation ifneq ($(filter rtl,$(TARGET_TAGS)),) .PHONY: software -$(PROGRAM_RTL): \ +$(PROGRAM_HEX): \ scripts/elf2hex/install/bin/$(CROSS_COMPILE)-elf2hex \ $(PROGRAM_ELF) $< --output $@ --input $(PROGRAM_ELF) --bit-width $(COREIP_MEM_WIDTH) -- cgit v1.2.3