Hi ,
I am trying to access an expression inside a function using VPI.
Let us say the handle to the vpiFuncCall is tt1. I tried to extract the expressions as given in the Object data model diagrams
htfv = vpi_handle(vpiFunction,tt1); // getting vpi_handle for the function from the vpiFuncCall
htfv2 = vpi_handle(vpiLeftRange,htfv); // Trying to access the expression by getting a handle to expr -- does not work
htfv2 = vpi_handle(vpiArgument,htfv); // Trying to access the expression by getting a handle to expr -- does not work
Let me give a verilog example . In the below case i want to access the 'case' expression inside the inv_o_bs function.
module comb (a,c,s,d);
input a,c,s;
output d;
reg d;
wire l,b;
assign b = a&s;
assign l = a^s;
always @*
begin
d = inv_o_bs(b,l);
end
function inv_o_bs;
input k,l;
begin
case (l)
1'b0: inv_o_bs = 1'b1;
1'b1: inv_o_bs = 1'b0;
endcase
end
endfunction
endmodule
It would be helpful if you could point out the method to do it or what is wrong in my approach
Thanks in advance