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

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
  • Part 9: Deadlock and Liveness13
    • Deadlock, Livelock and Starvation
    • Deadlock Conditions and Graphs
    • Channel Dependencies
    • Message-Dependent Deadlock
    • The Consumption Assumption
    • Routing Deadlock
    • Pre-allocation or Retry
    • Retry Livelock
    • Timeouts and Watchdogs
    • Hang Debug
    • Proving Deadlock Freedom
    • Protocols Compared: Deadlock and Liveness
    • Drills: Deadlock and Liveness
  • Part 10: Reliability and Recovery20
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 9: Deadlock and Liveness
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 9: Deadlock and Liveness
  4. Channel Dependencies

Part 9 · Deadlock and Liveness · Senior (S)

Channel Dependencies

With several channels between two agents, each side may wait for some channels before acting on others. Which waits are allowed, which are forbidden, and why the rules exist: two compliant sides must never wait on each other in a cycle.

On this page

    Note

    Level: Senior (S) · Answers: Why can it hang?

    Before this: Deadlock Conditions and Graphs, Independent Channels

    A memory controller accepts a write's address only once the write's data has arrived, so that it can schedule the whole write at once. A DMA engine sends a write's data only once its address has been accepted, so that it never has data in flight for an address the target might reject. Both are sensible. Connected together, the address waits for data and the data waits for the address, for ever.

    When a protocol has several channels, which may wait for which?

    The obvious answer, and why it breaks

    The obvious approach is to let each side decide its own waits, since only it knows what it needs. But each side's choice is only safe if the other side's choice cannot close a loop with it. Without a shared rule, two independently designed, individually correct blocks can deadlock the first time they meet. So protocols that have independent channels also specify a dependency rule: which waits are allowed, for each side, on each pair of channels.

    The idea: draw the channel dependency graph

    For every pair of channels, ask: may this side hold back channel X until it has seen activity on channel Y? Draw an arrow X → Y for every allowed wait, on both sides. The rules are chosen so that the combined graph can never contain a cycle, whatever each compliant side does.

    The target may wait for the requester's valid signals; the requester must not wait for the target's readies, because that wait would close a cycle.

    The pattern is the same as the valid/ready rule of lesson 3.4, extended across channels: the side that offers (valid) must not wait for the side that accepts (ready). The accepting side may wait for whatever it likes from the offering side. Then every arrow points from accepter to offerer, and no cycle can form.

    A full set of rules for a write

    Side

    May wait for

    Must not wait for

    Requester, before offering address or data

    Nothing on these channels

    The target accepting the address or the data

    Target, before accepting address or data

    The address, the data, or both

    —

    Target, before sending the write response

    The address and the last data beat (it cannot answer otherwise)

    The requester being ready for the response

    Requester, before accepting the response

    Anything (it may be busy)

    —, but it must accept eventually (lesson 9.5)

    How real protocols chose

    Protocol

    Dependency rules

    AXI

    A manager must not wait for AWREADY or WREADY before asserting AWVALID or WVALID. A subordinate may wait for AWVALID, WVALID or both before asserting AWREADY or WREADY. It must wait for the address and the last data handshakes before asserting BVALID, and must not wait for BREADY before asserting BVALID.

    PCI Express

    Rules on which traffic type may block which (lesson 7.6): posted writes and completions must never be blocked by non-posted requests.

    What breaks

    The opening pair (illustrative) is the hang you will debug in lesson 9.10. The memory controller's wait (address waits for data) was allowed. The DMA engine's wait (data waits for the address to be accepted) broke the rule. A protocol checker on the DMA engine's port would have flagged it in the first simulation; without one, it showed up only when the two blocks were integrated.

    Why this matters

    Senior lens. Every interface with more than one channel needs a written dependency rule, and every block on it needs an assertion-based checker for that rule. Integration is where rule violations become deadlocks, so check each block against the rule in isolation, with a partner that exercises every allowed wait, including the ones its usual partner never uses.

    Interview

    Asked: "May a slave wait for write data before accepting the address?"

    Weak answer: No, the address always comes first.

    Strong answer: Yes. In AXI the subordinate may wait for AWVALID, WVALID or both before asserting AWREADY. What's forbidden is the other direction: the manager must not wait for AWREADY or WREADY before asserting AWVALID or WVALID. The rule is that the offering side never waits on the accepting side; the accepting side may wait for anything the offerer provides. That keeps every dependency arrow pointing one way, so two compliant blocks can't wait on each other in a cycle.

    Follow-ups: (1) Why must the subordinate not wait for BREADY before BVALID? (2) What would a protocol checker assert here?

    Check yourself A target waits for BREADY before asserting BVALID. What can go wrong?

    A requester that waits for BVALID before asserting BREADY (allowed) waits for the target while the target waits for it: a deadlock.

    Check yourself State the general rule behind channel dependencies.

    The offering side must not wait for the accepting side's readiness; the accepting side may wait for what the offerer provides. All arrows then point one way, and no cycle can form.

    Key takeaways

    • Independent channels need a dependency rule saying which side may wait for which channel.

    • The offering side never waits on the accepting side; the accepting side may wait for anything offered.

    • Check every block against the rule in isolation; violations appear as deadlocks at integration.

    Keep going

    Next: Lesson 9.4, Message-Dependent Deadlock. Requests and responses sharing a resource, and why responses need their own channel.

    Related topics

    • Part 9 overview: Deadlock and Liveness

    • Lesson 3.4: The Valid/Ready Rules

    Previous

    131 / 234

    Next: Message-Dependent Deadlock

    Up next

    Up nextMessage-Dependent Deadlock

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Deadlock, Livelock and Starvation
    • The Consumption Assumption
    • Routing Deadlock