mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
minor udpate
This commit is contained in:
parent
771a10ea0c
commit
9797c6c48a
2 changed files with 8 additions and 7 deletions
|
@ -40,17 +40,17 @@ module VX_cyclic_arbiter #(
|
|||
|
||||
localparam IS_POW2 = (1 << LOG_NUM_REQS) == NUM_REQS;
|
||||
|
||||
wire [LOG_NUM_REQS-1:0] grant_index_um;
|
||||
wire [LOG_NUM_REQS-1:0] grant_index_um, grant_index_ql;
|
||||
reg [LOG_NUM_REQS-1:0] grant_index_r;
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
grant_index_r <= '0;
|
||||
end else if (grant_valid && grant_ready) begin
|
||||
if (!IS_POW2 && grant_index == LOG_NUM_REQS'(NUM_REQS-1)) begin
|
||||
if (!IS_POW2 && grant_index_ql == LOG_NUM_REQS'(NUM_REQS-1)) begin
|
||||
grant_index_r <= '0;
|
||||
end else begin
|
||||
grant_index_r <= grant_index + LOG_NUM_REQS'(1);
|
||||
grant_index_r <= grant_index_ql + LOG_NUM_REQS'(1);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -64,8 +64,10 @@ module VX_cyclic_arbiter #(
|
|||
.valid_out (grant_valid)
|
||||
);
|
||||
|
||||
assign grant_index = requests[grant_index_r] ? grant_index_r : grant_index_um;
|
||||
assign grant_onehot = NUM_REQS'(1) << grant_index;
|
||||
assign grant_index_ql = requests[grant_index_r] ? grant_index_r : grant_index_um;
|
||||
|
||||
assign grant_index = grant_index_ql;
|
||||
assign grant_onehot = NUM_REQS'(1) << grant_index_ql;
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -65,11 +65,10 @@ module VX_priority_encoder #(
|
|||
) lzc (
|
||||
.data_in (reversed),
|
||||
.data_out (index_out),
|
||||
`UNUSED_PIN (valid_out)
|
||||
.valid_out(valid_out)
|
||||
);
|
||||
|
||||
assign onehot_out = scan_lo & {(~scan_lo[N-2:0]), 1'b1};
|
||||
assign valid_out = scan_lo[N-1];
|
||||
|
||||
end else if (MODEL == 2) begin
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue