Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Semaphores

Hardware interview practice

Semaphores

EasyVerification UtilitiesSystemVerilog

What does ok become?

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

semaphore s = new(2);
int ok;
initial begin
  s.get(2);
  ok = s.try_get(1);
end
Choose one

Answer choices

  1. A. 0, because no key remains
  2. B. 1, because try_get creates a key
  3. C. 2, the initial key count
  4. D. The call blocks until a key is returned
Continue practicing

Related questions

Verification UtilitiesMailboxes→Verification UtilitiesEvents→
asic.fyi · Learn silicon end to end.info@asic.fyi