Skip to content

Commit b0d7e45

Browse files
committed
update
1 parent 8a0d19c commit b0d7e45

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

hw/rtl/core/VX_opc_unit.sv

+14-14
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module VX_opc_unit import VX_gpu_pkg::*; #(
3131
input reg [`UP(`NUM_OPCS-1)-1:0][NUM_REGS-1:0] pending_regs_in,
3232

3333
output wire [ISSUE_WIS_W-1:0] pending_wis,
34-
output reg [NUM_REGS-1:0] pending_regs,
34+
output wire [NUM_REGS-1:0] pending_regs,
3535

3636
VX_scoreboard_if.slave scoreboard_if,
3737
VX_gpr_if.master gpr_if,
@@ -59,10 +59,8 @@ module VX_opc_unit import VX_gpu_pkg::*; #(
5959
wire [SIMD_IDX_W-1:0] simd_pid;
6060
wire simd_sop, simd_eop;
6161

62-
VX_elastic_buffer #(
63-
.DATAW (SCB_DATAW),
64-
.SIZE (2),
65-
.OUT_REG (1)
62+
VX_pipe_buffer #(
63+
.DATAW (SCB_DATAW)
6664
) stanging_buf (
6765
.clk (clk),
6866
.reset (reset),
@@ -185,28 +183,30 @@ module VX_opc_unit import VX_gpu_pkg::*; #(
185183

186184
// output pending reqs
187185
assign pending_wis = staging_if.data.wis;
186+
reg [NUM_REGS-1:0] pending_regs_r;
188187
always @(*) begin
189-
pending_regs = '0;
188+
pending_regs_r = '0;
190189
for (integer i = 0; i < NUM_SRC_OPDS; ++i) begin
191-
if (opds_busy[i]) begin
192-
pending_regs[src_regs[i]] = 1;
190+
if (staging_if.data.used_rs[i]) begin
191+
pending_regs_r[src_regs[i]] = staging_if.valid;
193192
end
194193
end
195194
end
195+
assign pending_regs = pending_regs_r;
196196

197197
// WAR dependency check
198-
reg [NUM_REGS-1:0] opc_pending_regs;
198+
reg [NUM_REGS-1:0] other_pending_regs;
199199
always @(*) begin
200-
opc_pending_regs = '0;
200+
other_pending_regs = '0;
201201
for (integer i = 0; i < `NUM_OPCS-1; ++i) begin
202-
opc_pending_regs |= pending_regs_in[i] & {NUM_REGS{pending_wis_in[i] == staging_if.data.wis}};
202+
other_pending_regs = other_pending_regs | pending_regs_in[i] & {NUM_REGS{staging_if.data.wis == pending_wis_in[i]}};
203203
end
204204
end
205-
wire war_dp_check = (opc_pending_regs[rd] == 0);
205+
wire war_dp_check = staging_if.data.wb && (other_pending_regs[rd] != 0);
206206

207207
wire output_ready_w;
208-
assign output_ready = output_ready_w && war_dp_check;
209-
wire output_valid = (state == STATE_DISPATCH) && war_dp_check;
208+
assign output_ready = output_ready_w && ~war_dp_check;
209+
wire output_valid = (state == STATE_DISPATCH) && ~war_dp_check;
210210

211211
// simd iterator
212212
VX_nz_iterator #(

0 commit comments

Comments
 (0)