S
Shenli
Guest
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
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