()
| 23 | let result = fetch(&mut bus, 0x8000_0000, 0, PrivilegeMode::Machine, 0); |
| 24 | assert!(result.is_ok()); |
| 25 | assert_eq!( |
| 26 | result.expect("instruction fetch should succeed"), |
| 27 | 0x0000_0013 |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | #[test] |
| 32 | fn fetch_misaligned_halfword() { |
| 33 | let mut bus = SystemBus::new(Vec::new()); |
| 34 | |
| 35 | // PC not aligned to 4 bytes |
| 36 | let result = fetch(&mut bus, 0x8000_0002, 0, PrivilegeMode::Machine, 0); |
| 37 | assert!(matches!( |