quartus build fixes

This commit is contained in:
Blaise Tine
2020-08-23 22:04:46 -07:00
parent 1c9445745f
commit f292e5003d
27 changed files with 241 additions and 206 deletions

View File

@@ -2,18 +2,23 @@
`include "VX_platform.vh"
module VX_countones #(
parameter N = 10
parameter N = 10,
parameter N_BITS = $clog2(N+1)
) (
input wire [N-1:0] valids,
output reg [$clog2(N):0] count
input wire [N-1:0] valids,
output wire [N_BITS-1:0] count
);
reg [N_BITS-1:0] count_r;
always @(*) begin
count = 0;
count_r = 0;
for (integer i = N-1; i >= 0; i = i - 1) begin
if (valids[i]) begin
count = count + 1;
count_r = count_r + N_BITS'(1);
end
end
end
assign count = count_r;
endmodule