Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Build a LIFO scoreboard

Hardware interview practice

Build a LIFO scoreboard

EasyVerificationSystemVerilog

Model and check a depth-8, 16-bit stack, including simultaneous push/pop, overflow, underflow, and reset behavior.

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

// Sample after each rising edge:
{rst_n, push, pop, wdata, rdata, overflow, underflow}
Reviewed example

Work through one case

Input
Model contains [A,B] with B on top; push=C and pop=1 in the same cycle
Expected output
rdata=B, no error, model becomes [A,C]

The old top is returned before the simultaneous push replaces it.

What to cover

Requirements

  1. Use a depth-8 reference stack and clear it on reset.
  2. On a nonempty simultaneous push/pop, return the old top and replace it with wdata.
  3. On an empty simultaneous push/pop, report underflow but still accept the push.
  4. Compare rdata only for successful pops and check flags and depth every operation.
Continue practicing

Related questions

VerificationScoreboard burst-to-single conversion→Reference ModelsScoreboard a maximum-interval accelerator→Reference ModelsScoreboard variable-length bitmap ranges→
asic.fyi · Learn silicon end to end.info@asic.fyi