| Property | Value |
|---|---|
| Kind | module |
| RTL source | rtl/base/bit_ops.sv |
| Availability | Synthesizable RTL |
Combinational population-count primitive.
Combinational population-count primitive. It is a self-contained base primitive with the behavior and parameter checks implemented in the linked RTL source.
Use as a structured building block for control, encoding, ECC, hashing, masking, replacement, or observability logic.
The declaration below is canonical; retain the RTL-enforced parameter range.
| Parameter | Declaration |
|---|---|
WIDTH |
parameter int WIDTH = 32 |
COUNT_WIDTH |
parameter int COUNT_WIDTH = $clog2(WIDTH + 1) |
module bit_count #(
parameter int WIDTH = 32,
parameter int COUNT_WIDTH = $clog2(WIDTH + 1)
) (
input logic [ WIDTH-1:0] value_i,
output logic [COUNT_WIDTH-1:0] count_o
);| Signal | Direction | Declaration |
|---|---|---|
value_i |
input |
input logic [ WIDTH-1:0] value_i |
count_o |
output |
output logic [COUNT_WIDTH-1:0] count_o |
Honor validity/error outputs and parameter constraints. Combinational cells do not provide timing isolation or CDC protection.
bit_count #(
.WIDTH(WIDTH),
.COUNT_WIDTH(COUNT_WIDTH)
) u_bit_count (
.value_i(value_i),
.count_o(count_o)
);The linked RTL source is the implementation authority and contains local assertions for unsupported
parameter combinations. See docs/design.md for repository-wide CDC, reset,
stream, and storage contracts, and docs/verification.md for the
verification matrix.