pulp-platform / common_cells

Common SystemVerilog components
Other
488 stars 138 forks source link

Simplify popcount and add proper support for all input widths #188

Closed meggiman closed 1 year ago

meggiman commented 1 year ago

The popcount implementation so far used a recursive implementation using a binary adder tree. However, experiments using reasonably modern synthesis tools show that the logic optimization heuristics achieve the same or better results in less compilation time when the popcount logic is described in a flat for loop instead of nested modules. While simplifying the popcount implementation, this change also fixes #187