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

Function writeback_write_int_to_x0

crates/virtual-machine/tests/vm_writeback.rs:27–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26#[test]
27fn writeback_write_int_to_x0() {
28 let mut regs = Registers::new();
29 let mut csrs = CsrFile::new();
30
31 let mem_result = MemResult::WriteInt {
32 rd: 0,
33 val: 42,
34 next_pc: 0x8000_0004,
35 };
36
37 let next_pc = writeback(mem_result, &mut regs, &mut csrs).expect("writeback should succeed");
38
39 // x0 must always be zero
40 assert_eq!(regs.read_x(0), 0);
41 assert_eq!(next_pc, 0x8000_0004);
42}
43
44// --- Writeback stage, floating-point register writes ---
45

Callers

nothing calls this directly

Calls 1

writebackFunction · 0.85

Tested by

no test coverage detected