# \#OOPS

**URL:** https://verificationacademy.com/forums/tag/oops/4624.md

[Latest](https://verificationacademy.com/forums/latest.md) · [Categories](https://verificationacademy.com/forums/categories.md) · [Tags](https://verificationacademy.com/forums/tags.md)

---

## [Vending Machine in System Verilog](https://verificationacademy.com/forums/t/vending-machine-in-system-verilog/50763)

<div class="topic-metadata">

**Author:** [@CharchicaA](https://verificationacademy.com/forums/u/CharchicaA)\
**Replies:** 2\
**Last updated:** [February 2, 2026, 2:23pm UTC](https://verificationacademy.com/forums/t/vending-machine-in-system-verilog/50763 "2026-02-02T14:23:16Z")

</div>

Model a Vending Machine using OOP concepts like Inheritance and Polymorphism The vending machine can contain multiple Items Items have 2 properties: id and price Id and price could be arbitrary, they do not indicate i…

---

## [Understanding Automatic or Automatic Lifetime of Class objects - SV](https://verificationacademy.com/forums/t/understanding-automatic-or-automatic-lifetime-of-class-objects-sv/41994)

<div class="topic-metadata">

**Author:** [@xfinity](https://verificationacademy.com/forums/u/xfinity)\
**Replies:** 4\
**Last updated:** [July 25, 2023, 5:31pm UTC](https://verificationacademy.com/forums/t/understanding-automatic-or-automatic-lifetime-of-class-objects-sv/41994 "2023-07-25T17:31:48Z")

</div>

Hi All, cfg.get\_ci\_id("if\_s"); I see in this my TB code. cfg is a env configuration class and get\_ci\_id is a function which returns return(ci\_id) which is of type cip\_client\_f However i don’t see an object of cip\_cl…

---

## [Question related to inheritance and classes](https://verificationacademy.com/forums/t/question-related-to-inheritance-and-classes/40827)

<div class="topic-metadata">

**Author:** [@shubh2211](https://verificationacademy.com/forums/u/shubh2211)\
**Replies:** 10\
**Last updated:** [October 15, 2022, 5:20pm UTC](https://verificationacademy.com/forums/t/question-related-to-inheritance-and-classes/40827 "2022-10-15T17:20:44Z")

</div>

So, we have three classes (class base\_1, base\_2, base\_3 respectively) and these three classes have their three extended classes(class ext\_1,ext\_2,ext\_3 respectively) Now the three extended classes have their handles c1,…

---

## [Mailbox using inheritance](https://verificationacademy.com/forums/t/mailbox-using-inheritance/40265)

<div class="topic-metadata">

**Author:** [@ShashankGurijala](https://verificationacademy.com/forums/u/ShashankGurijala)\
**Replies:** 2\
**Last updated:** [April 12, 2022, 5:49am UTC](https://verificationacademy.com/forums/t/mailbox-using-inheritance/40265 "2022-04-12T05:49:09Z")

</div>

Hello! I’m trying to build a mailbox using inheritance. Here is the code: class properties; //declare properties int i,j; mailbox mbx; endclass: properties class data extends properties; task op; fork begin …

---

## [Why base class can't be assigned to derived class?](https://verificationacademy.com/forums/t/why-base-class-cant-be-assigned-to-derived-class/38150)

<div class="topic-metadata">

**Author:** [@mohansrikanthsunkara](https://verificationacademy.com/forums/u/mohansrikanthsunkara)\
**Replies:** 5\
**Last updated:** [October 3, 2020, 12:40am UTC](https://verificationacademy.com/forums/t/why-base-class-cant-be-assigned-to-derived-class/38150 "2020-10-03T00:40:14Z")

</div>

Hi, Why base class can’t be assigned to derived class? class A; bit var1; endclass class B extends A; //No Variables defined endclass module top; A a =new(); B b =new(); initial b = a; // Compilation e…

---

## [OOPs based testbench of combinational adder](https://verificationacademy.com/forums/t/oops-based-testbench-of-combinational-adder/36441)

<div class="topic-metadata">

**Author:** [@designMaster](https://verificationacademy.com/forums/u/designMaster)\
**Replies:** 3\
**Last updated:** [August 23, 2019, 4:02am UTC](https://verificationacademy.com/forums/t/oops-based-testbench-of-combinational-adder/36441 "2019-08-23T04:02:12Z")

</div>

//The code uses the OOPs based layered techniq for architecting the testbench.The result generated by the DUT are passed to the acoreboard through monitor. But the result generated by the reference model differs due to s…

---

## [OOPS: how to enforce that a function is implemented in derived class](https://verificationacademy.com/forums/t/oops-how-to-enforce-that-a-function-is-implemented-in-derived-class/35093)

<div class="topic-metadata">

**Author:** [@verif\_learner1](https://verificationacademy.com/forums/u/verif_learner1)\
**Replies:** 5\
**Last updated:** [September 29, 2018, 4:50pm UTC](https://verificationacademy.com/forums/t/oops-how-to-enforce-that-a-function-is-implemented-in-derived-class/35093 "2018-09-29T16:50:02Z")

</div>

I have a function (say, func\_x) in base class. This function is called within base class by another function (say func\_y). How can I enforce that in derived class, func\_x is overridden?

---

## [Can we call a virtual method in base class using extended class handle/object?](https://verificationacademy.com/forums/t/can-we-call-a-virtual-method-in-base-class-using-extended-class-handle-object/34982)

<div class="topic-metadata">

**Author:** [@ManojJ](https://verificationacademy.com/forums/u/ManojJ)\
**Replies:** 4\
**Last updated:** [September 6, 2018, 3:01am UTC](https://verificationacademy.com/forums/t/can-we-call-a-virtual-method-in-base-class-using-extended-class-handle-object/34982 "2018-09-06T03:01:51Z")

</div>

suppose a method is defined as virtual in base class. using extended class handle/object is it possible to call the virtual method in base class?

---

## [Multiple Inheritance In system verilog](https://verificationacademy.com/forums/t/multiple-inheritance-in-system-verilog/34924)

<div class="topic-metadata">

**Author:** [@learning\_uvm](https://verificationacademy.com/forums/u/learning_uvm)\
**Replies:** 2\
**Last updated:** [August 27, 2018, 5:09pm UTC](https://verificationacademy.com/forums/t/multiple-inheritance-in-system-verilog/34924 "2018-08-27T17:09:40Z")

</div>

How can we perform the concept of multiple inheritance in system verilog. ie the child class is extended by two or more parent classes.

---

## [OOPS - assigning base class](https://verificationacademy.com/forums/t/oops-assigning-base-class/34072)

<div class="topic-metadata">

**Author:** [@shatrish](https://verificationacademy.com/forums/u/shatrish)\
**Replies:** 5\
**Last updated:** [February 13, 2018, 4:52pm UTC](https://verificationacademy.com/forums/t/oops-assigning-base-class/34072 "2018-02-13T16:52:31Z")

</div>

As per OOPS, you can assign a derived class object to handle of base class type. This is because derived class has all that is present in the base class. Let us take the following scenario: we have a base class. This …

---

## [UVM class relations](https://verificationacademy.com/forums/t/uvm-class-relations/34074)

<div class="topic-metadata">

**Author:** [@shatrish](https://verificationacademy.com/forums/u/shatrish)\
**Replies:** 0\
**Last updated:** [February 11, 2018, 12:14pm UTC](https://verificationacademy.com/forums/t/uvm-class-relations/34074 "2018-02-11T12:14:06Z")

</div>

Can someone provide one example of the following type of relations either using UVM classes or using some other simple examples? Aggregation Composition Association Dependency I guess most common relation in UVM is in…

---

## [OOPS and UVM](https://verificationacademy.com/forums/t/oops-and-uvm/33923)

<div class="topic-metadata">

**Author:** [@verif\_learner1](https://verificationacademy.com/forums/u/verif_learner1)\
**Replies:** 2\
**Last updated:** [January 19, 2018, 3:10am UTC](https://verificationacademy.com/forums/t/oops-and-uvm/33923 "2018-01-19T03:10:30Z")

</div>

Many of the OOPS principles are already taken care very well due to UVM methodology. As an user of UVM or testbench writer, what principles of OOPS should I keep in mind. Examples will help. I remember the following O…

---

## [OOPS terminologies in SV](https://verificationacademy.com/forums/t/oops-terminologies-in-sv/33903)

<div class="topic-metadata">

**Author:** [@verif\_learner1](https://verificationacademy.com/forums/u/verif_learner1)\
**Replies:** 2\
**Last updated:** [January 7, 2018, 5:11pm UTC](https://verificationacademy.com/forums/t/oops-terminologies-in-sv/33903 "2018-01-07T17:11:50Z")

</div>

I would like to get the terms used in SV world with respect to OOPS correctly. Let us assume the following, A derives from B C derives from A D instantiates C is B called parent of A? is B super parent of C? what i…

---

## [How super.new and super.data functions?](https://verificationacademy.com/forums/t/how-super-new-and-super-data-functions/33569)

<div class="topic-metadata">

**Author:** [@smukerji](https://verificationacademy.com/forums/u/smukerji)\
**Replies:** 1\
**Last updated:** [October 6, 2017, 6:31am UTC](https://verificationacademy.com/forums/t/how-super-new-and-super-data-functions/33569 "2017-10-06T06:31:47Z")

</div>

class A; int data; function new(input int x); this.data = x; endfunction endclass class B extends A; function new(input int y, input int z); super.new(z); super.data = y; //this.data = 3; …

---

## [Dynamic memory consumption](https://verificationacademy.com/forums/t/dynamic-memory-consumption/33524)

<div class="topic-metadata">

**Author:** [@VerifEngg](https://verificationacademy.com/forums/u/VerifEngg)\
**Replies:** 1\
**Last updated:** [September 21, 2017, 1:26am UTC](https://verificationacademy.com/forums/t/dynamic-memory-consumption/33524 "2017-09-21T01:26:33Z")

</div>

Hi All, In systemverilog, do the method members in a class object occupy dynamic memory storage ? Suppose I have a class that has 100KB worth of method code, and only a few KB of attributes. I instantiate 1000 objects…

---

## [Question on Non-Virtual Methods?](https://verificationacademy.com/forums/t/question-on-non-virtual-methods/33420)

<div class="topic-metadata">

**Author:** [@rohit\_kumar](https://verificationacademy.com/forums/u/rohit_kumar)\
**Replies:** 2\
**Last updated:** [August 23, 2017, 2:16am UTC](https://verificationacademy.com/forums/t/question-on-non-virtual-methods/33420 "2017-08-23T02:16:35Z")

</div>

Hi all, LRM says “a non-virtual method shall only override a method in that class and its descendants”, Please can anyone explain what it means probably with example.

---

## [Mutiple test cases needs to be run sequentially in SV or UVM](https://verificationacademy.com/forums/t/mutiple-test-cases-needs-to-be-run-sequentially-in-sv-or-uvm/32992)

<div class="topic-metadata">

**Author:** [@rtawade](https://verificationacademy.com/forums/u/rtawade)\
**Replies:** 4\
**Last updated:** [March 24, 2017, 3:00am UTC](https://verificationacademy.com/forums/t/mutiple-test-cases-needs-to-be-run-sequentially-in-sv-or-uvm/32992 "2017-03-24T03:00:48Z")

</div>

i have System verilog framework in which i ave tester, scoreboard interface BFm, and testbench i have written some tasks(testing different scenarios) in Interface BFM , i am passing random values and inputs rather calli…

---

## [Same property name in both base and derived class in System verilog](https://verificationacademy.com/forums/t/same-property-name-in-both-base-and-derived-class-in-system-verilog/30868)

<div class="topic-metadata">

**Author:** [@Chandrashekhar\_Goudar](https://verificationacademy.com/forums/u/Chandrashekhar_Goudar)\
**Replies:** 1\
**Last updated:** [July 14, 2015, 5:22am UTC](https://verificationacademy.com/forums/t/same-property-name-in-both-base-and-derived-class-in-system-verilog/30868 "2015-07-14T05:22:00Z")

</div>

I have an example, class A; int a=10; function void disp(); $display(“a=%d”,a); endfunction endclass class B extends class A; int a=20; endclass program main(); A a; B b; b =new(); b.disp(); /…

---

## [Create different handle of class in the macro based on number of times macro is called](https://verificationacademy.com/forums/t/create-different-handle-of-class-in-the-macro-based-on-number-of-times-macro-is-called/30508)

<div class="topic-metadata">

**Author:** [@Vinay\_Jain](https://verificationacademy.com/forums/u/Vinay_Jain)\
**Replies:** 3\
**Last updated:** [April 2, 2015, 6:10am UTC](https://verificationacademy.com/forums/t/create-different-handle-of-class-in-the-macro-based-on-number-of-times-macro-is-called/30508 "2015-04-02T06:10:25Z")

</div>

My requirement is to develop macro which takes cmd list and wait for each response and other features too. We decided to have macro. so below is code(not complete but enough to show my problem). Code =\> fork join in m…

---

## [Types are not Assignment compatible issue](https://verificationacademy.com/forums/t/types-are-not-assignment-compatible-issue/29444)

<div class="topic-metadata">

**Author:** [@bharath123](https://verificationacademy.com/forums/u/bharath123)\
**Replies:** 1\
**Last updated:** [May 8, 2014, 11:34am UTC](https://verificationacademy.com/forums/t/types-are-not-assignment-compatible-issue/29444 "2014-05-08T11:34:27Z")

</div>

class A; task disp(); $display("This is Class A"); endtask endclass Hi when iam running below code i got an error.How to copy parent handle to child class handle,Whether can we do this? class EA extends A; ta…
