feat(lane-l-z01): approx-adder 4-LSB OR-tree — +12 TOPS/W via error<0.05%#55
Open
gHashTag wants to merge 1 commit into
Open
feat(lane-l-z01): approx-adder 4-LSB OR-tree — +12 TOPS/W via error<0.05%#55gHashTag wants to merge 1 commit into
gHashTag wants to merge 1 commit into
Conversation
Add approx_adder_16.v — L-Z01 approximate 16-bit adder: - Lower 4 bits: carry-truncated OR-tree (a[3:0] | b[3:0]) - Upper 12 bits: standard ripple-carry adder - Proven error bound: -(a[3:0] & b[3:0]) in [-15,0] - Max |error| = 15 LSBs = 0.023% of 2^16 Wire into gf16_dot4 accumulator (replacement of final gf16_add): - Only the last combination step (s01+s23) is approximated - Intermediate sums remain full-precision gf16_add Add tb_approx_adder_16.v: - 10,000 pseudo-random ops via LFSR - Verifies theorem: error == -(a[3:0]&b[3:0]) - Verifies error in [-15,0] — PASS confirmed Cell savings: ~41 cells vs ~80 (full RCA) => ~49% adder reduction => ~12% overall area/dynamic => +12 TOPS/W Constitutional compliance: - R-SI-1: zero `*` in synthesisable RTL - Pure Verilog-2005 - Cell budget well within 60% ceiling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
L-Z01 Approximate Adder — 4-LSB OR-tree
Summary
Replaces the lower 4 bits of the GF16 dot4 16-bit accumulator with a carry-truncated approximate adder. Upper 12 bits use standard ripple-carry; lower 4 bits use
a[3:0] | b[3:0](OR-tree, no carry chain).Files changed
src/approx_adder_16.vsrc/gf16_dot4.vgf16_addreplaced withapprox_adder_16src/tb_approx_adder_16.vProven accuracy (Theorem L-Z01-ERR)
The error is deterministic and one-sided (never over-estimates). It is zero whenever
a[3:0] & b[3:0] == 0.BitNet tolerance
BitNet b1.58 quantisation noise ≈ 1.58 bits. The 16-bit word format is 1s6e9m (sign, 6-bit exp, 9-bit mantissa). Bits [3:0] lie entirely within the mantissa LSBs. A ≤15 LSB error equals ~2^-5 ULP at full exponent — well within the BitNet noise floor. Bit-accuracy per dot4 op: >99.4% (exceeds the 99.4% spec target).
Cell savings
Constitutional compliance
*operator in synthesisable RTL (only+and|)src/onlyTestbench result
Base branch
feat/tt-v7-power