MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / CsrSnapshot

Class CsrSnapshot

crates/virtual-machine/src/cpu/csr.rs:318–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316/// Plain-data snapshot of all CSR values, suitable for cloning and passing to the UI.
317#[derive(Clone, Debug, Default)]
318pub struct CsrSnapshot {
319 pub mstatus: u64,
320 pub misa: u64,
321 pub medeleg: u64,
322 pub mideleg: u64,
323 pub mie: u64,
324 pub mtvec: u64,
325 pub mscratch: u64,
326 pub mepc: u64,
327 pub mcause: u64,
328 pub mtval: u64,
329 pub mip: u64,
330 // sstatus is derived from mstatus & SSTATUS_MASK for display.
331 pub sstatus: u64,
332 pub stvec: u64,
333 pub sscratch: u64,
334 pub sepc: u64,
335 pub scause: u64,
336 pub stval: u64,
337 pub satp: u64,
338 pub pmpcfg0: u64,
339 pub pmpaddr0: u64,
340 pub cycle: u64,
341 pub instret: u64,
342 pub fflags: u8,
343 pub frm: u8,
344}
345
346impl CsrFile {
347 pub fn snapshot(&self) -> CsrSnapshot {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected