/*
|
/*
|
Asynchronous SDM NoC
|
Asynchronous SDM NoC
|
(C)2011 Wei Song
|
(C)2011 Wei Song
|
Advanced Processor Technologies Group
|
Advanced Processor Technologies Group
|
Computer Science, the Univ. of Manchester, UK
|
Computer Science, the Univ. of Manchester, UK
|
|
|
Authors:
|
Authors:
|
Wei Song wsong83@gmail.com
|
Wei Song wsong83@gmail.com
|
|
|
License: LGPL 3.0 or later
|
License: LGPL 3.0 or later
|
|
|
M-to-1 asynchronous multi-way MUTEX arbiter.
|
M-to-1 asynchronous multi-way MUTEX arbiter.
|
|
|
History:
|
History:
|
24/05/2009 Initial version. <wsong83@gmail.com>
|
24/05/2009 Initial version. <wsong83@gmail.com>
|
23/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
23/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
|
|
*/
|
*/
|
|
|
module mutex_arb (/*AUTOARG*/
|
module mutex_arb (/*AUTOARG*/
|
// Outputs
|
// Outputs
|
gnt,
|
gnt,
|
// Inputs
|
// Inputs
|
req
|
req
|
);
|
);
|
|
|
parameter wd = 4; // the number of request inputs
|
parameter wd = 4; // the number of request inputs
|
|
|
input [wd-1:0] req;
|
input [wd-1:0] req;
|
output [wd-1:0] gnt;
|
output [wd-1:0] gnt;
|
|
|
genvar i,j;
|
genvar i,j;
|
|
|
wire [wd-1:0] arb_w [wd-1:0];
|
wire [wd-1:0] arb_w [wd-1:0];
|
wire [wd-1:0] gnt;
|
wire [wd-1:0] gnt;
|
|
|
generate
|
generate
|
for(i=0; i<wd; i=i+1) begin:lv
|
for(i=0; i<wd; i=i+1) begin:lv
|
for(j=i+1; j<wd; j=j+1) begin:b
|
for(j=i+1; j<wd; j=j+1) begin:b
|
mutex ME ( .a(arb_w[i][j-1]), .b(arb_w[j][i]), .qa(arb_w[i][j]), .qb(arb_w[j][i+1]));
|
mutex2 ME ( .a(arb_w[i][j-1]), .b(arb_w[j][i]), .qa(arb_w[i][j]), .qb(arb_w[j][i+1]));
|
end
|
end
|
assign arb_w[i][0] = req[i];
|
assign arb_w[i][0] = req[i];
|
assign gnt[i] = arb_w[i][wd-1];
|
assign gnt[i] = arb_w[i][wd-1];
|
end
|
end
|
endgenerate
|
endgenerate
|
|
|
endmodule // mutex_arb
|
endmodule // mutex_arb
|
|
|
|
|