diff --git a/proxyclient/m1n1/hw/dart.py b/proxyclient/m1n1/hw/dart.py index 988cf8f7..09bf51bf 100644 --- a/proxyclient/m1n1/hw/dart.py +++ b/proxyclient/m1n1/hw/dart.py @@ -213,6 +213,8 @@ class DART(Reloadable): if tcr.BYPASS_DART or not tcr.TRANSLATE_ENABLE: raise Exception(f"Unknown DART mode {tcr}") + start = start & 0xffffffff + start_page = align_down(start, self.PAGE_SIZE) start_off = start - start_page end = start + size diff --git a/proxyclient/m1n1/trace/asc.py b/proxyclient/m1n1/trace/asc.py index 4534947f..1d6f883e 100644 --- a/proxyclient/m1n1/trace/asc.py +++ b/proxyclient/m1n1/trace/asc.py @@ -139,6 +139,18 @@ class BaseASCTracer(ADTDevTracer): d = ">" if direction == DIR.TX else "<" self.log(f"{d}ep:{r1.EP:02x} {r0.value:016x} ({r0.str_fields()})") + def ioread(self, dva, size): + if self.dart: + return self.dart.ioread(0, dva & 0xFFFFFFFF, size) + else: + return self.hv.iface.readmem(dva, size) + + def iowrite(self, dva, data): + if self.dart: + return self.dart.iowrite(0, dva & 0xFFFFFFFF, data) + else: + return self.hv.iface.writemem(dva, data) + def start(self, dart=None): super().start() self.dart = dart @@ -226,15 +238,13 @@ class Syslog(EP): @msg(1, DIR.TX, Syslog_GetBuf) def GetBuf_Ack(self, msg): - self.state.syslog_buf = msg.DVA & 0xffffffff + self.state.syslog_buf = msg.DVA @msg(5, DIR.RX, Syslog_Log) def Log(self, msg): - if self.tracer.dart is None: - return False buf = self.state.syslog_buf stride = 0x20 + self.state.entrysize - log = self.tracer.dart.ioread(0, buf + msg.INDEX * stride, stride) + log = self.tracer.ioread(buf + msg.INDEX * stride, stride) hdr, unk, context, logmsg = struct.unpack(f"