Repository navigation
feat(clara-gap10): audit_log_ring_buffer — 64-entry inference event ring buffer - #66
Merged
Merged
Conversation
…ing buffer
CLARA Gap-10: circular ring buffer for on-chip inference event logging.
Ring buffer specs:
- 64 entries × 48 bits each
- Entry format: {timestamp[15:0], event_type[3:0], data[27:0]}
- Head pointer + wrap flag for forensic replay
- Sequential read port (rd_en / rd_data / rd_valid) for offline analysis
- uio-compatible: host can dump all 64 entries via rd_en pulses
Verification:
- iverilog -g2001 compiles clean
- tb_audit_log_ring_buffer.v: 5 scenarios, 35/35 assertions PASS
S1: empty read
S2: single write/read with rd_data check
S3: wrap-around at 64 entries (buf_full, head wraps to 0)
S4: simultaneous wr_en + rd_en coherence
S5: reset mid-operation, re-write
Constraints met:
- Pure Verilog-2005 (no SystemVerilog keywords)
- R-SI-1 clean: zero arithmetic * operators in synthesizable code
- Cell budget: ~400 cells (0.8% GAMMA 48K budget)
PhD anchor: Chapter 8 (AGI Driver) + Chapter 18 (Audit Chain)
DOI: 10.5281/zenodo.19227877
- Fix sim/tb_canonical.v: Split 'reg stable = 1' into declaration + assignment - Fix src/bitnet_encoder.v: - Replace indexed part-select x[2*i +: 2] with shift/mask approach - Remove size casts (10'(), 16'sd1) - Replace indexed part-select y_out[8*j +: 8] with case statement - Add newline at end of file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix src/gf16_popcount.v: Replace a_row[2*k +: 2] with shift/mask - Fix src/gf16_popcount16.v: Replace a_row[2*k +: 2] with shift/mask - Fix src/blake3_anchor.v: Replace m_in[32*i +: 32] with shift/mask - Fix src/vsa_matmul_8x8.v: Replace indexed part-select with intermediate wires and case statement - Fix src/vsa_matmul_16x16.v: Replace indexed part-select with intermediate wires and case statement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
CLARA Gap-10 —
audit_log_ring_bufferSummary
Implements a 64-entry circular ring buffer for on-chip inference event logging (CLARA Gap-10).
Entry Format (48 bits)
Architecture
wrappedflag set on first full rotationrd_enadvancesrd_ptrthrough all 64 entries;rd_dataprovides the 48-bit entry;rd_validindicates entry validityhead_ptr[5:0],wrapped,buf_full,buf_empty,audit_okrd_en64 times and readingrd_dataFiles
src/audit_log_ring_buffer.vtest/tb_audit_log_ring_buffer.vVerification
5 scenarios:
buf_empty=1,rd_valid=0,head_ptr=0after resetrd_datamatches{0xABCD, 0xF, 0x1234567}wrapped=1,head_ptrwraps to 0, overwrite verifiedwr_en + rd_en: write and read pointer coherentConstraints
logic,typedef,enum, SV constructs)*operators in synthesizable codesrc/only)PhD Anchors