From 8317a3fbe57e917653f6982b3db3d9a256313f2d Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Thu, 7 Mar 2024 17:39:18 -0800 Subject: [PATCH] Fix fence by disallowing x-initialization instead of all-0 mask Setting mem_req_mask to all-zero triggers an assertion error in mem_scheduler. Instead, disallow initialize-by-x in instruction decode which is the source of x-propagation. Since this seems to only happen in VCS, define-gate it accordingly. This reverts commit a15f4fd483591846ff7df0eb9ef3ca60f322b4b2. --- hw/rtl/core/VX_decode.sv | 8 ++++++++ hw/rtl/core/VX_lsu_unit.sv | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/rtl/core/VX_decode.sv b/hw/rtl/core/VX_decode.sv index e38b4c8c..aa18666f 100644 --- a/hw/rtl/core/VX_decode.sv +++ b/hw/rtl/core/VX_decode.sv @@ -148,13 +148,21 @@ module VX_decode #( always @(*) begin ex_type = '0; +`ifdef VCS + op_type = '0; +`else op_type = 'x; +`endif op_mod = '0; rd_r = '0; rs1_r = '0; rs2_r = '0; rs3_r = '0; +`ifdef VCS + imm = '0; +`else imm = 'x; +`endif use_imm = 0; use_PC = 0; use_rd = 0; diff --git a/hw/rtl/core/VX_lsu_unit.sv b/hw/rtl/core/VX_lsu_unit.sv index d823982c..5a57db4c 100644 --- a/hw/rtl/core/VX_lsu_unit.sv +++ b/hw/rtl/core/VX_lsu_unit.sv @@ -160,7 +160,7 @@ module VX_lsu_unit import VX_gpu_pkg::*; #( && (~mem_req_rw || st_rsp_ready); // writes commit directly for (genvar i = 0; i < NUM_LANES; ++i) begin - assign mem_req_mask[i] = is_fence ? 1'b0 : (execute_if[0].data.tmask[i] && (~lsu_is_dup || (i == 0))); + assign mem_req_mask[i] = execute_if[0].data.tmask[i] && (~lsu_is_dup || (i == 0)); end assign mem_req_rw = ~execute_if[0].data.wb;