From c548445f679f1c2e5676a8a3d5f85a742dc8870a Mon Sep 17 00:00:00 2001 From: Canberk Date: Tue, 18 Jul 2023 17:12:51 +0100 Subject: [PATCH] Remove srecord and use objcopy instead. Now that objcopy have support for `--verilog-data-width`, we don't need srecord anymore. Only keep it for riscv-compliance testing reasons. Signed-off-by: Canberk --- dv/riscv_compliance/README.md | 2 +- examples/simple_system/README.md | 3 --- examples/sw/benchmarks/coremark/ibex/core_portme.mak | 3 +-- examples/sw/simple_system/common/common.mk | 8 ++------ 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dv/riscv_compliance/README.md b/dv/riscv_compliance/README.md index 94b76480ea..f1b7f71994 100644 --- a/dv/riscv_compliance/README.md +++ b/dv/riscv_compliance/README.md @@ -18,7 +18,7 @@ How to run RISC-V Compliance on Ibex have the following tools installed: - Verilator - fusesoc - - srecord (for `srec_cat`) + - srecord (for `srec_cat`) - won't be needed once moved to a newer version. - A RV32 compiler On Ubuntu/Debian, install the required tools like this: diff --git a/examples/simple_system/README.md b/examples/simple_system/README.md index c5972e23e6..14fb626331 100644 --- a/examples/simple_system/README.md +++ b/examples/simple_system/README.md @@ -21,9 +21,6 @@ run stand-alone binaries. It contains: * libelf and its development libraries. On Debian/Ubuntu, install it by running `apt-get install libelf-dev`. -* srecord. - On Debian/Ubuntu, install it by running `apt-get install srecord`. - (Optional, needed for generating a vmem file) ## Building Simulation diff --git a/examples/sw/benchmarks/coremark/ibex/core_portme.mak b/examples/sw/benchmarks/coremark/ibex/core_portme.mak index c9ae95737a..8fbf91d80d 100755 --- a/examples/sw/benchmarks/coremark/ibex/core_portme.mak +++ b/examples/sw/benchmarks/coremark/ibex/core_portme.mak @@ -92,8 +92,7 @@ $(OPATH)$(PORT_DIR)/%$(OEXT) : %.s port_postbuild: riscv32-unknown-elf-objdump -SD $(OPATH)coremark.elf > $(OPATH)coremark.dis riscv32-unknown-elf-objcopy -O binary $(OPATH)coremark.elf $(OPATH)coremark.bin - srec_cat $(OPATH)coremark.bin -binary -offset 0x0000 -byte-swap 4 -o $(OPATH)coremark.vmem -vmem - + riscv32-unknown-elf-objcopy --strip-all --verilog-data-width=4 --reverse-bytes=4 -O verilog -I binary $(OPATH)coremark.bin $(OPATH)coremark.vmem # FLAG : OPATH # Path to the output folder. Default - current folder. diff --git a/examples/sw/simple_system/common/common.mk b/examples/sw/simple_system/common/common.mk index 9c4946e6d7..b251cfe129 100644 --- a/examples/sw/simple_system/common/common.mk +++ b/examples/sw/simple_system/common/common.mk @@ -34,7 +34,7 @@ OBJS := ${C_SRCS:.c=.o} ${ASM_SRCS:.S=.o} ${CRT:.S=.o} DEPS = $(OBJS:%.o=%.d) ifdef PROGRAM -OUTFILES := $(PROGRAM).elf $(PROGRAM).vmem $(PROGRAM).bin +OUTFILES := $(PROGRAM).elf $(PROGRAM).dis $(PROGRAM).vmem $(PROGRAM).bin else OUTFILES := $(OBJS) endif @@ -52,12 +52,8 @@ endif %.dis: %.elf $(OBJDUMP) -fhSD $^ > $@ -# Note: this target requires the srecord package to be installed. -# XXX: This could be replaced by objcopy once -# https://sourceware.org/bugzilla/show_bug.cgi?id=19921 -# is widely available. %.vmem: %.bin - srec_cat $^ -binary -offset 0x0000 -byte-swap 4 -o $@ -vmem + $(OBJCOPY) -S --verilog-data-width=4 --reverse-bytes=4 -O verilog -I binary $^ $@ %.bin: %.elf $(OBJCOPY) -O binary $^ $@