Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Scoreboard bank state and tagged DDR reads

Hardware interview practice

Scoreboard bank state and tagged DDR reads

HardSystemVerilog & UVMSystemVerilog

A command monitor reports ACT, PRE, WR, and RD operations, while a response monitor reports tagged read data in any order. Implement the SystemVerilog scoreboard state model and response matching.

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

class ddr_scoreboard; // cmd: ACT=0, PRE=1, WR=2, RD=3
function void command(bit [1:0] cmd, bit [2:0] bank, bit [15:0] row, bit [9:0] col, bit [5:0] id, bit [31:0] data);
function void response(bit [5:0] id, bit [31:0] data);
function int unsigned errors();
endclass
Reviewed example

Work through one case

Input
Commands ACT(bank1,row7), WR(bank1,col2,0xAA), RD(bank1,col2,id3), followed by response(id3,0xAA).
Expected output
errors() returns 0 and ID 3 is no longer outstanding.

The open row forms the sparse-memory key, the read records 0xAA by ID, and the matching response retires that expectation.

What to cover

Requirements

  1. Only bank values 0 through 3 are legal. For a legal bank, ACT opens it at row only if closed and PRE closes only an open bank; an illegal bank or state command increments errors once and changes no state.
  2. WR and RD are legal only for an open bank and use that bank's open row; WR updates a sparse model at (bank,row,col). Unwritten locations read as 32'h0000_0000.
  3. A legal RD requires an ID not already outstanding and records expected data by ID; responses may reorder, compare by case equality, and retire the matching ID even on mismatch.
  4. Illegal bank numbers, duplicate IDs, unknown responses, and RD/WR while closed each increment errors once and leave all unrelated state unchanged; construction starts closed and empty with errors=0.
Continue practicing

Related questions

UVMOut-of-order scoreboard for a 2-by-4 router→UVMBuild a FIFO UVM testbench→UVMMatch out-of-order responses by ID→
asic.fyi · Learn silicon end to end.info@asic.fyi