From c87fea5c483f7649ccea3698f24c427202d40f09 Mon Sep 17 00:00:00 2001 From: abnerhexu Date: Wed, 27 May 2026 09:07:47 +0800 Subject: [PATCH] Keep masked barriers local under cluster gbar --- hw/rtl/core/VX_tensor_ctrl_unit.sv | 2 +- hw/rtl/core/VX_wctl_unit.sv | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/rtl/core/VX_tensor_ctrl_unit.sv b/hw/rtl/core/VX_tensor_ctrl_unit.sv index 50f47095..e70c0f1d 100644 --- a/hw/rtl/core/VX_tensor_ctrl_unit.sv +++ b/hw/rtl/core/VX_tensor_ctrl_unit.sv @@ -91,7 +91,7 @@ module VX_tensor_ctrl_unit import VX_gpu_pkg::*; #( assign barrier.id = req_rs1_data[`NB_WIDTH-1:0]; `ifdef GBAR_ENABLE `ifdef GBAR_CLUSTER_ENABLE - assign barrier.is_global = 1'b1; + assign barrier.is_global = is_bar_mask ? 1'b0 : 1'b1; `else assign barrier.is_global = req_rs1_data[31]; `endif diff --git a/hw/rtl/core/VX_wctl_unit.sv b/hw/rtl/core/VX_wctl_unit.sv index b0f64f72..8e946f16 100644 --- a/hw/rtl/core/VX_wctl_unit.sv +++ b/hw/rtl/core/VX_wctl_unit.sv @@ -113,9 +113,9 @@ module VX_wctl_unit import VX_gpu_pkg::*; #( assign barrier.id = rs1_data[`NB_WIDTH-1:0]; `ifdef GBAR_ENABLE `ifdef GBAR_CLUSTER_ENABLE - // all barriers are cluster-wide barriers, which is implemented by - // modifying the global barrier logic - assign barrier.is_global = 1'b1; + // Explicit warp masks are core-local; rs2 carries the mask, not a warp + // count for the cluster global-barrier protocol. + assign barrier.is_global = is_bar_mask ? 1'b0 : 1'b1; `else assign barrier.is_global = rs1_data[31]; `endif