()
| 35 | // PC not aligned to 4 bytes |
| 36 | let result = fetch(&mut bus, 0x8000_0002, 0, PrivilegeMode::Machine, 0); |
| 37 | assert!(matches!( |
| 38 | result, |
| 39 | Err(VmError::InstructionAccessFault(0x8000_0002)) |
| 40 | )); |
| 41 | } |
| 42 | |
| 43 | #[test] |
| 44 | fn fetch_misaligned_byte() { |
| 45 | let mut bus = SystemBus::new(Vec::new()); |
| 46 | |
| 47 | let result = fetch(&mut bus, 0x8000_0001, 0, PrivilegeMode::Machine, 0); |
| 48 | assert!(matches!( |