@@ -20,10 +20,11 @@ endif
2020
2121ELF := $(BUILD_DIR ) /z6m_debug
2222
23- .PHONY : xpack-elf
23+ .PHONY : xpack-elf xpack-zilkworm xpack-zilkworm-eest gdb rlp-qemu qemu-eest-stdio qemu-eest-fileio rerun-ctest
24+
2425xpack-elf : xpack-zilkworm
25- @[ -d $( BUILD_DIR ) ] || mkdir $(BUILD_DIR )
26- cmake -B$(BUILD_DIR ) -S. -DCMAKE_BUILD_TYPE=Debug \
26+ @mkdir -p $(BUILD_DIR )
27+ cmake -B$(BUILD_DIR ) -S. \
2728 -DCMAKE_TOOLCHAIN_FILE=$(CMAKE_TOOLCHAIN ) \
2829 -DCMAKE_BUILD_TYPE=Debug \
2930 -DCONAN_PROFILE_HOST=$(CONAN_PROFILE ) \
@@ -37,9 +38,8 @@ xpack-elf: xpack-zilkworm
3738 cmake --build $(BUILD_DIR ) -j --verbose
3839
3940xpack-zilkworm :
40- @[ -d $( BUILD_DIR) ] || mkdir $(BUILD_DIR )
41- @[ -d $( BUILD_DIR) /zilkworm ] || mkdir $(BUILD_DIR ) /zilkworm
42- cmake -B$(BUILD_DIR ) /zilkworm -S.. -DCMAKE_BUILD_TYPE=Debug \
41+ @mkdir -p $(BUILD_DIR ) /zilkworm
42+ cmake -B$(BUILD_DIR ) /zilkworm -S.. \
4343 -DCMAKE_TOOLCHAIN_FILE=$(CMAKE_TOOLCHAIN ) \
4444 -DCMAKE_BUILD_TYPE=Debug \
4545 -DCONAN_PROFILE_HOST=$(CONAN_PROFILE ) \
@@ -55,11 +55,11 @@ xpack-zilkworm:
5555 cmake --build $(BUILD_DIR ) /zilkworm -j --target install
5656
5757gdb :
58- riscv-none-elf-gdb -q -ex " target remote :1234" -x .gdbinit build/z6m_debug
58+ riscv-none-elf-gdb -q -ex " target remote :1234" -x .gdbinit $( ELF )
5959
6060# # make rlp-qemu file-name=../prover/temp/blocks/2347866/uni...bin
6161rlp-qemu : xpack-elf
62- @if [ -z " $( file-name) " ]; then echo " Usage: make rlp-qemu file-name=path/to.json" ; exit 1; fi
62+ @if [ -z " $( file-name) " ]; then echo " Usage: make rlp-qemu file-name=path/to.json (ARCH= $( ARCH ) ) " ; exit 1; fi
6363 @echo " QEMU waiting for GDB on :1234..."
6464 @N=$$(wc -c <"$(file-name ) " ) ; \
6565 { printf " 123456789_123456789_123456789_123" ; printf " %u\n" $$ N; cat " $( file-name) " ; } | \
@@ -72,9 +72,8 @@ rlp-qemu: xpack-elf
7272
7373
7474xpack-zilkworm-eest :
75- @[ -d $( BUILD_DIR) ] || mkdir $(BUILD_DIR )
76- @[ -d $( BUILD_DIR) /zilkworm ] || mkdir $(BUILD_DIR ) /zilkworm
77- cmake -B$(BUILD_DIR ) /zilkworm -S.. \
75+ @mkdir -p $(BUILD_DIR ) /zilkworm
76+ cmake -B$(BUILD_DIR ) /zilkworm -S.. \
7877 -DCMAKE_TOOLCHAIN_FILE=$(CMAKE_TOOLCHAIN ) \
7978 -DCMAKE_BUILD_TYPE=Release \
8079 -DCONAN_PROFILE_HOST=$(CONAN_PROFILE ) \
@@ -88,7 +87,6 @@ xpack-zilkworm-eest:
8887 -Wno-dev
8988 cmake --build $(BUILD_DIR ) /zilkworm -j --target install
9089
91- .PHONY : xpack-elf-eest
9290xpack-elf-eest : xpack-zilkworm-eest
9391 cmake -B$(BUILD_DIR ) -S. \
9492 -DCMAKE_TOOLCHAIN_FILE=$(CMAKE_TOOLCHAIN ) \
@@ -107,13 +105,12 @@ xpack-elf-eest: xpack-zilkworm-eest
107105 cmake --build $(BUILD_DIR ) -j --verbose
108106
109107
110- .PHONY : qemu-eest
111- qemu-eest : xpack-elf-eest
112- @if [ -z " $( file-name) " ]; then echo " Usage: make qemu-eest file-name=path/to.json" ; exit 1; fi
108+ qemu-eest-stdio : xpack-elf-eest
109+ @if [ -z " $( file-name) " ]; then echo " Usage: make qemu-eest-stdio file-name=path/to.json (ARCH=$( ARCH) )" ; exit 1; fi
113110 @N=$$(wc -c <"$(file-name ) " ) ; \
114111 { printf " 123456789_123456789_123456789_123" ; printf " 1 %u\n" $$ N; cat " $( file-name) " ; } | \
115112 $(QEMU_SYSTEM ) -M virt -m 2G -nographic \
116- -bios $(BUILD_DIR ) /z6m_debug \
113+ -bios $(ELF ) \
117114 -chardev stdio,mux=on,id=stdio0 \
118115 -serial chardev:stdio0 \
119116 -semihosting-config enable=on,chardev=stdio0 \
@@ -122,57 +119,20 @@ qemu-eest: xpack-elf-eest
122119eest-blockchain-tests : xpack-elf-eest
123120 ctest --test-dir $(BUILD_DIR ) --parallel --output-on-failure
124121
125- rerun-ctest :
122+ rerun-ctest : xpack-elf-eest
126123 ctest --test-dir $(BUILD_DIR ) --parallel --output-on-failure -V --timeout 7200
127124
128- # rerun-qemu-eest:
129- # @if [ -z "$(file-name)" ]; then echo "Usage: make qemu-eest file-name=path/to.json"; exit 1; fi
130- # @N=$$(wc -c <"$(file-name)"); \
131- # { printf "123456789_123456789_123456789_123"; printf "1 %u\n" $$N; cat "$(file-name)"; } | \
132- # qemu-system-riscv32 -M virt -m 2G -nographic \
133- # -bios $(BUILD_DIR)/z6m_debug \
134- # -chardev stdio,mux=on,id=stdio0 \
135- # -serial chardev:stdio0 \
136- # -semihosting-config enable=on,target=native,chardev=stdio0 \
137- # -monitor none \
138- # -qmp unix:/tmp/qmp.sock,server=on,wait=off
139-
140- # rerun-qemu-eest:
141- # which script;
142- # @if [ -z "$(file-name)" ]; then echo "Usage: make rerun-qemu-eest file-name=path/to.json"; exit 1; fi
143- # @N=$$(wc -c <"$(file-name)"); \
144- # rm -f semihost.log; \
145- # script -qefc "{ printf '123456789_123456789_123456789_123'; printf '1 %u\n' $$N; cat '$(file-name)'; } | \
146- # qemu-system-riscv32 -M virt -m 2G -nographic \
147- # -bios $(BUILD_DIR)/z6m_debug \
148- # -chardev stdio,mux=on,id=stdio0,signal=off \
149- # -serial chardev:stdio0 \
150- # -semihosting-config enable=on,chardev=stdio0,target=native \
151- # -monitor none" semihost.log
152-
153- # rerun-qemu-eest:
154- # @if [ -z "$(file-name)" ]; then echo "Usage: make rerun-qemu-eest file-name=path/to.json"; exit 1; fi
155- # @N=$$(wc -c <"$(file-name)"); \
156- # rm -f semihost.log serial.log; \
157- # { printf "123456789_123456789_123456789_123"; printf "1 %u\n" $$N; cat "$(file-name)"; } | \
158- # qemu-system-riscv32 -M virt -m 2G -display none \
159- # -bios $(BUILD_DIR)/z6m_debug \
160- # -chardev stdio,id=sh0,signal=off \
161- # -semihosting-config enable=on,target=native,chardev=sh0 \
162- # -serial none \
163- # -monitor none
164-
165-
166- rerun-qemu-eest :
167- @if [ -z " $( file-name) " ]; then echo " Usage: make rerun-qemu-eest file-name=path/to.json" ; exit 1; fi
125+ qemu-eest-fileio : xpack-elf-eest
126+ @if [ -z " $( file-name) " ]; then echo " Usage: make qemu-eest-fileio file-name=path/to.json (ARCH=$( ARCH) )" ; exit 1; fi
127+ @mkdir -p $(CURDIR ) /temp
168128 @N=$$(wc -c <"$(file-name ) " ) ; \
169- rm -f semihost.log serial.log; \
170- { printf " 1 %u\n" $$ N; cat " $( file-name) " ; } > stdin_payload.bin; \
129+ rm -f $( CURDIR ) /temp/ semihost.log $( CURDIR ) /temp/ serial.log; \
130+ { printf " 1 %u\n" $$ N; cat " $( file-name) " ; } > $( CURDIR ) /temp/ stdin_payload.bin; \
171131 $(QEMU_SYSTEM ) -M virt -m 2G -display none \
172- -bios $(BUILD_DIR ) /z6m_debug \
132+ -bios $(ELF ) \
173133 -monitor none \
174134 -serial none \
175- -chardev file,id=shlog,path=semihost.log \
135+ -chardev file,id=shlog,path=$( CURDIR ) /temp/ semihost.log \
176136 -semihosting-config enable=on,target=native,chardev=shlog
177137
178138
@@ -194,9 +154,12 @@ eest-rv64:
194154 $(MAKE ) ARCH=rv64 eest-blockchain-tests
195155
196156# Clean build artifacts
197- .PHONY : clean clean-all
157+ .PHONY : clean clean-all clean-temp
198158clean :
199159 rm -rf $(BUILD_DIR )
200160
201161clean-all :
202162 rm -rf $(CURDIR ) /build $(CURDIR ) /build64
163+
164+ clean-temp :
165+ rm -f $(CURDIR ) /temp/stdin_payload.bin $(CURDIR ) /temp/semihost.log $(CURDIR ) /temp/serial.log
0 commit comments