adding stream arbiter
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
`include "VX_platform.vh"
|
||||
|
||||
module VX_priority_encoder #(
|
||||
parameter N = 1
|
||||
parameter N = 1,
|
||||
parameter LOGN = `LOG2UP(N)
|
||||
) (
|
||||
input wire [N-1:0] data_in,
|
||||
output wire [`LOG2UP(N)-1:0] data_out,
|
||||
output wire valid_out
|
||||
input wire [N-1:0] data_in,
|
||||
output wire [LOGN-1:0] data_out,
|
||||
output wire valid_out
|
||||
);
|
||||
reg [`LOG2UP(N)-1:0] data_out_r;
|
||||
|
||||
@@ -13,7 +14,7 @@ module VX_priority_encoder #(
|
||||
data_out_r = 0;
|
||||
for (integer i = 0; i < N; i++) begin
|
||||
if (data_in[i]) begin
|
||||
data_out_r = `LOG2UP(N)'(i);
|
||||
data_out_r = LOGN'(i);
|
||||
break;
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user