From 1f2073d4fbb1d412d9bbf373312e3c51b83db92a Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Sun, 4 Oct 2026 18:42:36 -0400 Subject: greeneye: GMMU/FBIF observability, PTE decoder and oracle, MPU/libos simulator wave Simulator development wave (docs 42-44): GMMU page-table entry decode with its oracle/workflow harness, FBIF observability, and MPU/LIBOS device surfaces in the device model, plus refreshed boot/machine/profile data (tu104-570.144), the qemu-line results, and the new unit tests. Docs 00/06/35-41 updated to match; harness helpers and .gitignore included. --- debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py | 28 +++++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py') diff --git a/debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py b/debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py index 8063ee9..13912b5 100644 --- a/debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py +++ b/debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py @@ -428,18 +428,34 @@ class BootLadderTests(unittest.TestCase): self.assertEqual(r.mmio_unknown, 0) self.assertEqual(r.device_unhandled, 0) - def test_shim_reaches_relocation_b2(self): + def test_shim_reaches_message_loop_b3(self): + from sim.gsp_boot import run_boot + r = run_boot(image=DEFAULT_IMAGE, profile_path=DEFAULT_PROFILE, + instructions=2_000_000, record=False, use_shim=True) + self.assertTrue(r.ran) + self.assertEqual(r.rung, "B3") + self.assertIn("relocation_copy", r.milestones) + self.assertEqual(r.mmio_unknown, 0) + self.assertEqual(r.device_unhandled, 0) + # The MMU model resolves the resident-section copy, the libos service + # path runs (DMA/pagetable registration) and the message-loop task + # blocks in the port wait -- deterministic, not faked. + self.assertEqual(r.stop_reason, "ecall") + self.assertEqual(r.stop_pc, 0x4018038) + stopped = r.libos.get("stopped") or {} + self.assertEqual(stopped.get("num"), 1) # task_port_send_recv_wait + + def test_shim_reaches_relocation_plus_mmu(self): + """The relocation copy reads its real backing through the MPU.""" from sim.gsp_boot import run_boot r = run_boot(image=DEFAULT_IMAGE, profile_path=DEFAULT_PROFILE, instructions=20_000, record=False, use_shim=True) self.assertTrue(r.ran) - self.assertEqual(r.rung, "B2") self.assertIn("relocation_copy", r.milestones) self.assertEqual(r.mmio_unknown, 0) - # Known unknown: the DMEM runspace content the app relocates from is - # not reconstructed; the run stops there rather than faking it. - self.assertEqual(r.stop_reason, "fault") - self.assertEqual(r.stop_pc, 0x400EA0C) + # The run no longer stops at the old B2 fault; with a 20k budget it + # is mid-init and deterministic. + self.assertNotEqual(r.stop_pc, 0x400EA0C) def test_two_runs_identical(self): from sim.gsp_boot import run_boot -- cgit v1.2.3