2015-05-03 23:19:40 -04:00
|
|
|
/* Simple combinatorial priority arbiter
|
|
|
|
* (lowest position has highest priority)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-11-30 13:45:49 -05:00
|
|
|
module oh_arbiter_static(/*AUTOARG*/
|
2015-05-03 23:19:40 -04:00
|
|
|
// Outputs
|
|
|
|
grant, await,
|
|
|
|
// Inputs
|
|
|
|
request
|
|
|
|
);
|
|
|
|
|
|
|
|
parameter ARW=99;
|
|
|
|
|
|
|
|
input [ARW-1:0] request; //request vector
|
|
|
|
output [ARW-1:0] grant; //grant (one hot)
|
2015-11-16 09:58:47 -05:00
|
|
|
output [ARW-1:0] await; //wait mask!
|
2015-05-03 23:19:40 -04:00
|
|
|
|
|
|
|
genvar j;
|
|
|
|
assign await[0] = 1'b0;
|
|
|
|
generate for (j=ARW-1; j>=1; j=j-1) begin : gen_arbiter
|
|
|
|
assign await[j] = |request[j-1:0];
|
|
|
|
end
|
|
|
|
endgenerate
|
|
|
|
|
|
|
|
//grant circuit
|
|
|
|
assign grant[ARW-1:0] = request[ARW-1:0] & ~await[ARW-1:0];
|
|
|
|
|
2015-11-30 13:45:49 -05:00
|
|
|
endmodule // oh_arbiter_priority
|
|
|
|
|
2015-05-03 23:19:40 -04:00
|
|
|
|