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

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
    • SRAM and ROM
    • Register Files
    • Valid/Ready Handshake
    • AXI-Lite
    • AXI-Stream
    • Bus Integration
    • Synchronous FIFO
      • Contract and Invariants
      • Pointers, Occupancy and Flags
      • Portable Registered-Output FIFO
      • Simultaneous Push and Pop
      • Standard vs Fall-Through Output
      • Almost Flags and Parameter Edges
      • Verification and Signoff
    • Register-Map and CSR RTL
    • Memory Reliability
    • Peripheral RTL Integration
    • Full AXI4: RTL Roadmap
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Synchronous FIFO
  1. Topics
  2. RTL Design
  3. Memory & Buses
  4. Synchronous FIFO
  5. Simultaneous Push and Pop

Part 7 · Memory & Buses · Intermediate

Simultaneous Push and Pop

Boundary policies for simultaneous operations at partial occupancy, full, and empty.

On this page

    Why this matters

    A push and a pop on the same edge is easy in the middle of the FIFO and a policy decision at full and empty. Two teams that pick different policies disagree about whether a word was stored.

    After this lesson you can: state the conservative and the elastic rules for push and pop at the same edge, and say what each needs from the memory.

    The middle is easy; boundaries are policy

    Starting state

    Requests

    Conservative result

    Occupancy after

    Partial

    Push + pop

    Both accepted

    Unchanged

    Full

    Push + pop

    Pop accepted; push rejected

    DEPTH - 1

    Empty

    Push + pop

    Push accepted; pop rejected

    1

    Full

    Push only

    Rejected

    DEPTH

    Empty

    Pop only

    Rejected

    0

    The conservative rules derive acceptance from the flags visible before the edge. They are easy to verify and portable across memory implementations, but lose one opportunity at full and one at empty.

    The telemetry FIFO keeps that policy instead of switching semantics mid-topic. The elastic alternative is shown for comparison, but it is not used by the final module or reference queue.

    Elastic full-boundary replacement

    A throughput-oriented FIFO may accept a push while full when a pop is also accepted. The departing word frees one slot on the same edge, so occupancy stays full.

    design.sv
    1
    2
    3
    4
    5
    6
    7
    // snippet: elastic full-boundary policy
    assign pop_take  = pop_i && !empty_o;
    assign push_take = push_i && (!full_o || pop_take);
    
    // At full with both requests, both are accepted and count holds.
    // This requires defined read-during-write behavior when pointers select
    // the same physical entry.

    This policy is legal only when the storage implementation returns the old word to the pop while storing the new word for the future. A flop array with nonblocking assignments naturally does that; a memory macro must explicitly support the same read-first collision behavior.

    Each slot is one clock cycle, and a request takes effect at the edge that ends its slot. Both FIFOs see words A, B, C and D pushed in slots 0 to 3 and pops in slots 2 to 5.

    • Slots 0 and 1: two pushes fill both FIFOs. Count is 2, which is full, in slot 2.

    • Slot 2: push C and pop arrive at full. The conservative FIFO pops A but refuses C, so its count drops to 1. The elastic FIFO accepts both and stays at 2.

    • Slot 3, the collision: the elastic FIFO wrote C into the slot A was leaving on the same edge, yet elas_dout shows A. The flop array read the old word first.

    • Slots 4 to 6: the elastic FIFO returns C and D. The conservative FIFO never stored C, so the producer must keep and retry it.

    Empty-boundary bypass

    A fall-through FIFO may pair a push and pop while empty by forwarding din_i directly to the consumer. That is a different interface contract: it creates a combinational input-to-output path and makes output timing depend on the producer. The registered baseline instead stores the word and allows it to be popped later.

    Common pitfall

    Do not optimize full or empty boundary behavior without updating the scoreboard and assertions. The acceptance policy is externally visible behavior, not an internal implementation detail.

    Check yourself Why can a full FIFO's read and write pointers select the same address?

    All entries are occupied and the write pointer names the oldest slot that becomes free next, which is also the slot named by the read pointer. The wrap or count state distinguishes full from empty.

    Check yourself What must be true before accepting push and pop together while full?

    The memory must guarantee old-data/read-first behavior for that same-address collision, and the specification and verification model must expect both operations to be accepted.

    Remember

    • The conservative rule decides from the flags before the edge. It loses one opportunity at full and one at empty, and is portable.

    • The elastic rule accepts a push at full when a pop frees the slot. The memory must return the old word on a same-address collision.

    • Empty bypass is a different contract: it adds a combinational input-to-output path.

    Rule of thumb: the acceptance policy is visible behaviour, so change it in the RTL, the scoreboard and the assertions together.

    Keep going

    • Practice: Synchronous FIFO with full and empty flags

    • Interview: run a mock interview on this topic

    Related topics

    • Standard versus fall-through output

    Previous

    219 / 350

    Next: Standard vs Fall-Through Output

    Up next

    Up nextStandard vs Fall-Through Output

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Contract and Invariants
    • Pointers, Occupancy and Flags
    • Almost Flags and Parameter Edges
    clkpush_ipop_icons_count01210elas_count01210elas_dout0abcd
    Two depth-2 FIFOs get the same requests: at full with push and pop, the conservative one drops to one word while the elastic one stays full and returns the old word