mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-28 09:36:01 -04:00
Add Makefile in testbench to allow the memfile to generate the correct version based on the elf output in objdump. Previously this was done via a findstring which works with riscv-arch-tests but doesn't allow individual programs/elf to be used unless the program is called xxx_rv32.
This commit is contained in:
parent
5c4e2ea2fb
commit
8dc6eab6dd
1 changed files with 9 additions and 1 deletions
|
@ -1,9 +1,17 @@
|
||||||
# Makefile for testbench to create .memfile, .objdump.addr, and .objdump.lab from an ELF
|
# Makefile for testbench to create .memfile, .objdump.addr, and .objdump.lab from an ELF
|
||||||
# David_Harris@hmc.edu 3 July 2024
|
# David_Harris@hmc.edu 3 July 2024
|
||||||
|
# james.stine@okstate.edu 24 Jan 2025
|
||||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||||
|
|
||||||
|
# the width is set by the elf's type to allow for individual elf compilation
|
||||||
%.memfile: %
|
%.memfile: %
|
||||||
riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv32,$*),32,64) --input $< --output $@
|
@if grep -q 'elf32' $*.objdump; then \
|
||||||
|
BIT_WIDTH=32; \
|
||||||
|
else \
|
||||||
|
BIT_WIDTH=64; \
|
||||||
|
fi; \
|
||||||
|
echo "Processing $< with --bit-width $$BIT_WIDTH"; \
|
||||||
|
riscv64-unknown-elf-elf2hex --bit-width $$BIT_WIDTH --input $< --output $@
|
||||||
|
|
||||||
%.objdump.addr: %.objdump
|
%.objdump.addr: %.objdump
|
||||||
extractFunctionRadix.sh $<
|
extractFunctionRadix.sh $<
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue