()
| 8 | |
| 9 | #[test] |
| 10 | fn fetch_aligned_word() { |
| 11 | let mut bus = SystemBus::new(Vec::new()); |
| 12 | |
| 13 | // Write a valid instruction at aligned address |
| 14 | bus.write_byte(0x8000_0000, 0x13) |
| 15 | .expect("bus write should succeed"); |
| 16 | bus.write_byte(0x8000_0001, 0x00) |
| 17 | .expect("bus write should succeed"); |
| 18 | bus.write_byte(0x8000_0002, 0x00) |
| 19 | .expect("bus write should succeed"); |
| 20 | bus.write_byte(0x8000_0003, 0x00) |
| 21 | .expect("bus write should succeed"); // addi x0, x0, 0 (nop) |
| 22 | |
| 23 | let result = fetch(&mut bus, 0x8000_0000, 0, PrivilegeMode::Machine, 0); |
| 24 | assert!(result.is_ok()); |
| 25 | assert_eq!( |
nothing calls this directly
no test coverage detected