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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
    • Handle and Copy Puzzles
    • Virtual Method Puzzles
    • Parameterized Class Puzzles
      • Global Static vs Per-Specialization Static
      • Same Specialization via typedef Alias
      • Integral Parameter Specializations Split Statics
      • Invariance of Parameterized Type Assignment
      • Static Function Counters Per Specialization
      • Wrong UVM Macro for Parameterized Object
    • Factory Override Puzzles
    • OOP & Testbench Puzzles: Tricky Q&A
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Parameterized Class Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. OOP & Testbench Puzzles
  4. Parameterized Class Puzzles
  5. Wrong UVM Macro for Parameterized Object

VLSI DV Interview Puzzles · All levels

Wrong UVM Macro for Parameterized Object

Factory create fails for `pkt#(int)` in a parameterized sequence item. What registration mistake causes this?

On this page

    Puzzle

    Difficulty: Hard · Puzzle 6 of 6 · Topic: Parameterized Class Puzzles

    Factory create fails for `pkt#(int)` in a parameterized sequence item. What registration mistake causes this?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    class pkt #(type T = int) extends uvm_sequence_item;
      `uvm_object_utils(pkt#(T))
      function new(string name="pkt");
        super.new(name);
      endfunction
    endclass
    
    initial begin
      uvm_object o;
      o = pkt#(int)::type_id::create("o");
    end

    Hint

    Parameterized classes need parameter-aware registration macros.

    Step-by-step solution

    Diagram
    1) `uvm_object_utils` is for non-parameterized object types or concrete typedef specializations.
    2) For parameterized class templates, use `uvm_object_param_utils(pkt#(T))`.
    3) Wrong macro leads to missing/incorrect factory registration and create/override mismatches.

    Answer

    Answer: Use `uvm_object_param_utils` for parameterized class templates; wrong macro breaks reliable factory behavior per specialization.

    Why candidates get it wrong

    People remember macro names but not why specialization-aware registration is required.

    Interviewer follow-up

    When is it acceptable to use `uvm_object_utils` with a typedef of a concrete specialization?

    Related topics

    • Back to Parameterized Class Puzzles

    • OOP & Testbench Puzzles section

    Previous

    47 / 210

    Next: Factory Override Puzzles

    Up next

    Up nextFactory Override Puzzles

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Global Static vs Per-Specialization Static
    • Same Specialization via typedef Alias
    • Integral Parameter Specializations Split Statics