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

Function writeback_write_int

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

Source from the content-addressed store, hash-verified

8
9#[test]
10fn writeback_write_int() {
11 let mut regs = Registers::new();
12 let mut csrs = CsrFile::new();
13
14 let mem_result = MemResult::WriteInt {
15 rd: 5,
16 val: 0xDEAD_BEEF,
17 next_pc: 0x8000_0004,
18 };
19
20 let next_pc = writeback(mem_result, &mut regs, &mut csrs).expect("writeback should succeed");
21
22 assert_eq!(regs.read_x(5), 0xDEAD_BEEF);
23 assert_eq!(next_pc, 0x8000_0004);
24}
25
26#[test]
27fn writeback_write_int_to_x0() {

Callers

nothing calls this directly

Calls 1

writebackFunction · 0.85

Tested by

no test coverage detected