Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove srecord and use objcopy instead #2062

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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