m1n1.agx: Logging updates

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2022-06-19 03:49:11 +09:00
parent 610f3e6a11
commit f829afcf80
5 changed files with 9 additions and 6 deletions

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
import bisect
import bisect, time
from .object import GPUObject, GPUAllocator
from .initdata import build_initdata
@ -19,6 +19,7 @@ class AGX:
PAGE_SIZE = 0x4000
def __init__(self, u):
self.start_time = time.time()
self.u = u
self.p = u.proxy
@ -184,4 +185,5 @@ class AGX:
self.asc.work()
def log(self, msg):
print("[AGX] " + msg)
t = time.time() - self.start_time
print(f"[AGX][{t:10.03f}] " + msg)

View file

@ -59,7 +59,7 @@ class GPUCmdQueueChannel(GPUTXChannel):
msg.event_number = event
msg.new_queue = 1 if queue.first_time else 0
queue.first_time = False
print(msg)
#print(msg)
self.send_message(msg)
class GPUDeviceControlChannel(GPUTXChannel):

View file

@ -56,7 +56,7 @@ class GPUContext:
#if isinstance(obj.val, ConstructClassBase):
#obj.val._addr = obj._addr
print(f"[Context@{self.gpu_context._addr}] Map {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
self.agx.log(f"[Context@{self.gpu_context._addr}] Map {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
self.agx.uat.iomap_at(self.ctx, obj._addr, obj._paddr, size_align, **flags)
self.objects[obj._addr] = obj

View file

@ -131,5 +131,5 @@ def build_initdata(agx):
initdata.push()
print(initdata.val)
#print(initdata.val)
return initdata

View file

@ -149,7 +149,8 @@ class GPUAllocator:
self.objects[obj._addr] = obj
print(f"[{self.name}] Alloc {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
if self.verbose:
self.agx.log(f"[{self.name}] Alloc {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
self.agx.reg_object(obj, track=track)
return obj