sp1_core_executor/events/cpu.rs
1use serde::{Deserialize, Serialize};
2
3use super::memory::MemoryRecordEnum;
4
5/// CPU Event.
6///
7/// This object encapsulates the information needed to prove a CPU operation. This includes its
8/// shard, opcode, operands, and other relevant information.
9#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
10pub struct CpuEvent {
11 /// The clock cycle.
12 pub clk: u32,
13 /// The program counter.
14 pub pc: u32,
15 /// The next program counter.
16 pub next_pc: u32,
17 /// The first operand.
18 pub a: u32,
19 /// The first operand memory record.
20 pub a_record: Option<MemoryRecordEnum>,
21 /// The second operand.
22 pub b: u32,
23 /// The second operand memory record.
24 pub b_record: Option<MemoryRecordEnum>,
25 /// The third operand.
26 pub c: u32,
27 /// The third operand memory record.
28 pub c_record: Option<MemoryRecordEnum>,
29 /// The exit code.
30 pub exit_code: u32,
31}