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

  • RTL Foundations36
  • Combinational Design25
    • Combinational Timing Overview
    • Muxes, Decoders and Encoders
    • Arithmetic Blocks
    • Comparators and Shifters
    • Tri-State and Shared Buses
      • Tri-State Basics
      • Bus Holders, Floating Nets and Wired Logic
      • When Not to Use Internal Tri-State in ASIC RTL
    • Latch Inference
    • Arithmetic Datapaths
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

←Tri-State and Shared Buses
  1. Topics
  2. RTL Design
  3. Combinational Design
  4. Tri-State and Shared Buses
  5. When Not to Use Internal Tri-State in ASIC RTL
On this page

    Part 2 of 9, lesson 17 of 25Part 2 of 9/Combinational/Lesson 17 of 25Intermediate

    When Not to Use Internal Tri-State in ASIC RTL

    On-chip sharing needs a mux: why internal tri-state hurts and where tri-state belongs.

    Internal tri-state buses upset timing analysis, scan test and tool flows, and overlapping enables cause a transient short. A mux with the same enables is simpler and easier to check.

    After this lesson you can: give four reasons to avoid internal tri-state in an ASIC, convert a tri-state bus to an AND-OR mux, and say where tri-state still belongs.

    Tri-state is for pads, not the core

    Several blocks each drive one shared on-chip wire when enabled. In modern ASIC design this sharing is almost always avoided, for practical reasons:

    • Timing analysis struggles with enable-controlled drivers and the transitions between them; static timing tools treat tri-state buses as special cases.

    • Scan test (DFT) needs every net to have a known value; a bus with several enables is hard to control and risks contention during test.

    • Contention hazards: overlapping enables for even a gate delay cause a transient short circuit, extra power and noise.

    • Tool and library support: many flows disallow or restrict internal z, and some technologies lack tri-state cells.

    • A mux is simpler: an AND-OR select is deterministic, glitch-free in steady state, and trivially analyzable.

    Convert the bus to a mux

    Replace the shared tri-state net with a data mux whose select comes from the same output enables. The behaviour is identical whenever exactly one enable is active.

    Watch bus_tri against bus_mux. On a phone, swipe the diagram sideways.

    • Slots 1 and 2: only en1 drives 1, so both read 1.

    • Slots 3 and 4: en2 joins with 0 while en1 still drives 1: the bits disagree, so bus_tri reads x, while bus_mux reads 1 (the OR of 1 and 0). Overlap alone is not always x: where the two words agree, the bus stays known.

    • Slot 5: en1 turns off, so only en2 drives 0: both read 0.

    • Slot 6: both off: bus_tri reads z, while bus_mux reads 0.

    Situation

    Tri-state bus

    AND-OR mux

    Exactly one enable

    That driver's data

    That driver's data

    No enable

    z (floating)

    0 (defined)

    Two enables

    Resolved bit by bit: agreeing bits stay known, opposing bits become x (and are a possible short circuit)

    OR of both words: known when the inputs are known, but potentially wrong

    Timing analysis

    Special cases

    Ordinary logic

    Scan test

    Problematic

    Straightforward

    The mux does not magically fix overlapping enables; it replaces a possible short with a potentially wrong, but known, value when its inputs are known. A clocked assertion of !$isunknown({oe2, oe1, oe0}) && $onehot0({oe2, oe1, oe0}) checks exclusivity only at its sampling edges. It cannot detect a short overlap between edges. For asynchronous bus drivers, also monitor settled enable changes and inspect the delayed pad/enable paths for break-before-make timing. RTL checks alone do not prove electrical non-overlap.

    Check yourself No enable is active on a tri-state bus and on its mux twin. Predict what each one reads.

    The tri-state bus reads z because it floats. The AND-OR mux reads 0 because it is defined.

    Check yourself Two enables overlap for a moment. Predict how each version fails.

    The tri-state bus risks x on every bit where the drivers disagree, and a transient short circuit. The mux gives the OR of both values, which is potentially wrong but known if the inputs are known.

    Check yourself Two enables overlap, but both drivers happen to put the same word on the bus. What does each version read, and is the design still wrong?

    Both read that shared word with no x, because every bit agrees. The design is still wrong: two owners were enabled at once, which is why the ownership assertion checks the enables, not the data.

    Where tri-state still belongs

    • I/O pads of the chip: bidirectional pins, off-chip buses.

    • Board-level shared buses and legacy memory interfaces.

    • Hand-instantiated pad cells from the library, not inferred in the core RTL.

    Keep tri-state at the top level in a small pad wrapper. The core sees separate data_in, data_out and data_oe signals, which keeps all internal logic mux-based and analyzable.

    “Why don't we use internal tri-state buses in ASICs?” Mention timing analysis, scan/DFT, contention risk and tool support. Then offer the mux-based alternative.

    Check yourself A teammate models an internal bus with three tri-state drivers. What do you ask them to change, and what assertion do you require?

    Replace it with an AND-OR mux driven by the same enables (or a proper mux with an encoded select), and add an assertion that at most one enable is active at any time.

    Testbench

    This testbench compares the tri-state bus with its mux twin, then deliberately overlaps two opposing drivers between clock edges. The event-driven assertion must catch that overlap while the clocked assertion misses it.

    bus_tristate.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    module bus_tristate (
      input  logic [7:0] d0, d1, d2,
      input  logic       oe0, oe1, oe2,
      output wire  [7:0] bus
    );
      assign bus = oe0 ? d0 : 8'bz;
      assign bus = oe1 ? d1 : 8'bz;
      assign bus = oe2 ? d2 : 8'bz;
    endmodule
    
    module bus_mux (
      input  logic [7:0] d0, d1, d2,
      input  logic       oe0, oe1, oe2,
      output logic [7:0] bus
    );
      assign bus = ({8{oe0}} & d0) | ({8{oe1}} & d1) | ({8{oe2}} & d2);   // AND-OR select
    endmodule
    
    • Reasons: timing analysis, scan test, contention, and tool or library support.

    • An AND-OR mux gives a known value when enables overlap (the OR of the words), so assert that at most one enable is active.

    • Tri-state belongs at the pads, in a small wrapper that gives the core separate data_in, data_out and data_oe.

    Rule of thumb: keep tri-state at the pad ring and use muxes inside the core.

    How this was checked

    The testbench counts the expected assertion violations instead of reporting them as $error; a normal monitor should report unexpected violations as errors. The #0 lets this zero-delay example settle before checking the changed enables. Use timing-aware checks on delayed pad models for physical signoff.

    • Practice: Tri-state buffer and ASIC versus FPGA differences

    • Interview: run a mock interview on this topic

    Related topics

    • Muxes, decoders and encoders

    • DFT and scan

    Previous

    53 / 350

    Next: Latch Inference

    Up next

    Up nextLatch Inference

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Tri-State Basics
    clken1d1en2d2bus_tribus_mux
    Overlapping enables on a tri-state bus and its mux twin