mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
commit
d37df566b1
@ -230,9 +230,9 @@ section_header "Installing/Updating RISC-V GNU Toolchain"
|
||||
STATUS="riscv-gnu-toolchain"
|
||||
cd "$RISCV"
|
||||
# Temporarily pin riscv-gnu-toolchain to use GCC 13.2.0. GCC 14 does not work with the Q extension.
|
||||
if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2" "b488ddb"; then
|
||||
if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2"; then
|
||||
cd riscv-gnu-toolchain
|
||||
git reset --hard && git clean -f && git checkout b488ddb #&& git pull
|
||||
git reset --hard && git clean -f && git checkout master && git pull
|
||||
./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;"
|
||||
make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
|
||||
if [ "$clean" ]; then
|
||||
|
@ -1,35 +1,43 @@
|
||||
CEXT := c
|
||||
CPPEXT := cpp
|
||||
# Disable builtin rules because they are a shorter (but incorrect) path that Make will use by default
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
SRCDIR := .
|
||||
SRCEXT := S
|
||||
AEXT := s
|
||||
SEXT := S
|
||||
SRCEXT := \([$(CEXT)$(AEXT)$(SEXT)]\|$(CPPEXT)\)
|
||||
#SRCS = $(wildcard *.S)
|
||||
#PROGS = $(patsubst %.S,%,$(SRCS))
|
||||
SRCDIR = .
|
||||
SRCEXT = S
|
||||
OBJEXT := o
|
||||
EXEEXT := elf
|
||||
SOURCES ?= $(shell find $(SRCDIR) -type f -regex ".*\.$(SRCEXT)" | sort)
|
||||
OBJEXT = elf
|
||||
OBJECTS := $(SOURCES:.$(SEXT)=.$(OBJEXT))
|
||||
ELFS := $(SOURCES:.$(SRCEXT)=.$(EXEEXT))
|
||||
OBJDUMPS := $(addsuffix .objdump, $(ELFS))
|
||||
MEMFILES := $(addsuffix .memfile, $(ELFS))
|
||||
|
||||
all: $(OBJECTS)
|
||||
all: $(OBJDUMPS) $(MEMFILES)
|
||||
|
||||
# Create dissassembly
|
||||
%.elf.objdump: %.elf
|
||||
riscv64-unknown-elf-objdump -S -D $< > $@
|
||||
extractFunctionRadix.sh $@
|
||||
|
||||
# Change many things if bit width isn't 64
|
||||
%.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
|
||||
riscv64-unknown-elf-gcc -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 -mcmodel=medany \
|
||||
-nostartfiles -T../../examples/link/link.ld $<
|
||||
riscv64-unknown-elf-objdump -S -D $@ > $@.objdump
|
||||
riscv64-unknown-elf-elf2hex --bit-width 64 --input $@ --output $@.memfile
|
||||
extractFunctionRadix.sh $@.objdump
|
||||
# Create memfile
|
||||
%.elf.memfile: %.elf
|
||||
riscv64-unknown-elf-elf2hex --bit-width 64 --input $< --output $@
|
||||
|
||||
sim: %.elf
|
||||
# Link object file to create executable
|
||||
.PRECIOUS: %.$(EXEEXT)
|
||||
%.$(EXEEXT): %.$(OBJEXT)
|
||||
riscv64-unknown-elf-gcc -g -o $@ -mcmodel=medany -nostartfiles -T../../examples/link/link.ld $*.o
|
||||
|
||||
# Assemble into object files
|
||||
%.$(OBJEXT): %.$(AEXT)
|
||||
riscv64-unknown-elf-as -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 $<
|
||||
|
||||
# Preprocess assembly files
|
||||
%.$(AEXT): %.$(SRCEXT) WALLY-init-lib.h
|
||||
riscv64-unknown-elf-gcc -E -g -o $@ $<
|
||||
|
||||
sim: %.$(EXEEXT)
|
||||
spike +signature=%.signature.output +signature-granularity=8 %.elf
|
||||
diff --ignore-case %.signature.output %.reference_output || exit
|
||||
echo "Signature matches! Success!"
|
||||
|
||||
clean:
|
||||
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile
|
||||
|
||||
|
||||
|
||||
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile *.o *.s
|
||||
|
@ -275,4 +275,3 @@ one_0:
|
||||
bnez t2, loop_0
|
||||
|
||||
ret
|
||||
|
||||
|
@ -105,4 +105,3 @@ main:
|
||||
|
||||
|
||||
j done
|
||||
|
||||
|
@ -156,6 +156,3 @@ main:
|
||||
|
||||
|
||||
j done
|
||||
|
||||
|
||||
|
@ -324,6 +324,3 @@ sretdone:
|
||||
|
||||
|
||||
finished: j done
|
||||
|
||||
|
||||
|
||||
|
@ -129,5 +129,3 @@ pagetable:
|
||||
.8byte 0x200084CF
|
||||
.8byte 0x200088CF
|
||||
.8byte 0x20008CCF
|
||||
|
||||
|
||||
|
@ -179,7 +179,3 @@ pagetable:
|
||||
.8byte 0x200084EF
|
||||
.8byte 0x200088EF
|
||||
.8byte 0x20008CEF
|
||||
|
||||
|
||||
|
||||
|
@ -152,8 +152,3 @@ pagetable:
|
||||
.8byte 0x200000CF
|
||||
.8byte 0x200000CF
|
||||
.8byte 0x200000CF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -198,4 +198,3 @@ pagetable:
|
||||
.8byte 0x210074CF
|
||||
.8byte 0x210078CF
|
||||
.8byte 0x21007CCF
|
||||
|
||||
|
@ -437,4 +437,3 @@ pagetable:
|
||||
.8byte 0x00000000200060CF
|
||||
.8byte 0x000000002000A0CF
|
||||
.8byte 0x000000002000E0CF
|
||||
|
||||
|
@ -475,4 +475,3 @@ SpecialPage:
|
||||
.8byte 0x00000000200000CF # valid rwx for VA 80805000 for covering ITLB translate
|
||||
.8byte 0x20000000200000CF # PBMT=1 for VA 80806000 for covering ITLB BadPBMT
|
||||
.8byte 0x000000002000000F # valid rwx for VA 80807000 for covering UpdateDA
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user