Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

need OOP info for copy method

Status
Not open for further replies.

JAYSHAH

Newbie level 3
Joined
Sep 1, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
INDIA
Activity points
1,317
hello friends. :) need help about copy info actually i wanna copy a class values which is already extended class. and i need that value in another extended class. so how to do it.??
any one have any idea abt it ? pls help me. here is the demo code i mean what i wanna say exactly.


class A extends other;
rand bit [1:0] in;
endclass

class B extends my;
int bit [1:0] in;
(so here i need this "bit" value same as that other's child class A. :?: )
endclass

so how should i do it ? :-? i'm in VLSI field. and i'm using UVM methodology.
 
Last edited:

dave_59

Advanced Member level 3
Joined
Dec 15, 2011
Messages
815
Helped
361
Reputation
726
Reaction score
354
Trophy points
1,353
Location
Fremont, CA, USA
Activity points
6,454
You need to be much more explicit about what you want to do. When do you want the copy to happen? Or is it that you always want access to the 'in' member of class. You can't do anything in OOP without showing the procedural methods that acts upon the data. If you are using the UVM, it might help to show the UVM classes there represent. There might be an existing UVM mechanism to help you out.

Also, a great place to help you with UVM issues is on the forums at https://verificationacademy.com/
 

nirmish

Newbie level 4
Joined
Oct 29, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,320
First of all, both the classes A and B are no where related. I mean to say relation in terms of inheritance. When you talk about copy method of UVM, copy method attached with the object must accepts the same type, i mean base type should be same.

Here you can write a different copy method [conventional] which accepts object of class A type. like

copy_conv (A b); inside the B class. then probably you can call like B.copy_conv(a);

Hope this helps.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top