Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
    • UVM Phases and Objections
    • Factory and config_db
    • Sequences and Sequencers
    • Analysis, Scoreboards and RAL
      • Waiting Inside write()
      • Two Analysis Imps, One write()
      • Auto-Predict, No Predictor, and a Second Master
      • Desired, Mirrored and update()
      • Backdoor Read of a Clear-on-Read Register
      • Register Reads Return Zero With a Good Waveform
    • UVM Testbench Puzzles: Tricky Q&A
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Analysis, Scoreboards and RAL
  1. Topics
  2. DV Interview Puzzles
  3. UVM Testbench Puzzles
  4. Analysis, Scoreboards and RAL
  5. Desired, Mirrored and update()
On this page

    VLSI DV Interview PuzzlesAll levels

    Desired, Mirrored and update()

    UVM 1.2, register with reset value 0, auto-predict on. After `set(5)`, what do get() and get_mirrored_value() return, and what is on the DUT? After `update()`? After `predict(9)`?

    Puzzle

    Difficulty: Easy · Puzzle 4 of 6 · Topic: Analysis, Scoreboards and RAL

    UVM 1.2, register with reset value 0, auto-predict on. After `set(5)`, what do get() and get_mirrored_value() return, and what is on the DUT? After `update()`? After `predict(9)`?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    rg.set(5);
    `uvm_info("R", $sformatf("desired=%0d mirror=%0d", rg.get(), rg.get_mirrored_value()), UVM_LOW)
    rg.update(status);
    `uvm_info("R", $sformatf("desired=%0d mirror=%0d", rg.get(), rg.get_mirrored_value()), UVM_LOW)
    void'(rg.predict(9));
    `uvm_info("R", $sformatf("desired=%0d mirror=%0d", rg.get(), rg.get_mirrored_value()), UVM_LOW)

    Hint

    Which of set, update and predict touch the bus, and which of the two model values does each change?

    Step-by-step solution

    Diagram
    1) set(5) changes only the desired value: desired=5, mirror=0, DUT still 0, no bus access.
    2) update() writes the register over the bus when desired differs from the mirror; with auto-predict the mirror follows: desired=5, mirror=5, DUT=5.
    3) predict(9) changes the model values with no bus access, setting both the mirror and the desired value to 9: desired=9, mirror=9, DUT is still 5 (the model now deliberately disagrees with the DUT).

    Answer

    Answer: After set: desired 5, mirror 0, DUT 0. After update: 5, 5, DUT 5. After predict(9): desired 9, mirror 9, DUT 5.

    How this was checked

    Checked by running the code in Verilator 5; the printed output supports the answer above. Hand-written model of the documented UVM 1.2 behaviour in plain SystemVerilog (Verilator), not the UVM library: a register with three values (desired, mirror, DUT) and the three operations.

    Why candidates get it wrong

    predict() makes the model say 9 without telling the DUT, so a subsequent mirror(UVM_CHECK) reports a mismatch; it is for recording what the bus did (predictors), not for writing.

    Interviewer follow-up

    When would update() do nothing? Model answer: when desired already equals the mirror for every field; update() writes only registers whose desired value differs from the mirror, so calling set() with the current value is a no-op for the bus.

    Related topics

    • Back to Analysis, Scoreboards and RAL

    • UVM Testbench Puzzles section

    Previous

    232 / 293

    Next: Backdoor Read of a Clear-on-Read Register

    Up next

    Up nextBackdoor Read of a Clear-on-Read Register

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Waiting Inside write()
    • Two Analysis Imps, One write()
    • Register Reads Return Zero With a Good Waveform