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

  • Architecture Metrics Reference
  • Workload Taxonomy for Architects
  • Architecture Glossary
  • Computer Architecture Cheatsheet
  • Pipeline Fundamentals14
  • Memory Hierarchy15
  • NoC and Interconnect Architecture6
    • On-Chip Networks
      • Topology Families Compared
      • NoC Latency and Bandwidth Math
      • XY Routing and Deadlock Freedom
      • Credit Flow Control and Buffers
      • Arbitration Policies and QoS
      • NoC Triage Playbook
  • Coherency and Memory Ordering9
  • Performance Analysis9
  • Accelerator Architectures6
  • SoC Architecture Tradeoffs9
  • Architecture Interview Prep14
Loading lesson

‹On-Chip Networks
  1. Topics
  2. Computer Architecture
  3. NoC and Interconnect Architecture
  4. On-Chip Networks
  5. Credit Flow Control and Buffers

Computer Architecture · All levels

Credit Flow Control and Buffers

Wormhole, virtual cut-through and store-and-forward, plus credit-depth sizing.

On this page

    Three ways to move a packet

    Switching policy decides when a router forwards. Store-and-forward waits for the whole packet; virtual cut-through forwards after the header when the full packet fits downstream; wormhole forwards flit by flit.

    Policy

    Forwards when

    Buffer per hop

    Failure mode

    Store-and-forward

    Whole packet buffered

    One full packet

    Highest latency, simplest reasoning

    Virtual cut-through

    Header arrived and room fits the packet

    One full packet

    Blocked header still holds a full buffer

    Wormhole

    Header arrived and one flit fits

    Few flits

    Blocked header chains across routers

    Credits keep buffers safe

    A credit counts a free downstream buffer slot. The sender transmits only with credit in hand, and the receiver returns one credit per drained flit after the round-trip delay.

    Depth follows Little's law: at 1 flit per cycle with a 6-cycle round trip, depth 6 sustains full rate. The sender below also reuses a credit that arrives in the same cycle, matching real bypass behavior.

    Head-of-line blocking

    A blocked wormhole header parks its flits across several routers. Every packet queued behind it waits, even when its own path is free; that is head-of-line blocking.

    Partitioning buffers into virtual channels lets one class pass around another. The signature of credit starvation is local queue growth with delayed credit returns while neighboring links sit idle.

    Common pitfall

    Raising every buffer without checking the contention source only moves the queue. If credit returns are slow, depth is the cap; if the path choice piles flows onto one link, no depth helps.

    Testbench

    The model below runs two credit lanes for 60 cycles against a 6-cycle return pipeline: depth 6 must never stall, depth 2 must deliver exactly 2 flits per round trip, and each credit count must stay inside its depth.

    credit_sender.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    module credit_sender #(parameter int DEPTH = 6) (
      input  logic clk,
      input  logic rst_n,
      input  logic want,
      input  logic ret_credit,
      output logic send,
      output logic [31:0] credit_o
    );
      logic [31:0] credit;
      assign send = want && ((credit > 0) || ret_credit);
      assign credit_o = credit;
      always_ff @(posedge clk or negedge rst_n) begin
        if (!rst_n) credit <= DEPTH;
        else if (send && !ret_credit) credit <= credit - 1;
        else if (!send && ret_credit) credit <= credit + 1;
      end
    endmodule
    

    Interview

    Likely probes: the depth rule, and the starvation signature.

    • Depth of at least bandwidth times round trip sustains rate; depth 2 against round trip 6 caps rate at one third.

    • Credit starvation shows rising return latency with stable offered load and local queue growth.

    • Buffer credits guard link storage; token buckets cap injection rate; the two credits answer different questions.

    Check yourself Round trip grows from 6 to 9 cycles at depth 6. What rate does the lane sustain now?

    Two thirds: 6 over 9 flits per cycle. Depth is fixed, so throughput follows depth over round trip until depth is resized to 9.

    Check yourself Queues grow at two routers while nearby links are idle. Path choice or credit starvation, and what settles it?

    Credit starvation is the suspect. Check credit return latency: slow returns with stable offered load name credits, while fast returns with a shared hot link name path choice.

    Related topics

    • Arbitration and QoS

    • Valid/Ready Handshakes

    • XY routing and deadlock

    Previous

    37 / 86

    Next: Arbitration Policies and QoS

    Up next

    Up nextArbitration Policies and QoS

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Topology Families Compared
    • NoC Latency and Bandwidth Math
    • NoC Triage Playbook