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

  • Start Here6
  • SystemVerilog Language Foundations28
  • Object-Oriented SystemVerilog for Verification30
    • Classes, Objects & Handles
    • Inheritance and Polymorphism
      • extends and super
      • Virtual dispatch
      • Casting with $cast
      • Contracts and polymorphic containers
    • Static, Encapsulation & Parameterized Classes
    • Virtual Interfaces: the Class-to-Pins Bridge
    • Events, Semaphores, Mailboxes and Processes
    • OOP Patterns for Testbenches
  • Constraint Randomization — Interview-Critical Deep Dive36
  • SystemVerilog Assertions — Interview-Critical Deep Dive40
  • Functional Coverage in SystemVerilog22
  • Testbench Architecture in SystemVerilog23
  • Advanced Language & Integration25
  • Senior & Interview Preparation21
  • Principal-Level Verification28
Loading lesson

‹Object-Oriented SystemVerilog for Verification
  1. Topics
  2. SystemVerilog
  3. Object-Oriented SystemVerilog for Verification
  4. Inheritance and Polymorphism

Part 2 · OOP for Verification · Intermediate

Inheritance and Polymorphism

Base handles, virtual dispatch, checked casts, and contracts for reusable testbenches.

  • 4topics
  • 4lessons

Inheritance builds specialized transactions from shared base classes. Polymorphism lets code written against a base handle drive any derived type through virtual methods and checked casts.

Remember

One sentence covers the whole topic: the handle's declared type decides non-virtual calls and every property access; the object's type decides virtual calls and whether a $cast succeeds.

Lesson

What you build

extends and super

A derived AXI transaction that reuses its base through super.

Virtual dispatch

Base-handle calls that reach derived overrides at runtime.

Casting with $cast

Safe downcasts with explicit function-form and task-form handling.

Contracts and polymorphic containers

Abstract bases, interface contracts, a mixed queue, and a factory.

Check yourself A base handle points at a derived object and calls a virtual method. Which body runs?

The most-derived override. A virtual call resolves on the object's runtime type, not on the handle's declared type.

Interview

Expect to state the rule above in one sentence. Every trap in this topic is a special case of it.

PreviousNext: extends and super

Up next

Up nextextends and super

Sign in to save progress

Practice this lessonReport an error

See also

  • Classes, Objects & Handles
  • Static, Encapsulation & Parameterized Classes
  • Virtual Interfaces: the Class-to-Pins Bridge