1
0
Fork 0

Load/store machine cycles

riscv64-cartesi
server 2021-11-16 20:24:04 -07:00
parent ebec9825c7
commit 122e1226e9
1 changed files with 48 additions and 2 deletions

View File

@ -101,7 +101,10 @@ Cycles: 3142947347
# Store Machine State
Instead of fully booting, a RAM image can be loaded and the
CPU set to a cycle, such as 3142947347.
CPU set to a cycle, such as 3142947347. The below command boots
the image and runs until the 3142947347th cycle (when above terminates,
could be earlier), then halts the machine, saving the state of RAM to
a directory.
```
cartesi-machine \
@ -113,6 +116,49 @@ cartesi-machine \
-- /mnt/stockfish/stockfish.sh
```
# Load Machine State
This loads the above machine state and starts it at the begining,
running until the end. Basically, finishes at the end.
```
cartesi-machine \
--load=cartesi/stockfish-ram \
--initial-hash \
--final-hash \
--ram-length=256Mi \
--flash-drive=label:stockfish,filename:cartesi/stockfish.ext2 \
--flash-drive=label:root,filename:/opt/cartesi/share/images/rootfs.ext2 \
-- /mnt/stockfish/stockfish.sh
```
# Store/Load Machine State Mid-Run
This stores the machine state halfway through normal completion.
```
cartesi-machine \
--max-mcycle=1571473674 \
--store=cartesi/stockfish-ram-mid \
--ram-length=256Mi \
--flash-drive=label:stockfish,filename:cartesi/stockfish.ext2 \
--flash-drive=label:root,filename:/opt/cartesi/share/images/rootfs.ext2 \
-- /mnt/stockfish/stockfish.sh
```
This loads the above, and starts it in the middle cycle.
Load and run it from halfway:
```
cartesi-machine \
--load=cartesi/stockfish-ram-mid \
--initial-hash \
--final-hash \
--ram-length=256Mi \
--flash-drive=label:stockfish,filename:cartesi/stockfish.ext2 \
--flash-drive=label:root,filename:/opt/cartesi/share/images/rootfs.ext2 \
-- /mnt/stockfish/stockfish.sh
```
# TODO
* Make image of RAM with stockfish already run once and loaded.
@ -140,7 +186,7 @@ Same as upstream Stockfish, GPL v3.
# Contact
```
# y@deepcrayon.fish or jebba in Cartesi/Stockfish discord
# y@deepcrayon.fish or jebba in Cartesi/Stockfish/lichess discord
```