minor update

This commit is contained in:
Blaise Tine 2024-05-01 23:57:14 -07:00
parent 1b2d9ed538
commit 68a3664a04
4 changed files with 12 additions and 15 deletions

View file

@ -57,7 +57,6 @@ module VX_schedule import VX_gpu_pkg::*; #(
wire schedule_ready;
// split/join
wire [`NUM_THREADS-1:0] split_tmask;
wire join_valid;
wire join_is_dvg;
wire join_is_else;
@ -138,7 +137,7 @@ module VX_schedule import VX_gpu_pkg::*; #(
// split handling
if (warp_ctl_if.valid && warp_ctl_if.split.valid) begin
if (warp_ctl_if.split.is_dvg) begin
thread_masks_n[warp_ctl_if.wid] = split_tmask;
thread_masks_n[warp_ctl_if.wid] = warp_ctl_if.split.then_tmask;
end
stalled_warps_n[warp_ctl_if.wid] = 0; // unlock warp
end
@ -296,7 +295,6 @@ module VX_schedule import VX_gpu_pkg::*; #(
.wid (warp_ctl_if.wid),
.split (warp_ctl_if.split),
.sjoin (warp_ctl_if.sjoin),
.split_tmask(split_tmask),
.join_valid (join_valid),
.join_is_dvg(join_is_dvg),
.join_is_else(join_is_else),

View file

@ -22,7 +22,6 @@ module VX_split_join import VX_gpu_pkg::*; #(
input wire [`NW_WIDTH-1:0] wid,
input split_t split,
input join_t sjoin,
output wire [`NUM_THREADS-1:0] split_tmask,
output wire join_valid,
output wire join_is_dvg,
output wire join_is_else,
@ -38,15 +37,8 @@ module VX_split_join import VX_gpu_pkg::*; #(
wire [`DV_STACK_SIZEW-1:0] ipdom_q_ptr [`NUM_WARPS-1:0];
wire ipdom_set [`NUM_WARPS-1:0];
wire [`CLOG2(`NUM_THREADS+1)-1:0] then_tmask_cnt, else_tmask_cnt;
`POP_COUNT(then_tmask_cnt, split.then_tmask);
`POP_COUNT(else_tmask_cnt, split.else_tmask);
wire then_first = (then_tmask_cnt >= else_tmask_cnt);
assign split_tmask = then_first ? split.then_tmask : split.else_tmask;
wire [`NUM_THREADS-1:0] ntaken_tmask = then_first ? split.else_tmask : split.then_tmask;
wire [(`XLEN+`NUM_THREADS)-1:0] ipdom_q0 = {split.then_tmask | split.else_tmask, `XLEN'(0)};
wire [(`XLEN+`NUM_THREADS)-1:0] ipdom_q1 = {ntaken_tmask, split.next_pc};
wire [(`XLEN+`NUM_THREADS)-1:0] ipdom_q1 = {split.else_tmask, split.next_pc};
wire sjoin_is_dvg = (sjoin.stack_ptr != ipdom_q_ptr[wid]);

View file

@ -96,10 +96,17 @@ module VX_wctl_unit import VX_gpu_pkg::*; #(
// split
wire [`CLOG2(`NUM_THREADS+1)-1:0] then_tmask_cnt, else_tmask_cnt;
`POP_COUNT(then_tmask_cnt, then_tmask_n);
`POP_COUNT(else_tmask_cnt, else_tmask_n);
wire then_first = (then_tmask_cnt >= else_tmask_cnt);
wire [`NUM_THREADS-1:0] taken_tmask = then_first ? then_tmask_n : else_tmask_n;
wire [`NUM_THREADS-1:0] ntaken_tmask = then_first ? else_tmask_n : then_tmask_n;
assign split.valid = is_split;
assign split.is_dvg = has_then && has_else;
assign split.then_tmask = then_tmask_n;
assign split.else_tmask = else_tmask_n;
assign split.then_tmask = taken_tmask;
assign split.else_tmask = ntaken_tmask;
assign split.next_pc = execute_if.data.PC + 4;
assign warp_ctl_if.dvstack_wid = execute_if.data.wid;

View file

@ -388,7 +388,7 @@ void kernel_gbar(int task_id, kernel_arg_t* __UNIFORM__ arg) {
// update destination using the first thread in processor
if (cid == 0 && wid == 0 && tid == 0) {
for (int i = 0, n = arg->num_tasks; i <= n; ++i) {
for (int i = 0, n = arg->num_tasks; i < n; ++i) {
dst_ptr[i] = src0_ptr[i];
}
}