From 7b516ae52b735204ba89ba8274910bc5948824fa Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Mon, 3 Nov 2025 13:35:24 +0000 Subject: [PATCH] Remove dependency on srecord The linked issue was resolved 6 years ago so it's probably safe to use the new flag. --- ci/install-build-deps.sh | 1 - dv/riscv_compliance/README.md | 3 +-- examples/simple_system/README.md | 3 --- examples/sw/benchmarks/coremark/ibex/core_portme.mak | 4 ++-- examples/sw/simple_system/common/common.mk | 10 +++------- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ci/install-build-deps.sh b/ci/install-build-deps.sh index b64afb8987..a1327b6dea 100755 --- a/ci/install-build-deps.sh +++ b/ci/install-build-deps.sh @@ -45,7 +45,6 @@ case "$ID-$VERSION_ID" in python3-wheel \ python3-yaml \ python3-dev \ - srecord \ zlib1g-dev \ git \ make \ diff --git a/dv/riscv_compliance/README.md b/dv/riscv_compliance/README.md index 94b76480ea..7d2bb182e0 100644 --- a/dv/riscv_compliance/README.md +++ b/dv/riscv_compliance/README.md @@ -18,13 +18,12 @@ How to run RISC-V Compliance on Ibex have the following tools installed: - Verilator - fusesoc - - srecord (for `srec_cat`) - A RV32 compiler On Ubuntu/Debian, install the required tools like this: ```sh - sudo apt-get install srecord python3-pip + sudo apt-get install python3-pip pip3 install --user -U fusesoc ``` diff --git a/examples/simple_system/README.md b/examples/simple_system/README.md index df8d0e660d..4853cd172e 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..96bd57f9e2 100755 --- a/examples/sw/benchmarks/coremark/ibex/core_portme.mak +++ b/examples/sw/benchmarks/coremark/ibex/core_portme.mak @@ -92,8 +92,8 @@ $(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 -O verilog --reverse-bytes=4 --verilog-data-width=4 \ + $(OPATH)coremark.elf $(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..e1bf9a2b56 100644 --- a/examples/sw/simple_system/common/common.mk +++ b/examples/sw/simple_system/common/common.mk @@ -52,15 +52,11 @@ 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 +%.vmem: %.elf + $(OBJCOPY) -O verilog --reverse-bytes=4 --verilog-data-width=4 $< $@ %.bin: %.elf - $(OBJCOPY) -O binary $^ $@ + $(OBJCOPY) -O binary $< $@ %.o: %.c $(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<