summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/greeneye/__init__.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 10:58:21 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 10:58:21 -0400
commitf909a5f822c5c4a4e9526b861d4171f8925f5113 (patch)
treeed362021c83569f49b48079a774f05775e84b0bd /debug/risc-v-gsp-rm-vm/greeneye/__init__.py
parent09f241601423b1ae98e97846ee451768ff8a0a9e (diff)
downloadopen-iov-f909a5f822c5c4a4e9526b861d4171f8925f5113.tar.gz
open-iov-f909a5f822c5c4a4e9526b861d4171f8925f5113.zip
debug: green-eye wave 3 - RM harness, local simulator, device map, MCP plugin, value-validation demos, CI pipeline, toolchain docs; add host RM tools rmtool/rmtop
Diffstat (limited to 'debug/risc-v-gsp-rm-vm/greeneye/__init__.py')
-rw-r--r--debug/risc-v-gsp-rm-vm/greeneye/__init__.py41
1 files changed, 37 insertions, 4 deletions
diff --git a/debug/risc-v-gsp-rm-vm/greeneye/__init__.py b/debug/risc-v-gsp-rm-vm/greeneye/__init__.py
index 8b1c1e5..717160c 100644
--- a/debug/risc-v-gsp-rm-vm/greeneye/__init__.py
+++ b/debug/risc-v-gsp-rm-vm/greeneye/__init__.py
@@ -85,13 +85,46 @@ def launch(
name: str = "session",
load_symbols: bool = True,
keep_alive: bool = False,
+ backend: str = "qemu",
+ trace=None,
) -> Session:
- """Launch QEMU (paused), attach, and return a ready Session.
+ """Launch a target (paused), attach, and return a ready Session.
- The target starts paused at its reset vector; use Session.load_image() to
- load an ELF (which also sets PC), or QemuTarget.run_kernel() style helper
- launch with kernel= for the fast `-kernel` path.
+ ``backend="qemu"`` (default) starts ``qemu-system-riscv64`` exactly as
+ before. ``backend="native"`` uses the in-process deterministic RV64IMAC
+ simulator (M1) via ``greeneye.sim_backend``; the Session contract is the
+ same. ``trace`` (native only) enables the R4 exec/access trace: ``True``,
+ a dict of ``{"exec", "start", "end", "max_events"}``, or a
+ ``sim.trace.Trace``; it is saved to the session as ``blobs/trace.jsonl``.
+ The target starts paused at its reset vector; use
+ Session.load_image() to load an ELF (which also sets PC), or launch with
+ kernel= for the fast `-kernel` path.
"""
+ if backend in ("native", "sim"):
+ from .sim_backend import launch_native
+
+ return launch_native(
+ kernel=kernel,
+ memory_mb=memory_mb,
+ record=record,
+ symbols=symbols,
+ name=name,
+ load_symbols=load_symbols,
+ keep_alive=keep_alive,
+ trace=trace,
+ )
+ if trace is not None:
+ from .errors import TargetError
+
+ raise TargetError(
+ "trace= is native-only; for QEMU build qemu/greeneye-trace.so and "
+ "pass -plugin (see qemu/README.md)"
+ )
+ if backend != "qemu":
+ from .errors import TargetError
+
+ raise TargetError(f"unknown backend {backend!r} (use 'qemu' or 'native')")
+
target = QemuTarget(
machine=machine,
memory_mb=memory_mb,