RE: [sv-cc] Relating to Mantis 1385

From: Jim Vellenga <vellenga_at_.....>
Date: Wed Jul 19 2006 - 06:21:20 PDT
Abigail,

Some good questions, some good answers.  We've been wrestling
with similar questions here.  Some observations in response:

-- On Q5/A5, I believe that the intent was that a vpiReg
iteration on a vpiArrayVar would return a variable of
the appropriate type.  For example,

   integer foo[0:7][2:0];

Then iterating on vpiReg from the vpiArrayVar that
represents foo would return a sequence of vpiIntegerVar,
each of which corresponds to one of the elements of foo.
Does this agree with your thinking?

-- In the above example, what would be the type of
"foo[3]"?  I believe this is what you referred to as
a "slice".  It is not a vpiIntegerVar, so I presume
it is either a vpiVarSelect or a vpiArrayVar.  What
do we want to move toward standardizing on?

-- I presume a reference to "foo[3][1:0]" now has
to be a vpiPartSelect?  Would you agree?  If so,
does its vpiParent refer to "foo[3}"?

Regards,
Jim

--------------------------------------------------------- 
James H. Vellenga                            978-262-6381 
Engineering Director                   (FAX) 978-262-6636 
Cadence Design Systems, Inc.         vellenga@cadence.com 
270 Billerica Rd 
Chelmsford, MA 01824-4179 
"We all work with partial information." 
---------------------------------------------------------- 
  
 

] -----Original Message-----
] From: owner-sv-cc@eda-stds.org 
] [mailto:owner-sv-cc@eda-stds.org] On Behalf Of Moorhouse, Abigail
] Sent: Tuesday, July 18, 2006 2:29 PM
] To: sv-cc@eda-stds.org
] Subject: [sv-cc] Relating to Mantis 1385
] 
] hi all,
]  
] I propose some questions and possible clarifying answers on 
] this somewhat thorny topic. See P1800 section 27.14 (the 
] Variables object model). I am using "elemental type" to mean 
] *integar var* for an *array var* of *integer var*, *real var* 
] for an *array var* of *real var* and so on, for both 1-D and 
] multi-D *array var* (i.e. NOT for slices, which I believe 
] would have *array var* type).
]  
] These questions are designed to clarify the expected P1800 
] behavior, from which it will be easier to see where there are 
] backwards compatibility issues.
]  
] Q1. Are elemental types from arrays returned by the var 
] select transition the same as variables returned by the 
] vpiReg transition on the same array? i.e. if put into 
] vpi_compare_handles (assuming equivalent indices) would they 
] compare as the same object even though the VPI types were different?
] A1. I think the natural answer here is yes - in some sense, 
] the var select is an alias for the element. Though having two 
] objects of different VPI type compare to be the same thing is 
] a bit disconcerting..
]  
] Q2. When an element from an array is passed into a 
] user-defined systf or obtained via vpi_handle_by_name, or 
] vpi_handle_by_index/vpi_handle_by_multi_index is its type the 
] elemental type or var select (CF now when a reg would be 
] vpiReg but an element of an integer var/time var/real var 
] array would be vpiVarSelect). 
] A2. The user must be told to code defensively for BOTH cases. 
] However the use of var select should be deprecated, and the 
] tendency be to move to the elemental types, especially for 
] the new SV variable types. Backwards compatibility is an 
] issue for the cases described in the question.
]  
] Q3. Why are some of the variables class transitions not valid 
] on var selects, for example the single transitions to module 
] and scope?
] A3. An oversight. By the answer to Q1, the var select and 
] elemental objects should behave identically
]  
] Q4. Does iterating for variables with vpiReg on a multi-d 
] array (of any elemental type) ever return a slice?
] A4. No. (not as obvious an answer as you might think, though, 
] it returns variables class objects, and a variables class 
] object could reasonably be a slice).
]  
] Q5. Can you iterate for elemental types on other arrays than 
] arrays of Reg using the elemental type? For example, iterate 
] with vpiIntegerVar on an array of integer var?
] A5. Not according to the LRM. But I predict users will be 
] confused by this.
]  
] Q6. Why are scalar bit var and scalar logic var of different 
] types to indicate the 2S/4S nature of these bits, but var bit 
] is used for the elemental bit of a vector for both 2S and 4S 
] vector types?
] A6. This has been willed where what is willed must be.
]  
] Q7. Can slices be returned from vpi_handle_by_name, 
] vpi_handle_by_index and vpi_handle_by_multi_index?
] A7. Yes (don't see why not?)
]  
] Q8. Do iterations with the vpiMemory tag return 1-D 
] vpiArrayVars of anything except reg?
] A8. No. Use vpiArrayVar, but you can't explicitly search only 
] for 1-D objects for anything except reg. (This answer because 
] a memory is explicitly defined as a 1-D array of reg).
]  
] Any thoughts? I'm sure there is a potential for discussion on 
] these, and I apologize if answers for these questions already 
] exist in the documentation..
] Abi
] 
Received on Wed Jul 19 06:21:29 2006

This archive was generated by hypermail 2.1.8 : Wed Jul 19 2006 - 06:21:53 PDT