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. XY Routing and Deadlock Freedom

Computer Architecture · All levels

XY Routing and Deadlock Freedom

Dimension-order routing, the turn model, and routing versus protocol deadlock.

On this page

    XY routing in one paragraph

    XY routing moves a packet fully along X, then fully along Y. The path is deterministic: source (0,0) to destination (3,3) always takes 6 hops, 3 east then 3 north.

    Determinism concentrates load. Aligned bursts under dimension-order routing share the same corridor links, which is why hotspot corridors appear mainly under this routing plus synchronized senders.

    Why XY cannot deadlock

    A packet makes at most one turn per trip: it travels X first, turns once from X to Y, and continues along Y. Pairs sharing a row or column make no turn at all. The four Y-to-X turns never happen, so the channel dependency graph has no cycle.

    Dally and Seitz proved the rule behind this: a routing function is deadlock-free when its channel dependency graph is acyclic. Forbidding half the turns is the cheapest way to keep it acyclic on a mesh.

    Turn

    XY allows

    Why it matters

    East to north, east to south

    Yes

    X-to-Y turns complete every XY path

    West to north, west to south

    Yes

    X-to-Y turns complete every XY path

    North to east, south to east

    No

    Y-to-X turns would close dependency cycles

    North to west, south to west

    No

    Y-to-X turns would close dependency cycles

    Routing deadlock is not protocol deadlock

    Routing deadlock is a cycle inside one message class: packets wait on channels that wait back on them. Routing restrictions or escape virtual channels break the cycle.

    Protocol deadlock spans message classes: requests cannot sink because the request queue is full of packets waiting for responses, while responses cannot be injected because their path is blocked. Separate request, response and snoop networks fix it; adding virtual channels inside one class does not.

    Common pitfall

    Claiming virtual channels cure protocol deadlock repeats the most common NoC error. Virtual channels break channel-dependency cycles within a class; only class separation breaks request-waits-response cycles across classes.

    Testbench

    The model below computes XY hop count from coordinates, and the testbench walks every pair step by step as an independent reference.

    xy_hops.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    module xy_hops (
      input  logic [1:0] sx,
      input  logic [1:0] sy,
      input  logic [1:0] dx,
      input  logic [1:0] dy,
      output logic [3:0] hops
    );
      logic [1:0] xlegs;
      logic [1:0] ylegs;
      assign xlegs = (sx >= dx) ? (sx - dx) : (dx - sx);
      assign ylegs = (sy >= dy) ? (sy - dy) : (dy - sy);
      assign hops = {2'b00, xlegs} + {2'b00, ylegs};
    endmodule
    

    Interview

    Likely probes: the two deadlock kinds, and the one-line fix for each.

    • Deadlock freedom proves no circular wait; it says nothing about fairness, livelock, or tail latency.

    • Routing deadlock yields to turn restrictions or escape channels; protocol deadlock yields to separate message-class networks.

    • Adaptive routing helps only with timely stable congestion signals; stale signals cause oscillation.

    Check yourself Every packet routes X-then-Y and the fabric still wedges with full request queues. Which deadlock kind is it, and what fixes it?

    Protocol deadlock: requests wait on responses while sharing one network. Separate request and response networks fix it; more virtual channels in the shared class do not.

    Check yourself The testbench total is 640 over 256 pairs. What mean does that prove, and does it include idle self-pairs?

    Mean 2.5 hops: 640 divided by 256. Self-pairs contribute 0 hops each and are included; excluding them gives 640 over 240, or about 2.67.

    Related topics

    • Credit flow control

    • Cache coherence for the architect

    • Topology families

    Previous

    36 / 86

    Next: Credit Flow Control and Buffers

    Up next

    Up nextCredit Flow Control and Buffers

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Topology Families Compared
    • Arbitration Policies and QoS
    • NoC Triage Playbook