Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

C++ Object life cycle through SV DPI

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
Hi all,

I have a C++ Object life cycle through SV DPI problem.

For example, I have a C++ reference model class named ALU. Only one public function revealed to client (e.g. ALU::ALU_EXEC) and was encapsulated in DPI(ALU_EXEC_DPI) . And there are two types of ALU commands was entered to ALU::ALU_EXEC. One is setup ALU parameters (i.e. setup the ALU class private member) , the other is calculating the result.

The question is when I leave DPI, the ALU object is eliminated and all the setup parameter is cleared, right? So can I keep a C++ Object even after I leave DPI (i.e. is the C++ Object life cycle only as long as DPI call life cycle).

My friend suggest me to return all the ALU parameter out to SV and re-enter these parameters to ALU through ALU_EXEC_DPI when I call the ALU reference model. But it may break the model encapsulation :(

May be my question is not very clear and any suggestions are welcome!
Davy
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top