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
    • Handle and Copy Puzzles
    • Virtual Method Puzzles
      • Non-Virtual vs Virtual Through Base Handle
      • Missing super.new with Required Base Args
      • Virtual Call from Base Constructor
      • Same Name, Different Prototype: Hiding Not Overriding
      • Template Method with Non-Virtual Wrapper
      • super Method Call in Override Chain
    • Parameterized Class Puzzles
    • 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
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Virtual Method Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. OOP & Testbench Puzzles
  4. Virtual Method Puzzles
  5. Missing super.new with Required Base Args
On this page

    VLSI DV Interview PuzzlesAll levels

    Missing super.new with Required Base Args

    Why does this class fail before simulation even starts, and what exact fix is required?

    Puzzle

    Difficulty: Easy · Puzzle 2 of 6 · Topic: Virtual Method Puzzles

    Why does this class fail before simulation even starts, and what exact fix is required?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    class base_cfg;
      int id;
      function new(int id);
        this.id = id;
      endfunction
    endclass
    
    class ext_cfg extends base_cfg;
      function new();
        // no super.new call
      endfunction
    endclass

    Hint

    Constructors are not optional in inheritance when base has required parameters.

    Step-by-step solution

    Diagram
    1) `base_cfg` has no zero-argument constructor; it requires `id`.
    2) `ext_cfg::new` must call `super.new(<id>)` as the first statement.
    3) Without it, compilation/elaboration fails due to unsatisfied base constructor call.

    Answer

    Answer: It is illegal because base constructor needs an argument and `ext_cfg` never calls `super.new(id)`.

    How this was checked

    Not run here: The expected result is a compile-time error, and the harness treats a failed compile as a failed run. Checked by hand: Verilator 5.048 rejects the snippet with 'Missing argument on non-defaulted argument id in function call to FUNC new'.. The answer follows the language rules and the solution steps above.

    Why candidates get it wrong

    The derived `new()` gets an implicit `super.new()` with no arguments, which cannot satisfy a required-argument base constructor. Candidates from other languages assume a default is synthesized.

    Interviewer follow-up

    How would you thread this constructor argument from UVM factory `create` path in components? Model answer: you cannot: `type_id::create(name, parent)` only passes `name` (and `parent` for components), so extra constructor arguments are not available. Give extra arguments defaults, or set them after `create` (or through `uvm_config_db` read in `build_phase`).

    Say it out loud

    This is illegal, because the base constructor requires an argument and the extended constructor never calls super new with it. The base class has no zero-argument constructor, so the call has to be the first statement in the derived new. The trap is expecting an implicit default call to work. I would add super new with the id and then recompile.

    Related topics

    • Constructors & super.new()

    • extends and super

    • Back to Virtual Method Puzzles

    • OOP & Testbench Puzzles section

    Previous

    43 / 293

    Next: Virtual Call from Base Constructor

    Up next

    Up nextVirtual Call from Base Constructor

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Same Name, Different Prototype: Hiding Not Overriding
    • Template Method with Non-Virtual Wrapper
    • super Method Call in Override Chain