m1n1.trace.dart: Add DART tracer/handler

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-06-22 01:29:02 +09:00
parent b7147a130a
commit 42b7adad06
2 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# SPDX-License-Identifier: MIT
from m1n1.trace.dart import DARTTracer
DARTTracer = DARTTracer._reloadcls()
DEVICES = [
"/arm-io/dart-pmp",
"/arm-io/dart-sep",
"/arm-io/dart-sio",
"/arm-io/dart-usb1",
"/arm-io/dart-disp0",
"/arm-io/dart-dcp",
"/arm-io/dart-dispext0",
"/arm-io/dart-dcpext",
"/arm-io/dart-scaler",
]
dart_tracers = {}
for i in DEVICES:
tracer = DARTTracer(hv, i, verbose=3)
tracer.start()
dart_tracers[i.split("-")[-1]] = tracer
del tracer

View file

@ -0,0 +1,28 @@
# SPDX-License-Identifier: MIT
from ..hw.dart import *
from ..hv import TraceMode
from ..utils import *
from . import ADTDevTracer
class DARTTracer(ADTDevTracer):
RELOAD_DEPS = [DART]
DEFAULT_MODE = TraceMode.ASYNC
REGMAPS = [DARTRegs]
NAMES = ["regs"]
@classmethod
def _reloadcls(cls):
global DART
DART = DART._reloadcls()
return super()._reloadcls()
def start(self):
super().start()
self.dart = DART(self.hv.iface, self.regs.cached)
def w_STREAM_COMMAND(self, stream_command):
if stream_command.INVALIDATE:
self.dart.invalidate_cache()