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

  • Start Here5
  • 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 Dive39
  • SystemVerilog Assertions — Interview-Critical Deep Dive41
  • Functional Coverage in SystemVerilog25
  • Testbench Architecture in SystemVerilog24
  • Advanced Language & Integration26
  • Senior & Interview Preparation23
  • Principal-Level Verification34
Loading lesson

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

Part 2 of 9Part 2 of 9/OOP for VerificationIntermediate

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.

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

Path

extends and super

A derived AXI transaction that reuses its base through super.

Required

Virtual dispatch

Base-handle calls that reach derived overrides at runtime.

Required

Casting with $cast

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

Required

Contracts and polymorphic containers

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

Recommended

Path labels. Required means core first pass for this topic, Recommended means most learners should read it, and Optional means reference, specialist or revision material you can return to later.

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.

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 lessonPrevious lessonReport an error

See also

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