Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
    • Low-Power RTL Hub
    • DFT and Scan Hub
    • Physical Awareness Hub
    • Waveform Debug Hub
    • STA and ECO Hub
    • RTL-to-Implementation Closure
    • DFT-Ready RTL
    • Capstone: Resilient Streaming Peripheral
      • Stage 1: Specification
      • Stage 2: CSR and Control
      • Stage 3: Buffered Streams
      • Stage 4: CDC and Reset
      • Stage 5: Arithmetic and Reliability
      • Stage 6: Verification
      • Stage 7: Constraints and Implementation
      • Stage 8: Signoff Review
    • Principal Design Review
    • Senior RTL Interview Questions & Model Answers
  • Glossary and Notation
Loading lesson

‹Capstone: Resilient Streaming Peripheral
  1. Topics
  2. RTL Design
  3. Senior & Interview
  4. Capstone: Resilient Streaming Peripheral
  5. Stage 1: Specification

Part 9 · Senior · Senior

Stage 1: Specification

Freeze the externally visible contracts, performance target, legal configurations, and failure responses.

On this page

    Why this matters

    A streaming peripheral built without a frozen spec drifts: one FIFO policy or rounding rule changes late, and tests, assertions and timing reports all go stale. Here every decision gets a requirement id before any RTL exists.

    After this lesson you can: write a one-page interface specification for a streaming peripheral, with ids that later tests, assertions and reports can point back to.

    What stage 1 freezes

    Stage 1 writes every externally visible decision down with an id before any RTL exists. Later tests, assertions and reports cite those ids, so a changed FIFO policy or numeric format shows its verification and implementation cost.

    Block diagram: AXI-Lite master feeds the CSR and control FSM on clk_io. Source stream enters an input async FIFO of 16 entries, crosses to the two-rank datapath on clk_dp, then leaves through an output async FIFO of 16 entries to the sink stream. A config handshake goes from control to the datapath, a done and error record returns, and the supervisor sends reset and epoch to the datapath.
    The capstone has two clock domains: control, streams and the supervisor on clk_io, the transform on clk_dp, with two async FIFOs and two handshakes crossing between them.

    Read the diagram top to bottom. The box labelled clk_io runs the control and stream sides, the box labelled clk_dp runs the transform, and everything that joins them is a clock-domain crossing.

    • CP-CTRL: the AXI-Lite master and the CSR/control FSM sit on clk_io.

    • CP-CLOCK: the supervisor stays on clk_io so it can contain faults while clk_dp is stopped or reset.

    • CP-BUF: both streams cross through 16-entry async FIFOs; the START/config and done/error records cross by acknowledged handshake, not FIFO.

    • CP-LAT: the datapath is two elastic register ranks, so data and metadata move together.

    The ten requirements at a glance

    One line each. The full text, which is the contract, follows in the sub-tables below.

    ID

    In one line

    CP-CTRL

    32-bit AXI4-Lite control, one outstanding request per direction, SLVERR for anything unsupported

    CP-NUM

    Q1.15 sample times Q1.15 COEFF, rounded once to nearest even, saturated to 16 bits

    CP-PKT

    1 to 16 packets of 1 to 4 beats per operation; TLAST closes each packet

    CP-CLOCK

    clk_io 100 MHz for control, streams and supervisor; unrelated clk_dp 125 MHz for the transform

    CP-BUF

    16-entry async FIFOs in both directions, show-ahead, acceptance gated on real capacity

    CP-LAT

    Two elastic ranks; at least 1 beat per clk_io sustained; empty-system latency target 24 clk_io periods

    CP-FAIL

    Graceful abort finishes the open packet and drains; only shared reset may cancel, with accounting

    CP-REL

    SECDED on the 32-bit payload, parity on metadata; UE poisons, corrupt metadata quarantines

    CP-PARAM

    Width 32 and 15 fractional bits fixed; COEFF resets to 0x4000; unsupported configurations rejected

    CP-PROGRESS

    Stated source/sink progress assumptions; 4096-cycle operation and 1024-cycle recovery watchdogs

    Worked requirement: CP-NUM

    Start with the numbers. COEFF = 0x4000 is 16384, which is 0.5 in Q1.15. The product keeps 30 fractional bits, so dividing by 32768 brings it back to Q1.15.

    Input code

    COEFF code

    Product (F=30)

    Product / 32768

    Nearest even

    After saturation

    +1

    16384

    16384

    0.5

    0

    0

    -3

    16384

    -49152

    -1.5

    -2

    -2

    -32768

    -32768

    1073741824

    32768

    32768

    32767

    Read each row left to right. The first two rows are exact ties, so the tie rule decides the answer; the last row is the one product that does not fit in 16 bits.

    • Row 1: 0.5 lies halfway between 0 and 1; nearest even picks 0.

    • Row 2: -1.5 lies halfway between -2 and -1; nearest even picks -2.

    • Row 3: -1 times -1 is +1, which Q1.15 cannot hold, so +32768 clamps to +32767.

    The numeric reference is integer product -> independent nearest-even division by 32768 -> clamp [-32768,32767]. Unclipped error relative to exact stored operands is at most half an output LSB (2^-16); clipping and input sampling error are separate. Reuse the canonical quantizer, not a second divergent rounding policy.

    Common pitfall

    Writing the rule as round to nearest without the tie rule. Rows 1 and 2 are exact ties: round half up gives 1 and -1, nearest even gives 0 and -2. A model and an RTL that pick different tie rules disagree on every tie.

    Full requirement text

    Control, packets and parameters

    ID

    Reference configuration / acceptance requirement

    CP-CTRL

    32-bit AXI4-Lite, byte addresses, one outstanding request per read/write direction; pair AW/W independently. Each internal committed CSR operation occurs once. Mapped accesses use OKAY; unsupported offsets, modes and busy configuration writes use SLVERR. APB is an extension, not another simultaneous control owner.

    CP-PKT

    One operation accepts PACKETS=1..16 packets of 1..4 beats each. TLAST closes each packet. KEEP=1111 on nonlast beats; final KEEP may be 1111 or 0011. The low two bytes always contain a complete sample; upper input bytes are padding and ignored by arithmetic. Output KEEP/LAST are preserved; valid upper output bytes are sign extension. Malformed framing is a protocol fault requiring coordinated recovery, not a silently successful packet.

    CP-PARAM

    Data width=32 and fractional bits=15 are fixed in CP-1; packet count 1..16; packet length 1..4; FIFO depths power-of-two >=2; COEFF reset=0x4000 (0.5). Reject unsupported configurations instead of silently changing byte stride or framing. Broader widths/modes are separately verified extensions.

    Numbers

    ID

    Reference configuration / acceptance requirement

    CP-NUM

    Each beat contains signed Q1.15 sample in data[15:0]. Multiply by signed 16-bit Q1.15 COEFF, retain signed 32-bit F=30 product, round once to nearest-even F=15, then saturate to 16 bits and sign-extend to 32. No accumulation or averaging.

    Clocks, buffers and latency

    ID

    Reference configuration / acceptance requirement

    CP-CLOCK

    clk_io=100 MHz owns AXI-Lite, streams and an always-on recovery supervisor; unrelated clk_dp=125 MHz owns the transform. clk_io must keep running for fault containment. The implementation may gate/stop clk_dp only under the recovery contract.

    CP-BUF

    Input/output async FIFOs default to 16 entries each, power-of-two depths >=2. Carry complete beats, use show-ahead adapters with persistent valid/ready offers, and gate acceptance on actual capacity. A registered-read resource needs prefetch/result storage; it is not a drop-in show-ahead FIFO.

    CP-LAT

    Two elastic processing register ranks: no-stall DP acceptance at D0, result available after D1, downstream consumes at D2. Stalls hold data and metadata together. Target >=1 beat/clk_io sustained after fill when both streams permit; empty-system no-stall acceptance-to-output target <=24 clk_io periods, to be measured and justified rather than assumed.

    Failure, reliability and progress

    ID

    Reference configuration / acceptance requirement

    CP-FAIL

    Graceful abort blocks new packets but finishes an already open input packet, then drains every accepted beat. Shared interface reset may cancel in-flight work with explicit epoch/drop accounting. No ordinary VALID offer is withdrawn merely because abort arrived.

    CP-REL

    Baseline FIFO payload protection is SECDED for 32 data bits plus separate parity over immutable owner/framing metadata. CE corrects payload before use; payload UE with trusted metadata produces zero data with poison/UE. Detected metadata corruption instead quarantines the operation for coordinated cancellation; never forward guessed framing. Freeze decoder convention and protection granularity before coding.

    CP-PROGRESS

    Assume progressing clocks, a source that completes each legal packet within 8 eligible input edges, and a sink that accepts each output offer within 8 offered edges. Under those assumptions, use an illustrative 4096-clk_io-cycle operation watchdog; derive the bound from FIFO residence, CDC, service gaps and counter return. Recovery has a separate 1024-cycle watchdog; expiry stays faulted/closed and cannot retract a stalled output offer without shared reset.

    What every spec must decide

    The ten requirements answer these seven questions. Use the table to check that a new design's spec has an answer for each row.

    Contract

    Required decisions

    Control

    AXI-Lite or APB, register map, errors, software sequence

    Streams

    Width, valid/ready, packet markers, backpressure

    Processing

    Operation, fixed-point formats, rounding, saturation, latency

    Clocks/resets

    Domains, relationships, release order, clock-loss behavior

    Buffers

    Depths, output mode, almost thresholds, overflow policy

    Reliability

    Parity/ECC scope, CE/UE reaction, injection

    Performance

    Sustained throughput, max latency, outstanding/burst assumptions

    Requirement-to-artifact example

    Requirement

    Supplied anchor

    Learner implementation / required evidence

    CP-NUM

    Formats, tie/clip examples and canonical quantizer lesson

    Bit-exact independent model, signed boundaries/ties/clips, aligned two-rank elastic pipeline; compile/simulate and archive verdict

    CP-FAIL

    Stalled-output abort trace in stage 3

    Controller + adapters; mutation withdrawing VALID must fail stability, drain and ownership checks

    CP-CLOCK

    Crossing inventory and stopped-clock recovery trace in stage 4

    Reset/CDC wrappers, per-bit timing/skew reports, recovery acknowledgements and epoch evidence

    CP-REL

    Partial-final-beat CE/UE trace in stage 5

    Actual encoder/decoder, persistent corruption and repair tests, aligned error records and IRQ checks

    CP-LAT

    Acceptance/visibility/consumer convention and target

    No-stall and bounded-stall timestamp checks plus mapped timing/QoR; no measured result supplied here

    Freeze checklist

    Stage 1 is frozen when every item below is written down and has an id.

    1. Clock domains, frequencies and the owner of each interface (CP-CLOCK, CP-CTRL).

    2. The numeric reference as integer steps, with the three worked codes above as tests (CP-NUM).

    3. Packet framing limits and what happens to malformed framing (CP-PKT).

    4. Buffer depths, show-ahead behaviour and the acceptance rule, including simultaneous push/pop at full and empty (CP-BUF).

    5. The latency convention (accept at D0, visible after D1, consumed at D2) and the 24-period target (CP-LAT).

    6. Abort and reset behaviour from an active operation, with drop accounting (CP-FAIL).

    7. Protection scope, decoder convention and granularity (CP-REL).

    8. Every parameter with its legal range and default; unsupported configurations rejected (CP-PARAM).

    9. Progress assumptions and watchdog bounds (CP-PROGRESS).

    10. Invariants for accepted inputs, produced outputs, ordering and conservation, and one traceability row from each requirement to its test, assertion or report.

    Check yourself COEFF is 0x4000 and the input code is +3. What output code does CP-NUM require?

    The product is 49152; divided by 32768 it is 1.5, an exact tie between 1 and 2. Nearest even picks 2, which fits in 16 bits, so the output is 2.

    Check yourself What specification item prevents the most late FIFO bugs?

    The exact acceptance and boundary policy: what happens to simultaneous push/pop at full and empty, plus output latency and data-valid meaning.

    Remember

    • Freeze clock domains, buffer policy, latency and numeric format before stage 2.

    • Each later artefact cites a requirement id, so a changed decision shows its cost.

    • The numeric reference is written down: round to nearest even, then clamp to 16 bits.

    Rule of thumb: if a decision is not in the spec with an id, nobody can say what to verify.

    Keep going

    • Interview: run a mock interview on this topic

    Related topics

    • Stage 2: CSR and control

    Previous

    303 / 350

    Next: Stage 2: CSR and Control

    Up next

    Up nextStage 2: CSR and Control

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Stage 3: Buffered Streams
    • Stage 4: CDC and Reset
    • Stage 5: Arithmetic and Reliability