Attempt to enable RV32 C extension. c.lw and c.sw are definitely broken somehow wrt MMIO memory.

Examples built using C extensions, many fail in strange ways
This commit is contained in:
Toby Jaffey 2025-12-17 15:43:15 +00:00
parent 652094c289
commit adec69e1d7
17 changed files with 132 additions and 76 deletions

View file

@ -11,6 +11,7 @@ all:
cat ${TOPDIR}/uvm32/uvm32.c >> uvm32.cpp
cp ${TOPDIR}/uvm32/uvm32.h uvm32.h
cp ${TOPDIR}/uvm32/mini-rv32ima.h mini-rv32ima.h
cp ${TOPDIR}/uvm32/rv32c.h rv32c.h
cp ${TOPDIR}/common/uvm32_common_custom.h uvm32_common_custom.h
cp ${TOPDIR}/common/uvm32_sys.h uvm32_sys.h
xxd -n mandel -i ${TOPDIR}/precompiled/mandel.bin | sed -e "s/unsigned char/const unsigned char/" > mandel.h

View file

@ -6,7 +6,7 @@ all:
@echo "};\nunsigned int mandel_len = " >> mandel.h
@wc -c ${TOPDIR}/precompiled/mandel.bin | awk '{print $$1}' >> mandel.h
@echo ";" >> mandel.h
gcc -Wall -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=512 -O2 -I${TOPDIR}/uvm32 -I${TOPDIR}/common -o host-mini ${TOPDIR}/uvm32/uvm32.c host-mini.c
gcc -Wall -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=512 -Wno-gnu-binary-literal -O2 -I${TOPDIR}/uvm32 -I${TOPDIR}/common -o host-mini ${TOPDIR}/uvm32/uvm32.c host-mini.c
clean:
rm -f host-mini

View file

@ -5,7 +5,7 @@ all:
@echo "};\nunsigned int fib_len = " >> fib.h
@wc -c ${TOPDIR}/precompiled/fib.bin | awk '{print $$1}' >> fib.h
@echo ";" >> fib.h
gcc -Wall -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=16386 -I${TOPDIR}/uvm32 -I${TOPDIR}/common -o host-parallel ${TOPDIR}/uvm32/uvm32.c host-parallel.c
gcc -Wall -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=16386 -Wno-gnu-binary-literal -I${TOPDIR}/uvm32 -I${TOPDIR}/common -o host-parallel ${TOPDIR}/uvm32/uvm32.c host-parallel.c
clean:
rm -f host-parallel

View file

@ -9,8 +9,8 @@ LIBS = `pkg-config sdl3 --libs --static`
CFLAGS += `pkg-config sdl3 --cflags`
endif
CFLAGS += -Wall -Werror
CFLAGS += -pedantic -std=c99 -O3
CFLAGS += -Wall -Werror -Wno-gnu-binary-literal
CFLAGS += -pedantic -std=c99 -O0 -g
CFLAGS += -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=$(shell echo "1024 * 1024 * 8" | bc)
all:

View file

@ -1,7 +1,7 @@
TOPDIR=../..
all:
gcc -Wall -Werror -pedantic -std=c99 -O2 -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=65536 -I${TOPDIR}/uvm32 -I${TOPDIR}/common -o host ${TOPDIR}/uvm32/uvm32.c host.c
gcc -g -Wall -Werror -pedantic -std=c99 -Wno-gnu-binary-literal -O0 -DUVM32_ERROR_STRINGS -DUVM32_MEMORY_SIZE=65536 -I${TOPDIR}/uvm32 -I${TOPDIR}/common -o host ${TOPDIR}/uvm32/uvm32.c host.c
clean:
rm -f host