summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/sim/devices/pmu.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-03 14:05:38 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-03 14:05:38 -0400
commitcc79b478843f0230fe6aa8ecd822de7ba71c891e (patch)
tree5de760ddec4e45cc23d39ce7502635f5c0711217 /debug/risc-v-gsp-rm-vm/sim/devices/pmu.py
parent40351167dd209012ab485e6164ce94f0b8965422 (diff)
downloadopen-iov-cc79b478843f0230fe6aa8ecd822de7ba71c891e.tar.gz
open-iov-cc79b478843f0230fe6aa8ecd822de7ba71c891e.zip
vgsp: host CUDA bridge + sema release recovery; greeneye simulator wave
- kernel: gsp_cuda_bridge (QMD launch capture, debugfs job/out/done, param+output resolution cached from inline writes), sema drain fixes (never hold/starve a channel), GR ring autopin + counter autoreg, per-page push reads, counter-derive gate; module builds clean - tools/cuda-bridge: CUDA driver-API daemon executing mail/vadd kernels on the physical GPU, CUBB2/CBD2 v2 protocol, layout check + self-tests - tools/guest-diag + tools/cuda-ab: scanner/pin fixes, victory push-only mode - debug/risc-v-gsp-rm-vm: Phase S simulator wave (GSP device model, boot ladder, triage/re-demo harnesses, docs 30-41), GPGPU-sim scaffolding - STATE-CURRENT/docs updates
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/sim/devices/pmu.py')
-rw-r--r--debug/risc-v-gsp-rm-vm/sim/devices/pmu.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/debug/risc-v-gsp-rm-vm/sim/devices/pmu.py b/debug/risc-v-gsp-rm-vm/sim/devices/pmu.py
new file mode 100644
index 0000000..b241c7e
--- /dev/null
+++ b/debug/risc-v-gsp-rm-vm/sim/devices/pmu.py
@@ -0,0 +1,46 @@
+"""PMU stub.
+
+Evidence kind: **none yet** (no PMU register has been observed in the
+570.144 boot runs, and no PMU register semantics are needed to reach the
+rungs achieved so far). The class exists so a profile can attach a PMU
+window without inventing behaviour: every access stays unhandled and is
+reported by the machine's unknown log, and the stub records the accesses it
+saw for later identification.
+
+When PMU accesses are observed, each register is added here with its header
+field evidence and a test, exactly like the falcon block.
+"""
+from __future__ import annotations
+
+from .base import Device
+
+
+class PmuStub(Device):
+ """A PMU window with no proven semantics: observe, never fake."""
+
+ name = "pmu"
+
+ def __init__(self, *, base: int = 0, size: int = 0x1000):
+ super().__init__(base=base, size=size)
+ self.reset()
+
+ def reset(self) -> None:
+ self.seen: dict[str, int] = {}
+
+ def read(self, offset: int, size: int) -> int | None:
+ self._note(offset, size, "r")
+ return None
+
+ def write(self, offset: int, size: int, value: int) -> bool:
+ self._note(offset, size, "w")
+ return False
+
+ def peek(self, offset: int, size: int) -> int | None:
+ return None
+
+ def _note(self, offset: int, size: int, rw: str) -> None:
+ key = f"{rw}:{offset:#x}:{size}"
+ self.seen[key] = self.seen.get(key, 0) + 1
+
+ def state(self) -> dict:
+ return {"seen": dict(sorted(self.seen.items()))}