mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
using lzc instead of priority_encoder
This commit is contained in:
parent
2a27bfbfd5
commit
e494860f38
4 changed files with 30 additions and 36 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
26
hw/rtl/cache/VX_miss_resrv.v
vendored
26
hw/rtl/cache/VX_miss_resrv.v
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue