Polymorphism allows the use of a variable of the base class type to hold subclass objects and to reference the methods of those subclasses directly from the superclass variable.
Taking the same example from Inheritance, we'll assign a sub/child class instance sc to a base class handle bc.
Packet bc; // bc stands for BaseClass
ExtPacket sc; // sc stands for SubClass
sc = new (32'hfeed_feed, 32'h1234_5678);
bc = sc;
Login to your free account to read more ...
Was this article helpful ?