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

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • The NanoSoC Tour
  • Reading Path
  • SoC Glossary10
  • SoC Metrics Reference
  • SoC Cheatsheet
  • What SoC Integration Is12
  • Architecture and Budgets21
  • Memory Maps and Address Decode26
  • Interconnect and Bus Fabrics26
    • Topologies and Bridges
    • AXI Integration Details
    • Ordering and Deadlock at the Top
    • QoS and Arbitration
    • NoC Basics
      • Packets Versus Crossbar
      • Routers, Virtual Channels and Flow Control
      • The NoC as an Integration Task
      • Does NanoSoC Need a NoC
    • Coherent Interconnect View
    • Firewalls and Protection
    • Bandwidth and Latency Verification
  • Clock and Reset Architecture24
  • Power Architecture21
  • Interrupts, DMA and Peripherals15
  • Memories, Boot and Security21
  • IP Integration and Handoff21
  • Top-Level Verification and Bring-up21
  • Package, Pads and I/O18
  • Chip Signoff and Tapeout18
  • SoC Interview Prep16
  • Capstone: Integrate NanoSoC14
Loading lesson

←NoC Basics
  1. Topics
  2. SoC Design
  3. Interconnect and Bus Fabrics
  4. NoC Basics
  5. Routers, Virtual Channels and Flow Control
On this page

    Part 4 of 14, lesson 15 of 26Part 4 of 14/Interconnect and Bus Fabrics/Lesson 15 of 26All levels

    Routers, Virtual Channels and Flow Control

    The little router theory the integrator needs: message classes on separate virtual networks, and credits sized in flits.

    Why it matters

    A NoC that works in the demo and freezes under real traffic has usually merged what must stay separate: requests and responses sharing one buffer pool, so a full request queue blocks the responses that would drain it. This is message-dependent deadlock. The integrator does not design the router, but assigns the message classes, checks the credit sizing the generator chose and must recognise the freeze. Routing algorithms, deadlock-free turn rules and credit flow control are taught in the architecture course (XY routing and deadlock freedom, credit flow control); this lesson keeps only the two checks that are the integrator's.

    The core idea

    First check: message classes. Requests and responses (and, on a coherent fabric, snoops) must travel on separate virtual networks, that is separate sets of buffers and virtual channels per message class, so that each class can drain even when another has backed up. Virtual channels inside one class exist for a different reason, head-of-line blocking and routing deadlock; they do not by themselves cure message-dependent deadlock. The coherency course calls the per-class separation virtual networks, and so does this course. Second check: credits. A sender may send only while it holds a credit for a free buffer slot downstream, and credits return after a round trip, so the buffer must cover the loop: credits in flits must be at least the round-trip cycles times the flits per cycle, or the link idles waiting for credits.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    # Illustrative values: credit sizing in flits.
    # Link moves 1 flit per cycle; the credit loop is wire out + buffer + credit back.
    FLITS_PER_CYCLE = 1
    ROUND_TRIP = 6 # cycles, illustrative
    
    def link_throughput(credits_in_flits):
        return min(1.0, credits_in_flits / (ROUND_TRIP * FLITS_PER_CYCLE))
    
    needed = ROUND_TRIP * FLITS_PER_CYCLE
    assert needed == 6
    assert link_throughput(needed) == 1.0 # enough credits: full rate
    assert abs(link_throughput(4) - 2 / 3) < 1e-9 # too few: a third of the link idles
    # separate virtual networks: each class needs its own credits, never shared
    classes = ["request", "response"]
    total_buffer_flits = len(classes) * needed
    assert total_buffer_flits == 12
    print("PASS: 6 credits for a 6-cycle loop, 4 credits give 66.7 percent, two classes need 12 flits")

    What the review looks for

    • Every message class (request, response, and snoop where coherent) is listed with its own virtual network and reserved buffers.

    • Credit counts in flits cover the round-trip case for the slowest link, not just one hop.

    • The routing rule and its deadlock freedom are taken from the generator's documentation, with the integrator's custom routes (if any) re-proved.

    Verify and debug

    Stress with all classes active at once, because buffer-sharing bugs hide until every buffer is full simultaneously. On a freeze, dump per-class occupancy per router: one class at 100 percent with its responses blocked behind its own requests is the diagnosis. For the full triage method see the NoC triage playbook in the architecture course.

    Protocol-level deadlock in a NoC or crossbar: requests and responses share one buffer pool, a full request queue blocks the responses that would free it, and the chip stalls completely under load. Caught by formal or channel-dependency review and stress emulation; fixed by separate virtual networks for request and response with reserved buffers.

    If asked why separate virtual networks exist, answer deadlock first and throughput second: separation of classes that must drain independently. Then name the pair that must always be separate: requests from responses.

    Check yourself A link with a 6-cycle credit loop has 4 credits. What does the integrator see, and what is the fix?

    The link runs at two thirds of its rate (4 of 6) with no error: credits are exhausted before the first one returns. The fix is 6 credits (in flits) per virtual network for that link, or a shorter credit loop.

    Related topics

    • Packets Versus Crossbar

    • Next: The NoC as an Integration Task

    • Architecture: Credit Flow Control and Buffers

    • Cache Coherency: Virtual Networks and Progress

    Previous

    79 / 289

    Next: The NoC as an Integration Task

    Up next

    Up nextThe NoC as an Integration Task

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Does NanoSoC Need a NoC