summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-04 18:42:36 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-04 18:42:36 -0400
commit1f2073d4fbb1d412d9bbf373312e3c51b83db92a (patch)
treea661537d7ec9510324e0a40a5a65e4b8c853f01b /debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py
parentc1adf2727983f5cace8ca0f5d1119ac2256c348e (diff)
downloadopen-iov-1f2073d4fbb1d412d9bbf373312e3c51b83db92a.tar.gz
open-iov-1f2073d4fbb1d412d9bbf373312e3c51b83db92a.zip
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.
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py')
-rw-r--r--debug/risc-v-gsp-rm-vm/tests/test_sim_devices.py28
1 files changed, 22 insertions, 6 deletions
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