Skip to content
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

Deduplicate ceno_zkvm examples #606

Open
matthiasgoergens opened this issue Nov 20, 2024 · 0 comments
Open

Deduplicate ceno_zkvm examples #606

matthiasgoergens opened this issue Nov 20, 2024 · 0 comments

Comments

@matthiasgoergens
Copy link
Collaborator

matthiasgoergens commented Nov 20, 2024

We have almost the same code in ceno_zkvm/examples/riscv_opcodes.rs and ceno_zkvm/examples/fibonacci_elf.rs. Let's deduplicate some of that, and make it accessible for other parts of our code base as well.

Eg something like the following would be a useful helper function, instead of copy-and-pasting it wherever we need the functionality:

let halt_record = all_records
    .iter()
    .rev()
    .find(|record| {
        record.insn().codes().kind == EANY
            && record.rs1().unwrap().value == CENO_PLATFORM.ecall_halt()
    })
    .expect("halt record not found");

Look for more instances of these things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant