top.matmul_full_width_test
UVMError: MATMUL_FULL_WIDTH: MATMUL with dim_n==COLS(16) status=STAT_BAD_DIM, w…
Attempts (2)
Attempt 1 of 2 Sent back for more evidence
- Searched the design spec for expected behavior (
MATMUL command dim_n COLS validation) - Searched the design spec for expected behavior (
STAT_BAD_DIM error condition) - Searched the design graph (
STAT_BAD_DIM) - Searched the design graph (
CMD_MATMUL) - Searched the design graph (
scheduler) - Searched the design graph (
cmd_proc) - Inspected the module instance hierarchy (
tpe_scheduler__R10_C10) - Searched the design graph (
dim_n) - Searched the design graph (
BAD_DIM) - Searched the design graph (
status) - Searched the design graph (
decode) - Traced the signal's driver (
status_q)
rtl/scheduler/tpe_scheduler.sv:1Insufficient evidence gathered yet to pinpoint exact lines; need to read rtl/scheduler/tpe_scheduler.sv around line 97 (the always block driving status_q) to find the dim_n comparison against COLS that incorrectly rejects dim_n==16 (should be <= COLS, not < COLS). This is a placeholder pending actual source read.
Retrieved evidence (12 steps)
-
Step 1: Searched the design spec for expected behavior (
MATMUL command dim_n COLS validation)(no spec sections matched 'MATMUL command dim_n COLS validation')
-
Step 2: Searched the design spec for expected behavior (
STAT_BAD_DIM error condition)(no spec sections matched 'STAT_BAD_DIM error condition')
-
Step 3: Searched the design graph (
STAT_BAD_DIM)(no matches)
-
Step 4: Searched the design graph (
CMD_MATMUL)(no matches)
-
Step 5: Searched the design graph (
scheduler)- Instance:u_scheduler (id=instance:tpe_top.u_scheduler, module=None) - Module:tpe_scheduler__R10_C10 (id=module:tpe_scheduler__R10_C10, module=None)
-
Step 6: Searched the design graph (
cmd_proc)- Instance:u_cmd_proc (id=instance:tpe_top.u_cmd_proc, module=None) - Module:tpe_cmd_proc (id=module:tpe_cmd_proc, module=None)
-
Step 7: Inspected the module instance hierarchy (
tpe_scheduler__R10_C10){"module": {"name": "tpe_scheduler__R10_C10", "orig_name": "tpe_scheduler", "level": 2, "is_top": false, "node_type": "Module", "id": "module:tpe_scheduler__R10_C10"}, "instances": []} -
Step 8: Searched the design graph (
dim_n)- Port:dim_n (id=port:matrix_engine__R10_C10_M100.dim_n, module=matrix_engine__R10_C10_M100) - Port:dim_n (id=port:matrix_engine_ctrl__pi1.dim_n, module=matrix_engine_ctrl__pi1) - Signal:me_dim_n (id=signal:tpe_top.me_dim_n, module=tpe_top) - Port:me_dim_n (id=port:tpe_scheduler__R10_C10.me_dim_n, module=tpe_scheduler__R10_C10) - Register:stg_dim_n_q (id=register:tpe_cmd_proc.stg_dim_n_q, module=tpe_cmd_proc)
-
Step 9: Searched the design graph (
BAD_DIM)(no matches)
-
Step 10: Searched the design graph (
status)- Signal:sched_done_status (id=signal:tpe_top.sched_done_status, module=tpe_top) - Port:sched_done_status (id=port:tpe_cmd_proc.sched_done_status, module=tpe_cmd_proc) - Port:sched_done_status (id=port:tpe_debug.sched_done_status, module=tpe_debug) - Port:sched_done_status (id=port:tpe_scheduler__R10_C10.sched_done_status, module=tpe_scheduler__R10_C10) - Register:status_q (id=register:tpe_scheduler__R10_C10.status_q, module=tpe_scheduler__R10_C10) - Signal:status_word (id=signal:tpe_cmd_proc.st
-
Step 11: Searched the design graph (
decode)(no matches)
-
Step 12: Traced the signal's driver (
status_q)- Assignment:assignment:tpe_scheduler__R10_C10.assign_680 inside AlwaysBlock:always:tpe_scheduler__R10_C10.always_666 [rtl/scheduler/tpe_scheduler.sv:97:3] - Assignment:assignment:tpe_scheduler__R10_C10.assign_682 inside AlwaysBlock:always:tpe_scheduler__R10_C10.always_666 [rtl/scheduler/tpe_scheduler.sv:97:3] - Assignment:assignment:tpe_scheduler__R10_C10.assign_684 inside AlwaysBlock:always:tpe_scheduler__R10_C10.always_666 [rtl/scheduler/tpe_scheduler.sv:97:3] - Assignment:assignment:tpe_sche
Attempt 2 of 2 Approved
- Searched the design spec for expected behavior (
MATMUL command dim_n COLS validation) - Searched the design spec for expected behavior (
STAT_BAD_DIM error condition) - Searched the design graph (
STAT_BAD_DIM) - Searched the design graph (
CMD_MATMUL) - Searched the design graph (
scheduler) - Searched the design graph (
cmd_proc) - Inspected the module instance hierarchy (
tpe_scheduler__R10_C10) - Searched the design graph (
dim_n) - Searched the design graph (
BAD_DIM) - Searched the design graph (
status) - Searched the design graph (
decode) - Traced the signal's driver (
status_q) - Read the RTL source (
rtl/scheduler/tpe_scheduler.sv) - Read the RTL source (
rtl/scheduler/tpe_scheduler.sv) - Read the RTL source (
rtl/scheduler/tpe_scheduler.sv) - Searched the design spec for expected behavior (
MATMUL dimension constraints) - Searched the design spec for expected behavior (
dim_n dim_k ROWS COLS) - Searched the design spec for expected behavior (
matrix engine dimensions) - Searched the design graph (
matrix_engine)
rtl/scheduler/tpe_scheduler.sv:95The MATMUL dimension check in tpe_scheduler.sv used an inconsistent comparison for dim_n vs dim_k: dim_k is validated with '<=' (allowing dim_k == ROWS) while dim_n was validated with strict '<' (disallowing dim_n == COLS). The failing test issues a MATMUL with dim_n == COLS (16), which is a legal full-width matmul, but dim_n < COLS evaluates false, causing dim_ok_for_matmul to be false and status_q to be set to STAT_BAD_DIM instead of STAT_OK. Changing the dim_n comparison to '<=' makes the boundary condition consistent with dim_k and allows dim_n == COLS, matching the expected STAT_OK behavior for a full-width matmul.
Retrieved evidence (19 steps)
-
Step 1: Searched the design spec for expected behavior (
MATMUL command dim_n COLS validation)(no spec sections matched 'MATMUL command dim_n COLS validation')
-
Step 2: Searched the design spec for expected behavior (
STAT_BAD_DIM error condition)(no spec sections matched 'STAT_BAD_DIM error condition')
-
Step 3: Searched the design graph (
STAT_BAD_DIM)(no matches)
-
Step 4: Searched the design graph (
CMD_MATMUL)(no matches)
-
Step 5: Searched the design graph (
scheduler)- Instance:u_scheduler (id=instance:tpe_top.u_scheduler, module=None) - Module:tpe_scheduler__R10_C10 (id=module:tpe_scheduler__R10_C10, module=None)
-
Step 6: Searched the design graph (
cmd_proc)- Instance:u_cmd_proc (id=instance:tpe_top.u_cmd_proc, module=None) - Module:tpe_cmd_proc (id=module:tpe_cmd_proc, module=None)
-
Step 7: Inspected the module instance hierarchy (
tpe_scheduler__R10_C10){"module": {"name": "tpe_scheduler__R10_C10", "orig_name": "tpe_scheduler", "level": 2, "is_top": false, "node_type": "Module", "id": "module:tpe_scheduler__R10_C10"}, "instances": []} -
Step 8: Searched the design graph (
dim_n)- Port:dim_n (id=port:matrix_engine__R10_C10_M100.dim_n, module=matrix_engine__R10_C10_M100) - Port:dim_n (id=port:matrix_engine_ctrl__pi1.dim_n, module=matrix_engine_ctrl__pi1) - Signal:me_dim_n (id=signal:tpe_top.me_dim_n, module=tpe_top) - Port:me_dim_n (id=port:tpe_scheduler__R10_C10.me_dim_n, module=tpe_scheduler__R10_C10) - Register:stg_dim_n_q (id=register:tpe_cmd_proc.stg_dim_n_q, module=tpe_cmd_proc)
-
Step 9: Searched the design graph (
BAD_DIM)(no matches)
-
Step 10: Searched the design graph (
status)- Signal:sched_done_status (id=signal:tpe_top.sched_done_status, module=tpe_top) - Port:sched_done_status (id=port:tpe_cmd_proc.sched_done_status, module=tpe_cmd_proc) - Port:sched_done_status (id=port:tpe_debug.sched_done_status, module=tpe_debug) - Port:sched_done_status (id=port:tpe_scheduler__R10_C10.sched_done_status, module=tpe_scheduler__R10_C10) - Register:status_q (id=register:tpe_scheduler__R10_C10.status_q, module=tpe_scheduler__R10_C10) - Signal:status_word (id=signal:tpe_cmd_proc.st
-
Step 11: Searched the design graph (
decode)(no matches)
-
Step 12: Traced the signal's driver (
status_q)- Assignment:assignment:tpe_scheduler__R10_C10.assign_680 inside AlwaysBlock:always:tpe_scheduler__R10_C10.always_666 [rtl/scheduler/tpe_scheduler.sv:97:3] - Assignment:assignment:tpe_scheduler__R10_C10.assign_682 inside AlwaysBlock:always:tpe_scheduler__R10_C10.always_666 [rtl/scheduler/tpe_scheduler.sv:97:3] - Assignment:assignment:tpe_scheduler__R10_C10.assign_684 inside AlwaysBlock:always:tpe_scheduler__R10_C10.always_666 [rtl/scheduler/tpe_scheduler.sv:97:3] - Assignment:assignment:tpe_sche
-
Step 13: Read the RTL source (
rtl/scheduler/tpe_scheduler.sv)--- rtl/scheduler/tpe_scheduler.sv (lines 77-117 of 246) --- 77: ST_DISPATCH_ME, 78: ST_WAIT_ME, 79: ST_COMPLETE 80: } state_e; 81: 82: state_e state_q, state_d; 83: 84: tpe_command_t cmd_q; 85: cmd_status_e status_q; 86: 87: localparam logic [1:0] RouterWeight = 2'd0; 88: localparam logic [1:0] RouterAct = 2'd1; 89: localparam logic [1:0] RouterSeed = 2'd2; 90: localparam logic [1:0] RouterOut = 2'd3; 91: 92: logi
-
Step 14: Read the RTL source (
rtl/scheduler/tpe_scheduler.sv)--- rtl/scheduler/tpe_scheduler.sv (lines 117-180 of 246) --- 117: 118: unique case (cmd_q.opcode) 119: CMD_NOP, CMD_BARRIER, CMD_IRQ_TEST: status_q <= STAT_OK; 120: CMD_MATMUL: status_q <= dim_ok_for_matmul ? STAT_OK : STAT_BAD_DIM; 121: CMD_LOAD_WEIGHT, CMD_LOAD_ACT, CMD_STORE: status_q <= STAT_OK; 122: default: status_q <= STAT_BAD_OPCODE; 123: endcase 124: end else if (state_q == ST_WAIT_DMA && dma_done) begin 1
-
Step 15: Read the RTL source (
rtl/scheduler/tpe_scheduler.sv)--- rtl/scheduler/tpe_scheduler.sv (lines 1-50 of 246) --- 1: // Instruction Scheduler: pops commands from the Command Processor's FIFO 2: // and dispatches them to the DMA Engine or Matrix Compute Engine, per 3: // docs/architecture/tpe_architecture_spec.md section 3.2. 4: // 5: // V1 simplification (matches the roadmap's own "V2: improved scheduler" 6: // item): this is a *sequential* dispatcher, not an out-of-order/overlapped 7: // arbiter -- one command executes f -
Step 16: Searched the design spec for expected behavior (
MATMUL dimension constraints)(no spec sections matched 'MATMUL dimension constraints')
-
Step 17: Searched the design spec for expected behavior (
dim_n dim_k ROWS COLS)(no spec sections matched 'dim_n dim_k ROWS COLS')
-
Step 18: Searched the design spec for expected behavior (
matrix engine dimensions)(no spec sections matched 'matrix engine dimensions')
-
Step 19: Searched the design graph (
matrix_engine)- Instance:u_matrix_engine (id=instance:tpe_top.u_matrix_engine, module=None) - Module:matrix_engine_ctrl__pi1 (id=module:matrix_engine_ctrl__pi1, module=None) - Module:matrix_engine__R10_C10_M100 (id=module:matrix_engine__R10_C10_M100, module=None)
Proposed patch
--- a/rtl/scheduler/tpe_scheduler.sv
+++ b/rtl/scheduler/tpe_scheduler.sv
@@ -92,7 +92,7 @@
logic [1:0] router_sel_q;
assign router_sel = router_sel_q;
- wire dim_ok_for_matmul = (cmd_q.dim_k <= TILE_DIM_WIDTH'(ROWS)) && (cmd_q.dim_n < TILE_DIM_WIDTH'(COLS));
+ wire dim_ok_for_matmul = (cmd_q.dim_k <= TILE_DIM_WIDTH'(ROWS)) && (cmd_q.dim_n <= TILE_DIM_WIDTH'(COLS));
always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n) begin