-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emul: Runtime and build scripts #173
Conversation
* emul-elf: introduce elf crate and risc0 load_elf() * emul-elf: load and execute a test program * emul-elf: use examples/ folder * runtime: example program using memory and stack --------- Co-authored-by: Aurélien Nicolas <[email protected]>
c5ad53a
to
963d504
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM! I believe detail can be further adjust once we move to integration phase
just to bring up a question to discuss regarding to overflow handling: does compiler/toolchain seasoning unsigned overflow check in riscv by default?
Absolutely, we can go back to the layout of virtual memory and decide what regions the VM provides and how we are going to implement them. Then reflect it in the linker script.
I just tried and it is disabled by default. A particular program can enable it with |
Thanks for the quick verified :) I think it make sense to disable In other word, it's like we on purposely design circuit dissatisfy cc @kunxian-xia and @zemse |
An updated: realized revm i256
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM although not having all the check for the detail!
A suggestion: binary file will be better to compile on the fly instead of commit to repo. But since the size is small with just few kb, we can polishing it as enhancement later
@hero78119 That worked, thank you! |
- Partially address issue #174 - fix under constraints - optimized constriants register read constraints check - address the discussion in #173 (comment) to support overflow/underflow arithmetics due to wrapping_add/sub in revm - `MockProver` move to test scope and load u16 table > Later we need to optimize and support table reuse across unittest to reduce overhead. cc @zemse :) - ~~all witness assignment use base field instead of ext field~~ done by #192 --------- Co-authored-by: kunxian xia <[email protected]>
_Based on #173._ This PR experiments with how Input / Output can work. It is based on MMIO - Memory-Mapped IO. It works by reading or writing to specific memory addresses. The system recognizes this and can commit to the content as part of the proof. This can also be used for debug statements during development: ``` 📜📜📜 Hello, World! 🌏🌍🌎 test test_ceno_rt_io ... ok ``` --------- Co-authored-by: Aurélien Nicolas <[email protected]>
_Based on #173._ - This PR provides a `GlobalAllocator` to support heap memory. - Example program using `Vec`. --------- Co-authored-by: Aurélien Nicolas <[email protected]> Co-authored-by: Ming <[email protected]>
_Issue #179._ This is an experimental setup to compile programs for the VM. ### Runtime - Introduce a `ceno_rt` crate. It is a convention to provide a `*_rt` for the platform, to handle details of startup, memory, and IO. - Minimal linker and build scripts to put the code at the right location. - Example `ceno_rt_mini` that successfully halts. - Example `ceno_rt_mem` that uses the stack and a global variable. - Example `ceno_rt_panic` that panics. The emulator returns an error. ### Emulator - Parse compiled VM programs. This uses the [elf crate](https://docs.rs/elf/latest/elf/) and a function taken from Risc0. - Load the code and data into ROM and RAM. - Execute the program with the emulator. --------- Co-authored-by: Aurélien Nicolas <[email protected]>
- Partially address issue #174 - fix under constraints - optimized constriants register read constraints check - address the discussion in #173 (comment) to support overflow/underflow arithmetics due to wrapping_add/sub in revm - `MockProver` move to test scope and load u16 table > Later we need to optimize and support table reuse across unittest to reduce overhead. cc @zemse :) - ~~all witness assignment use base field instead of ext field~~ done by #192 --------- Co-authored-by: kunxian xia <[email protected]>
_Based on #173._ This PR experiments with how Input / Output can work. It is based on MMIO - Memory-Mapped IO. It works by reading or writing to specific memory addresses. The system recognizes this and can commit to the content as part of the proof. This can also be used for debug statements during development: ``` 📜📜📜 Hello, World! 🌏🌍🌎 test test_ceno_rt_io ... ok ``` --------- Co-authored-by: Aurélien Nicolas <[email protected]>
_Based on #173._ - This PR provides a `GlobalAllocator` to support heap memory. - Example program using `Vec`. --------- Co-authored-by: Aurélien Nicolas <[email protected]> Co-authored-by: Ming <[email protected]>
Issue #179. This is an experimental setup to compile programs for the VM.
Runtime
ceno_rt
crate. It is a convention to provide a*_rt
for the platform, to handle details of startup, memory, and IO.ceno_rt_mini
that successfully halts.ceno_rt_mem
that uses the stack and a global variable.ceno_rt_panic
that panics. The emulator returns an error.Emulator