Intrinsics: tests for TMC+Control Divergence
This commit is contained in:
@@ -60,15 +60,15 @@ module VX_execute_unit (
|
||||
endgenerate
|
||||
|
||||
|
||||
wire [$clog2(`NT)-1:0] branch_use_index;
|
||||
wire branch_found_valid;
|
||||
wire [$clog2(`NT)-1:0] jal_branch_use_index;
|
||||
wire jal_branch_found_valid;
|
||||
VX_generic_priority_encoder #(.N(`NT)) choose_alu_result(
|
||||
.valids(VX_exec_unit_req.valid),
|
||||
.index (branch_use_index),
|
||||
.found (branch_found_valid)
|
||||
.index (jal_branch_use_index),
|
||||
.found (jal_branch_found_valid)
|
||||
);
|
||||
|
||||
wire[31:0] branch_use_alu_result = alu_result[branch_use_index];
|
||||
wire[31:0] branch_use_alu_result = alu_result[jal_branch_use_index];
|
||||
|
||||
reg temp_branch_dir;
|
||||
always @(*)
|
||||
@@ -104,7 +104,7 @@ module VX_execute_unit (
|
||||
|
||||
// Jal rsp
|
||||
assign VX_jal_rsp.jal = in_jal;
|
||||
assign VX_jal_rsp.jal_dest = $signed(in_a_reg_data[0]) + $signed(in_jal_offset);
|
||||
assign VX_jal_rsp.jal_dest = $signed(in_a_reg_data[jal_branch_use_index]) + $signed(in_jal_offset);
|
||||
assign VX_jal_rsp.jal_warp_num = VX_exec_unit_req.warp_num;
|
||||
|
||||
// Branch rsp
|
||||
|
||||
@@ -57,6 +57,7 @@ module VX_fetch (
|
||||
|
||||
// Split
|
||||
.is_split (VX_warp_ctl.is_split),
|
||||
.dont_split (VX_warp_ctl.dont_split),
|
||||
.split_new_mask (VX_warp_ctl.split_new_mask),
|
||||
.split_later_mask (VX_warp_ctl.split_later_mask),
|
||||
.split_save_pc (VX_warp_ctl.split_save_pc),
|
||||
|
||||
@@ -71,7 +71,8 @@ module VX_gpgpu_inst (
|
||||
// wire[`NW_M1:0] num_valids = $countones(curr_valids);
|
||||
|
||||
|
||||
assign VX_warp_ctl.is_split = is_split && (num_valids > 1) && (split_new_use_mask != 0) && (split_new_use_mask != {`NT{1'b1}});
|
||||
assign VX_warp_ctl.is_split = is_split && (num_valids > 1);
|
||||
assign VX_warp_ctl.dont_split = VX_warp_ctl.is_split && ((split_new_use_mask == 0) || (split_new_use_mask == {`NT{1'b1}}));
|
||||
assign VX_warp_ctl.split_new_mask = split_new_use_mask;
|
||||
assign VX_warp_ctl.split_later_mask = split_new_later_mask;
|
||||
assign VX_warp_ctl.split_save_pc = VX_gpu_inst_req.pc_next;
|
||||
|
||||
@@ -29,6 +29,7 @@ module VX_warp_scheduler (
|
||||
|
||||
// Split
|
||||
input wire is_split,
|
||||
input wire dont_split,
|
||||
input wire[`NT_M1:0] split_new_mask,
|
||||
input wire[`NT_M1:0] split_later_mask,
|
||||
input wire[31:0] split_save_pc,
|
||||
@@ -104,6 +105,8 @@ module VX_warp_scheduler (
|
||||
|
||||
reg[`NW-1:0] total_barrier_stall;
|
||||
|
||||
reg didnt_split;
|
||||
|
||||
/* verilator lint_off UNUSED */
|
||||
// wire[$clog2(`NW):0] num_active;
|
||||
/* verilator lint_on UNUSED */
|
||||
@@ -122,6 +125,7 @@ module VX_warp_scheduler (
|
||||
visible_active[0] <= 1; // Activating first warp
|
||||
thread_masks[0] <= 1; // Activating first thread in first warp
|
||||
warp_stalled <= 0;
|
||||
didnt_split <= 0;
|
||||
// total_barrier_stall = 0;
|
||||
for (curr_w_help = 1; curr_w_help < `NW; curr_w_help=curr_w_help+1) begin
|
||||
warp_pcs[curr_w_help] <= 0;
|
||||
@@ -148,14 +152,20 @@ module VX_warp_scheduler (
|
||||
end else if (ctm) begin
|
||||
thread_masks[ctm_warp_num] <= ctm_mask;
|
||||
warp_stalled[ctm_warp_num] <= 0;
|
||||
end else if (is_join) begin
|
||||
end else if (is_join && !didnt_split) begin
|
||||
if (!join_fall) begin
|
||||
warp_pcs[join_warp_num] <= join_pc;
|
||||
end
|
||||
thread_masks[join_warp_num] <= join_tm;
|
||||
didnt_split <= 0;
|
||||
end else if (is_split) begin
|
||||
warp_stalled[split_warp_num] <= 0;
|
||||
thread_masks[split_warp_num] <= split_new_mask;
|
||||
if (!dont_split) begin
|
||||
thread_masks[split_warp_num] <= split_new_mask;
|
||||
didnt_split <= 0;
|
||||
end else begin
|
||||
didnt_split <= 1;
|
||||
end
|
||||
end
|
||||
|
||||
if (whalt) begin
|
||||
@@ -243,9 +253,9 @@ module VX_warp_scheduler (
|
||||
wire correct_warp_s = (curr_warp == split_warp_num);
|
||||
wire correct_warp_j = (curr_warp == join_warp_num);
|
||||
|
||||
wire push = is_split && correct_warp_s;
|
||||
wire push = (is_split && !dont_split) && correct_warp_s;
|
||||
wire pop = is_join && correct_warp_j;
|
||||
VX_generic_stack #(.WIDTH(1+32+`NT), .DEPTH($clog2(`NT))) ipdom_stack(
|
||||
VX_generic_stack #(.WIDTH(1+32+`NT), .DEPTH($clog2(`NT)+1)) ipdom_stack(
|
||||
.clk (clk),
|
||||
.reset(reset),
|
||||
.push (push),
|
||||
|
||||
19
rtl/cache/VX_Cache_Bank.v
vendored
19
rtl/cache/VX_Cache_Bank.v
vendored
@@ -149,6 +149,23 @@ module VX_Cache_Bank
|
||||
wire[31:0] lhu_data = (data_unQual & 32'hFFFF);
|
||||
wire[31:0] lw_data = (data_unQual);
|
||||
|
||||
|
||||
wire[31:0] sw_data = writedata;
|
||||
|
||||
wire[31:0] sb_data = b1 ? {{16{1'b0}}, writedata[7:0], { 8{1'b0}}} :
|
||||
b2 ? {{ 8{1'b0}}, writedata[7:0], {16{1'b0}}} :
|
||||
b3 ? {{ 0{1'b0}}, writedata[7:0], {24{1'b0}}} :
|
||||
writedata;
|
||||
|
||||
wire[31:0] sh_data = b2 ? {writedata[15:0], {16{1'b0}}} : writedata;
|
||||
|
||||
|
||||
|
||||
wire[31:0] use_write_data = sb ? sb_data :
|
||||
sh ? sh_data :
|
||||
sw_data;
|
||||
|
||||
|
||||
wire[31:0] data_Qual = lb ? lb_data :
|
||||
lh ? lh_data :
|
||||
lhu ? lhu_data :
|
||||
@@ -177,7 +194,7 @@ module VX_Cache_Bank
|
||||
|
||||
|
||||
// assign we[g] = (normal_write || (write_from_mem)) ? 1'b1 : 1'b0;
|
||||
assign data_write[g] = write_from_mem ? fetched_writedata[g] : writedata;
|
||||
assign data_write[g] = write_from_mem ? fetched_writedata[g] : use_write_data;
|
||||
assign way_to_update = write_from_mem ? evicted_way : update_way;
|
||||
end
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ interface VX_warp_ctl_inter ();
|
||||
wire[$clog2(`NW):0] num_warps;
|
||||
|
||||
wire is_split;
|
||||
wire dont_split;
|
||||
wire[`NW_M1:0] split_warp_num;
|
||||
wire[`NT_M1:0] split_new_mask;
|
||||
wire[`NT_M1:0] split_later_mask;
|
||||
|
||||
@@ -202,7 +202,7 @@ void io_handler(bool clk, bool io_valid, unsigned io_data)
|
||||
|
||||
void gracefulExit(int cycles)
|
||||
{
|
||||
fprintf(stderr, "\n*********************\n\n");
|
||||
fprintf(stderr, "*********************\n\n");
|
||||
fprintf(stderr, "DPI Cycle Num: %d\tVerilog Cycle Num: %d\n", num_cycles, cycles);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user