Radek,
As far as I can tell, the SV-CC has not yet addressed this issue. I have filed your question as a new Mantis item #4238.
I believe there's a bit of information available already. One could ask for the vpiTypespec of the parameter and use that to determine the structure. However, I don't know of any way using VPI from the current standard to descend to the elements or members of that parameter. To find the corresponding values (which will not change during simulation), one could in principle descend the corresponding typespec while sat the same time traversing the operands of the assignment pattern on the right-hand side.
Given this, I believe an application could work around the limitation of not being able to iterate over the elements and members of an aggregate parameter type. However, a problem that you did not explicitly mention is how to represent one of those members or elements in VPI when it shows up as an expression in the SystemVerilog source in a form such as P[0] or P.a. (I believe that the standard allows this.) I do have some ideas about what to do in such a case, but I expect the whole committee really should talk about it first.
Thank you for bringing this to our attention.
Jim Vellenga
From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org] On Behalf Of Radoslaw Nawrot
Sent: Wednesday, 4 Jul 2012 7:36 AM
To: sv-cc@eda.org
Subject: [sv-cc] Parameters in VPI
Hi,
I have few questions about parameters in vpi.
1.) If I use parameter array i.e parameter int P[4]='{1,2,3,4}
should I receive type vpiParameter or vpiArrayVar (probably no because is parameter not variable) or mayby it should be new type vpiParameterArray
2.) What about selection from such parameter
example :
parameter [7:0] P =8'h99;
P[1] shoudl be vpiParameter or vpiBitSelect ?
3.) If I have struct param :
i.e typedef struct {int a,b; int arr[2];} T;
parameter T P ='{1,2,'{3,4}};
4.) If I want to receive parameter array element , should I iterate via vpiParameter. If yes than what If I want to receive one register from paramter (vide question 2) , should I also iterate via vpiParameter?
Can I iterate via vpiMember from that parameter?
If yes should I receive vpiParameter or i.e vpiIntVar,.. vpiArrayVar
Regards,
Radek
Received on Thu Jul 5 05:44:46 2012
This archive was generated by hypermail 2.1.8 : Thu Jul 05 2012 - 05:45:03 PDT