diff --git a/o1vm/src/elf_loader.rs b/o1vm/src/elf_loader.rs index 1a6dd7ccb8..0fc26a4788 100644 --- a/o1vm/src/elf_loader.rs +++ b/o1vm/src/elf_loader.rs @@ -4,14 +4,14 @@ use log::debug; use std::{collections::HashMap, path::Path}; /// Parse an ELF file and return the parsed data as a structure that is expected -/// by the o1vm RISC-V 32i edition. +/// by the o1vm RISC-V 32 bits edition. // FIXME: parametrize by an architecture. We should return a state depending on the // architecture. In the meantime, we can have parse_riscv32i and parse_mips. // FIXME: for now, we return a State structure, either for RISC-V 32i or MIPS. // We should return a structure specifically built for the o1vm, and not tight // to Cannon. It will be done in a future PR to avoid breaking the current code // and have a huge diff. -pub fn parse_riscv32i(path: &Path) -> Result { +pub fn parse_riscv32(path: &Path) -> Result { debug!("Start parsing the ELF file to load a RISC-V 32i compatible state"); let file_data = std::fs::read(path).expect("Could not read file."); let slice = file_data.as_slice(); diff --git a/o1vm/tests/test_elf_loader.rs b/o1vm/tests/test_elf_loader.rs index 448fea92a0..67095cfd95 100644 --- a/o1vm/tests/test_elf_loader.rs +++ b/o1vm/tests/test_elf_loader.rs @@ -7,7 +7,7 @@ fn test_correctly_parsing_elf() { let path = curr_dir.join(std::path::PathBuf::from( "resources/programs/riscv32i/fibonacci", )); - let state = o1vm::elf_loader::parse_riscv32i(&path).unwrap(); + let state = o1vm::elf_loader::parse_riscv32(&path).unwrap(); // This is the output we get by running objdump -d fibonacci assert_eq!(state.pc, 69932); diff --git a/o1vm/tests/test_riscv_elf.rs b/o1vm/tests/test_riscv_elf.rs index 6544736fac..47a8c3251e 100644 --- a/o1vm/tests/test_riscv_elf.rs +++ b/o1vm/tests/test_riscv_elf.rs @@ -29,7 +29,7 @@ fn test_no_action() { let path = curr_dir.join(std::path::PathBuf::from( "resources/programs/riscv32i/no-action", )); - let state = o1vm::elf_loader::parse_riscv32i(&path).unwrap(); + let state = o1vm::elf_loader::parse_riscv32(&path).unwrap(); let mut witness = Env::::create(PAGE_SIZE.try_into().unwrap(), state); // This is the output we get by running objdump -d no-action assert_eq!(witness.registers.current_instruction_pointer, 69844);