Skip to content

Commit 4e10f0b

Browse files
committed
script
1 parent 6fae6c2 commit 4e10f0b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

zisk_bench.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
# Map gas used per block
4+
declare -A GAS_USED=(
5+
[23919400]=41075722
6+
[23919500]=40237085
7+
[23919600]=24064259
8+
[23919700]=20862238
9+
[23919800]=31813109
10+
[23919900]=22917739
11+
[23920000]=37256487
12+
[23920100]=33542307
13+
[23920200]=22994047
14+
[23920300]=53950967
15+
)
16+
17+
BLOCKS=(
18+
23919400 23919500 23919600 23919700 23919800
19+
23919900 23920000 23920100 23920200 23920300
20+
)
21+
22+
echo "| Block | Gas Used | Steps | Duration (s) | TP (Msteps/s) | Freq (MHz) | Clocks/step |"
23+
echo "|-------|-----------|--------|--------------|----------------|------------|--------------|"
24+
25+
for BLOCK in "${BLOCKS[@]}"; do
26+
INPUT="generated_inputs/ethrex_mainnet_${BLOCK}_input.bin"
27+
28+
OUT=$(ziskemu -e riscv64ima-zisk-elf -i "$INPUT" -m 2>&1)
29+
30+
LINE=$(echo "$OUT" | grep "process_rom()")
31+
32+
STEPS=$(echo "$LINE" | sed -n 's/.*steps=\([0-9]*\).*/\1/p')
33+
DURATION=$(echo "$LINE" | sed -n 's/.*duration=\([0-9.]*\).*/\1/p')
34+
TP=$(echo "$LINE" | sed -n 's/.*tp=\([0-9.]*\).*/\1/p')
35+
FREQ=$(echo "$LINE" | sed -n 's/.*freq=\([0-9.]*\).*/\1/p')
36+
CLOCKS=$(echo "$LINE" | sed -n 's/.* \([0-9.]*\) clocks\/step.*/\1/p')
37+
38+
GAS=${GAS_USED[$BLOCK]}
39+
40+
echo "| $BLOCK | $GAS | $STEPS | $DURATION | $TP | $FREQ | $CLOCKS |"
41+
done

0 commit comments

Comments
 (0)