mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
fair arbiter optimization
This commit is contained in:
parent
32a882e26f
commit
8fb73b6da7
1 changed files with 3 additions and 4 deletions
|
@ -40,15 +40,14 @@ module VX_fair_arbiter #(
|
|||
|
||||
reg [NUM_REQS-1:0] reqs_mask;
|
||||
|
||||
wire [NUM_REQS-1:0] requests_rem = requests & reqs_mask;
|
||||
wire rem_valid = (| requests_rem);
|
||||
wire [NUM_REQS-1:0] requests_qual = rem_valid ? requests_rem : requests;
|
||||
wire [NUM_REQS-1:0] masked_reqs = requests & reqs_mask;
|
||||
wire [NUM_REQS-1:0] requests_qual = (| masked_reqs) ? masked_reqs : requests;
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
reqs_mask <= '1;
|
||||
end else if (grant_valid && grant_ready) begin
|
||||
reqs_mask <= rem_valid ? (reqs_mask & ~grant_onehot) : ~grant_onehot;
|
||||
reqs_mask <= (| reqs_mask) ? (reqs_mask & ~grant_onehot) : ~grant_onehot;
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue