(&mut self, cpu: &mut Cpu, group: &BlockGroup, code: &mut BlockTable)
| 484 | |
| 485 | impl icicle_vm::CodeInjector for LoadResizeInjector { |
| 486 | fn inject(&mut self, cpu: &mut Cpu, group: &BlockGroup, code: &mut BlockTable) { |
| 487 | for block in group.blocks.0..group.blocks.1 { |
| 488 | if !self.optimize_upper_bits { |
| 489 | // Directly resize the underlying load pcode ops. |
| 490 | if let Err(e) = self.resizer.resize_loads(cpu, code, block) { |
| 491 | tracing::warn!("[{:#x}] failed to resize load ops: {e}", group.start); |
| 492 | } |
| 493 | } |
| 494 | else { |
| 495 | // Apply resize operations as models. |
| 496 | match self.resizer.get_loads(cpu, code, block) { |
| 497 | Ok(metadata) => { |
| 498 | let mem = cpu |
| 499 | .mem |
| 500 | .get_io_memory_mut(self.mmio_ref) |
| 501 | .as_mut_any() |
| 502 | .downcast_mut::<crate::input::MultiStreamMmio>() |
| 503 | .unwrap(); |
| 504 | |
| 505 | for (pc, load) in metadata { |
| 506 | mem.add_extract_model(pc, load.min_bit, load.max_bit) |
| 507 | } |
| 508 | } |
| 509 | Err(e) => tracing::warn!("[{:#x}] failed to resize load ops: {e}", group.start), |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
nothing calls this directly
no test coverage detected