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
commit002e3d7d13c414ea874abbee8d82803dd3a72fe5 (patch)
tree6627c12fa07f6a1cf73e5aaeb7390e698dd3a896 /debug/risc-v-gsp-rm-vm/greeneye/__init__.py
parent2f249817df327f5dcccf0464ad517fa60d6071d3 (diff)
downloadopen-iov-002e3d7d13c414ea874abbee8d82803dd3a72fe5.tar.gz
open-iov-002e3d7d13c414ea874abbee8d82803dd3a72fe5.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,