Cleanup before integration

This commit is contained in:
felsabbagh3
2019-10-22 03:03:17 -04:00
parent b3f464dd89
commit 1bfafca896
11 changed files with 171 additions and 81 deletions

View File

@@ -0,0 +1,22 @@
module VX_generic_priority_encoder
#(
parameter N = 1
)
(
input wire[N-1:0] valids,
output reg[$clog2(N)-1:0] index,
output reg found
);
integer i;
always @(*) begin
index = 0;
found = 0;
for (i = `NW-1; i >= 0; i = i - 1) begin
if (valids[i]) begin
index = i[$clog2(N)-1:0];
found = 1;
end
end
end
endmodule