From 45d86b26a2d32f6fdec33ec9a9be5df1f850f057 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Thu, 16 May 2024 22:15:01 -0700 Subject: [PATCH] tensor: Add counter for dpu operations --- hw/rtl/core/VX_tensor_core.sv | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/rtl/core/VX_tensor_core.sv b/hw/rtl/core/VX_tensor_core.sv index 29bfb98c..e37f5016 100644 --- a/hw/rtl/core/VX_tensor_core.sv +++ b/hw/rtl/core/VX_tensor_core.sv @@ -400,5 +400,19 @@ module VX_tensor_octet #( .ready_out (result_ready), .valid_out (result_valid) ); + +`ifdef PERF_ENABLE + logic [`PERF_CTR_BITS-1:0] perf_tensor_dpu_total; + + always @(posedge clk) begin + if (reset) begin + perf_tensor_dpu_total <= '0; + end else begin + if (do_hmma) begin + perf_tensor_dpu_total <= perf_tensor_dpu_total + 1'b1; + end + end + end +`endif endmodule `endif