Skip to content

Commit

Permalink
Remove srecord and use objcopy instead.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ctopal-rl committed Jul 19, 2023
1 parent f60d03b commit c548445
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dv/riscv_compliance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions examples/simple_system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ run stand-alone binaries. It contains:
<https://github.com/lowRISC/lowrisc-toolchains/releases>
* 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

Expand Down
3 changes: 1 addition & 2 deletions examples/sw/benchmarks/coremark/ibex/core_portme.mak
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 2 additions & 6 deletions examples/sw/simple_system/common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 $^ $@
Expand Down

0 comments on commit c548445

Please sign in to comment.