# Tests for opt_prienc # # Each group exercises a specific facet: # A: basic detection across different RTL styles for a few small widths. # B: depth and cell-count bounds after rewrite. # C: the lzd_for_loop RTL from the user's design at WIDTH=8/16/64. # D: variant detection (full vs short, CLZ vs CTZ). # E: negative / no-op cases. # F: extra fanout / reuse of inputs. # ============================================================================ # Group A: basic shapes (equiv_opt + structural sanity) # ============================================================================ # A1: 4-bit CLZ written as casez (full variant). log -header "A1: 4-bit CLZ via casez (clz_full)" log -push design -reset read_verilog < total network cell count and depth bound. # The recursive halving network has 2^k - 1 muxes for an N=2^k input. The # critical path through the muxes is k = log2(N) levels, which is the win. log -header "B1: 16-bit CLZ structural" log -push design -reset read_verilog -sv < structural bounds. log -header "B2: 32-bit CTZ structural" log -push design -reset read_verilog -sv < W=4" log -push design -reset read_verilog -sv < W=3" log -push design -reset read_verilog -sv < W=4" log -push design -reset read_verilog -sv < W=3" log -push design -reset read_verilog -sv < no rewrite" log -push design -reset read_verilog -sv < no-op. log -header "E3: cone crosses FF boundary" log -push design -reset read_verilog -sv < no-op. log -header "E4: input width 2 below min-width" log -push design -reset read_verilog -sv <