//============================================================================== // CAM Parameter Definitions //============================================================================== // This file defines shared compile-time parameters for the Content-Addressable // Memory (CAM) subsystem. All `define macros use `ifndef guards to allow // command-line override via +define+. // // Macros: // NUM_ROWS — Number of rows in the CAM array // HASH_BITS — Width of the hash value in bits // LANES — Number of parallel comparison lanes // ROW_BITS — Bits needed to index NUM_ROWS rows ($clog2(NUM_ROWS)) // SCORE_BITS — Bits needed to represent HASH_BITS-bit scores ($clog2(HASH_BITS+1)) // // The TIE_BREAK_SENTINEL localparam is a bitmask with all bits set to 1'b1, // used as the initial / tie-breaking value in the row-priority arbiter. //============================================================================== `ifndef CAM_PARAMS_SVH `define CAM_PARAMS_SVH // Number of CAM rows. `ifndef NUM_ROWS `define NUM_ROWS 512 `endif // Width of the hash value stored per row. `ifndef HASH_BITS `define HASH_BITS 512 `endif // Number of parallel comparison lanes. `ifndef LANES `define LANES 16 `endif // Bits required to represent a row index. `ifndef ROW_BITS `define ROW_BITS $clog2(`NUM_ROWS) `endif // Bits required to represent a full-score count. `ifndef SCORE_BITS `define SCORE_BITS $clog2(`HASH_BITS + 1) `endif // Tie-break sentinel: all ones in the row-index width. // Used as the initial best-index value before any match is found. localparam logic [(`ROW_BITS)-1:0] TIE_BREAK_SENTINEL = {(`ROW_BITS){1'b1}}; // Current fixed parameters require NUM_ROWS divisible by LANES. // Non-divisible tail-group valid-mask is not implemented in this round. `endif // CAM_PARAMS_SVH