Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Saturating memory-error recorder

Hardware interview practice

Saturating memory-error recorder

MediumPost-Silicon ValidationSystemVerilog

A silicon monitor reports corrected and uncorrectable memory events with an address. Implement saturating totals and a write-once record of the first uncorrectable address, including deterministic simultaneous-event 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

input logic clk, rst_n, corrected, uncorrectable;
input logic [31:0] error_addr;
output logic [15:0] corrected_count, uncorrectable_count;
output logic first_uncorrectable_valid;
output logic [31:0] first_uncorrectable_addr;
Reviewed example

Work through one case

Input
Before an edge: corrected_count=5, uncorrectable_count=2, valid=0; corrected=1, uncorrectable=1, error_addr=0x1000
Expected output
After the edge: counts are 6 and 3, valid=1, first_uncorrectable_addr=0x1000

The event updates are independent, so both counts advance once, while the previously clear valid bit permits the first address capture.

What to cover

Requirements

  1. Increment each matching counter on its event and saturate independently at 16'hFFFF rather than wrapping.
  2. If corrected and uncorrectable are both 1 on one edge, increment both counters once.
  3. On the first uncorrectable event only, set the valid bit and capture error_addr; never overwrite the address until reset.
  4. Use synchronous active-low reset to clear both counters, the valid bit, and the stored first address.
asic.fyi · Learn silicon end to end.info@asic.fyi