Skip to question
SystemVerilogDesignVerificationFirmwareArchitectureASIC Interview Questions→
/Interview questions/Verify a cascading flit-collision resolver

Q062·Free·Design Verification

Verify a cascading flit-collision resolver

Difficulty
Medium
Topic
UVM Components
Language
SV
Interview prompt

Question

Write a stack oracle and header check for a framed flit-collision resolver. A right-moving flit is marked R, a left-moving flit L, and only an R survivor followed by an incoming L can collide. The oracle input contains known direction bits and unsigned 8-bit magnitudes; 1 denotes R and 0 denotes L. An empty input frame is also invalid. The observed error and 32-bit survivor count retain four-state logic, so header_matches must return false for unknown observed fields as well as ordinary mismatches.

Candidate starting point

Implementation scaffold

class collision_oracle;
  typedef struct { bit dir_right; byte unsigned mag; } flit_t;
  typedef struct { bit error; flit_t survivors[$]; } prediction_t;

  function automatic prediction_t predict(flit_t input_q[$]);
    // TODO: implement.
  endfunction

  function automatic bit header_matches(
      prediction_t p, logic got_error, logic [31:0] got_survivor_count);
    // TODO: implement.
  endfunction
endclass
Reviewed example

Trace one case

Input
accepted flits=[R5,R3,L4] followed by last
Expected output
header survivor_count=1,error=0; sole survivor=R5 with last=1

L4 first eliminates the smaller opposing R3 and then loses to R5, exercising a two-level collision cascade while preserving survivor order.

What to cover

Requirements

  1. Use a stack oracle for one to 16 nonzero direction/magnitude flits, including arbitrary-depth collision cascades.
  2. Magnitude zero or a seventeenth flit predicts an error header with survivor_count zero.
  3. For a legal frame, require the header count to equal the ordered survivor queue length; an empty result has no data beats.
  4. Treat handshake assembly, header-before-data state, output beat checking, reset, and coverage as follow-up scoreboard work.
Exact question handoffPractice Q062

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessEach time you open this Solution, one Practice Credit is used; it is not permanently unlocked. Premium Solution content also uses one credit per opening.
Continue learning

Dynamic and Polymorphic Testbenches

Review reusable agents, protocol variants, topology changes, and scalable configuration.

  • UVM Components
  • Streaming
  • Stack
  • Variable-length output
Dynamic and Polymorphic Testbenches →
Continue practicing

Related questions

Q1002 · Reference ModelsScoreboard variable-length bitmap rangesHardP→Q106 · UVM ComponentsVerify a framed cache-line rotatorMedium→
ASIC.FYI · Learn silicon end to end.info@asic.fyi