diff options
author | William Isaksson <william.isaksson@arm.com> | 2024-02-10 15:54:44 +0100 |
---|---|---|
committer | tim.hall <tim.hall@arm.com> | 2024-04-02 16:12:23 +0000 |
commit | e4d2f218fbdba4aa58380e9dfc42688330a70512 (patch) | |
tree | 01d29fbd35fdb81c7bd9b965d1f9673b9be74865 | |
parent | f697eac94d8d391fbe6fafac9c5b460ffae4cef6 (diff) | |
download | ethos-u-vela-e4d2f218fbdba4aa58380e9dfc42688330a70512.tar.gz |
MLBEDSW-8672: Add ext_key tracking
- Add ext_key tracking.
- Fix debug db cmd offsets being off by 4.
Change-Id: Ib109a15a0a2c44d08021c3b1bc3bcc067240ac5c
Signed-off-by: William Isaksson <william.isaksson@arm.com>
-rw-r--r-- | ethosu/vela/debug_database.py | 4 | ||||
-rw-r--r-- | ethosu/vela/register_command_stream_generator.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ethosu/vela/debug_database.py b/ethosu/vela/debug_database.py index ac4ef17..597f841 100644 --- a/ethosu/vela/debug_database.py +++ b/ethosu/vela/debug_database.py @@ -34,7 +34,7 @@ class DebugDatabase: SOURCE_TABLE = "source" _sourceUID: Dict[Any, int] = {} - _sourceHeaders = ["id", "operator", "kernel_w", "kernel_h", "ofm_w", "ofm_h", "ofm_d"] + _sourceHeaders = ["id", "operator", "kernel_w", "kernel_h", "ofm_w", "ofm_h", "ofm_d", "ext_key"] _sourceTable: List[List[Union[float, int, str]]] = [] OPTIMISED_TABLE = "optimised" @@ -58,7 +58,7 @@ class DebugDatabase: cls._sourceUID[op] = uid ofm_shape = numeric_util.full_shape(3, op.outputs[0].shape, 1) cls._sourceTable.append( - [uid, str(op.type), op.kernel.width, op.kernel.height, ofm_shape[-2], ofm_shape[-3], ofm_shape[-1]] + [uid, str(op.type), op.kernel.width, op.kernel.height, ofm_shape[-2], ofm_shape[-3], ofm_shape[-1], op.op_index] ) # Ops are added when their type changes, and after optimisation. If an op was already diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index e208e8d..0165469 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -1095,7 +1095,9 @@ def generate_command_stream( # Generate the actual NPU_OP command generate_operation_code(emit, npu_op) if add_to_debug_db is not None: - add_to_debug_db(npu_op, emit.offset) + if not isinstance(npu_op, NpuDmaOperation): + # Subtraction by 4 is to account for that offsets are pre-incremented. + add_to_debug_db(npu_op, emit.offset - 4) # Fill in final part of command stream: emit.cmd_do_operation(cmd0.NPU_OP_STOP, param=0xFFFF) res = emit.to_list() |