I have collected together some suggestions about how to decide what vpiConstantSelect means and have attached it below. Perhaps this will help in our discussion of Mantis item 1726. I will also attach this as a Bugnote. Regards, Jim Vellenga --------------------------------------------------------- James H. Vellenga 978-262-6381 Architect (FAX) 978-262-6636 Cadence Design Systems, Inc. vellenga@cadence.com 270 Billerica Rd Chelmsford, MA 01824-4179 "We all work with partial information." ---------------------------------------------------------- Some considerations for determining the meaning of vpiConstantSelect ==================================================================== (1) At a minimum, everyone seems to agree that all index expressions must be elaboration time constant expressions. If any are not, then vpiConstantSelect returns FALSE. (2) As Charles has suggested, we can think about what the usage model is for the property. One suggestion was to use vpiConstantSelect to determine whether or not we need to check for out-of-range or unknown index expressions ("bad indexes"). In this case, an application would check vpiConstantSelect, and if it's false, would verify that the indexes are in range before trying to get the value of the overall expression. Implications: -- If any index expression identifies a member of a dynamic array, associative array, queue, or string, then vpiConstantSelect would return FALSE, since the bounds of the parent array can change dynamically during execution. (3) One could use vpiConstantSelect to determine whether or not one has to keep checking for vpiValid before, say, obtaining the expression's value. That is, is this a handle that may lose meaning during simulation? Implications: -- As with bounds checking, if any index expression identifies a member of a dynamic array, associative array, queue, or string, then vpiConstantSelect would return FALSE, since the element could go in and out of existence during simulation. -- If any element of the expression is a member of a class variable, then vpiConstantSelect would return FALSE, since the element could go in and out of existence during simulation. -- If any element of the expression is a member of an automatic variable, then vpiConstantSelect would return FALSE. -- However, vpiConstantSelect would return TRUE for a statically declared vpiClassVar or for a statically declared but dynamically allocated array (as opposed to its members), unless the class var or array were itself a member of a dynamic object. That is, in this case, the class var or dynamically allocated array does not go in and out of existence, although its members or elements do. (4) We could also decide to try to emulate the meaning and usage of the constant_select grammatical element in Appendix A of IEEE Std 1800=2005. In this case, a constant_select is something that can be used o To extract a subelement of a parameter. o To indicate a subelement of a net as part of an lvalue. These are values or locations that have to be resolved at elaboration time. Implications: -- If any of the objects in the hierarchy are dynamic (automatic variables, nonstatic data members of a class, a class variable, any of the dynamically allocated array types) then vpiConstantSelect should return FALSE. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Mar 28 07:03:39 2007
This archive was generated by hypermail 2.1.8 : Wed Mar 28 2007 - 07:03:55 PDT