using lzc instead of priority_encoder

This commit is contained in:
Blaise Tine 2021-08-26 07:29:47 -07:00
parent 2a27bfbfd5
commit e494860f38
4 changed files with 30 additions and 36 deletions

View file

@ -26,13 +26,12 @@ module VX_instr_demux (
`endif
wire gpu_req_ready;
VX_priority_encoder #(
.N (`NUM_THREADS)
VX_lzc #(
.WIDTH (`NUM_THREADS)
) tid_select (
.data_in (ibuffer_if.tmask),
.index (tid),
`UNUSED_PIN (onehot),
`UNUSED_PIN (valid_out)
.in_i (ibuffer_if.tmask),
.cnt_o (tid),
`UNUSED_PIN (valid_o)
);
wire [31:0] next_PC = ibuffer_if.PC + 4;

View file

@ -30,7 +30,7 @@ module VX_warp_sched #(
reg [`NUM_WARPS-1:0] stalled_warps; // asserted when a branch/gpgpu instructions are issued
reg [`NUM_WARPS-1:0][`NUM_THREADS-1:0] thread_masks;
reg [`NUM_WARPS-1:0][31:0] warp_pcs, warp_next_pcs;
reg [`NUM_WARPS-1:0][31:0] warp_pcs;
// barriers
reg [`NUM_BARRIERS-1:0][`NUM_WARPS-1:0] barrier_masks; // warps waiting on barrier
@ -121,12 +121,11 @@ module VX_warp_sched #(
end
if (ifetch_req_fire) begin
warp_next_pcs[ifetch_req_if.wid] <= ifetch_req_if.PC + 4;
warp_pcs[ifetch_req_if.wid] <= ifetch_req_if.PC + 4;
end
if (wstall_if.valid) begin
stalled_warps[wstall_if.wid] <= wstall_if.stalled;
warp_pcs[wstall_if.wid] <= warp_next_pcs[wstall_if.wid];
end
// join handling
@ -200,13 +199,12 @@ module VX_warp_sched #(
wire [`NUM_WARPS-1:0] ready_warps = active_warps & ~(stalled_warps | barrier_stalls);
VX_priority_encoder #(
.N (`NUM_WARPS)
) pri_enc (
.data_in (ready_warps),
.index (schedule_wid),
.valid_out (schedule_valid),
`UNUSED_PIN (onehot)
VX_lzc #(
.WIDTH (`NUM_WARPS)
) wid_select (
.in_i (ready_warps),
.cnt_o (schedule_wid),
.valid_o (schedule_valid)
);
wire [`NUM_WARPS-1:0][(`NUM_THREADS + 32)-1:0] schedule_data;

View file

@ -102,22 +102,20 @@ module VX_miss_resrv #(
end
end
VX_priority_encoder #(
.N (MSHR_SIZE)
) dequeue_pe (
.data_in (valid_table_x & ready_table_x),
.index (dequeue_id_x),
.valid_out (dequeue_val_x),
`UNUSED_PIN (onehot)
VX_lzc #(
.WIDTH (MSHR_SIZE)
) dequeue_sel (
.in_i (valid_table_x & ready_table_x),
.cnt_o (dequeue_id_x),
.valid_o (dequeue_val_x)
);
VX_priority_encoder #(
.N (MSHR_SIZE)
) allocate_pe (
.data_in (~valid_table_n),
.index (allocate_id_n),
.valid_out (allocate_rdy_n),
`UNUSED_PIN (onehot)
VX_lzc #(
.WIDTH (MSHR_SIZE)
) allocate_sel (
.in_i (~valid_table_n),
.cnt_o (allocate_id_n),
.valid_o (allocate_rdy_n)
);
always @(*) begin

View file

@ -29,13 +29,12 @@ module VX_index_buffer #(
wire free_valid;
wire [ADDRW-1:0] free_index;
VX_priority_encoder #(
.N (SIZE)
VX_lzc #(
.WIDTH (SIZE)
) free_slots_encoder (
.data_in (free_slots_n),
.index (free_index),
`UNUSED_PIN (onehot),
.valid_out (free_valid)
.in_i (free_slots_n),
.cnt_o (free_index),
.valid_o (free_valid)
);
always @(*) begin