Skip to content

Commit

Permalink
refactor(vm): rename ramp to ram_pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Oct 18, 2023
1 parent 546167e commit 612714d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions triton-vm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct VMState<'pgm> {
pub previous_instruction: BFieldElement,

/// RAM pointer
pub ramp: u64,
pub ram_pointer: u64,

/// The current state of the one, global Sponge that can be manipulated using instructions
/// `SpongeInit`, `SpongeAbsorb`, and `SpongeSqueeze`. Instruction `SpongeInit` resets the
Expand Down Expand Up @@ -127,7 +127,7 @@ impl<'pgm> VMState<'pgm> {
cycle_count: 0,
instruction_pointer: 0,
previous_instruction: Default::default(),
ramp: 0,
ram_pointer: 0,
sponge_state: Default::default(),
halting: false,
}
Expand Down Expand Up @@ -351,15 +351,15 @@ impl<'pgm> VMState<'pgm> {
let ram_pointer = self.op_stack.peek_at(ST0);
let ram_value = self.memory_get(&ram_pointer);
self.op_stack.push(ram_value);
self.ramp = ram_pointer.value();
self.ram_pointer = ram_pointer.value();
self.instruction_pointer += 1;
vec![]
}

fn write_mem(&mut self) -> Result<Vec<CoProcessorCall>> {
let ram_pointer = self.op_stack.peek_at(ST1);
let ram_value = self.op_stack.pop()?;
self.ramp = ram_pointer.value();
self.ram_pointer = ram_pointer.value();
self.ram.insert(ram_pointer, ram_value);
self.instruction_pointer += 1;
Ok(vec![])
Expand Down Expand Up @@ -682,7 +682,7 @@ impl<'pgm> VMState<'pgm> {

let current_instruction = self.current_instruction().unwrap_or(Nop);
let helper_variables = self.derive_helper_variables();
let ram_pointer = self.ramp.into();
let ram_pointer = self.ram_pointer.into();

processor_row[CLK.base_table_index()] = (self.cycle_count as u64).into();
processor_row[PreviousInstruction.base_table_index()] = self.previous_instruction;
Expand Down

0 comments on commit 612714d

Please sign in to comment.