Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ539
Page ↗
Q539DVASIC interview problem

Mailbox peek and blocking put

TechniquesSystemVerilogAdvanced synchronization
DifficultyMedium
TopicVerification Utilities
LanguageSystemVerilog
Format4 choices
01

Problem

Which behavior is guaranteed for this bounded mailbox?

Starting declarationSystemVerilog
mailbox #(int) m = new(1);
fork
  begin
    m.put(7);
    m.put(8);
  end
  begin
    int v;
    #2 m.peek(v);
    #2 m.get(v);
  end
join
02

Answer choices (4)