Hi Cliff, Interesting question. Here are my two cents: Calling insert() with an invalid index - either larger than $+1, negative, or containing X or Z - behaves the same as any other array write with an invalid, that is, no write is performed and an assertion may be issued. Calling delete() with an invalid index deletes no element and an assertion may be issued. This behavior is consistent with the above. Calling pop_front() or pop_back() on an empty queue returns the default uninitialized value for the queue element type, and an assertion may be issued. This is consistent with an array read with an invalid index. These seem rather natural extensions from other array operations. Nonetheless, it would be good to document them. Arturo -----Original Message----- From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of Clifford E. Cummings Sent: Tuesday, June 16, 2009 8:35 PM To: sv-ec@eda.org Subject: [sv-ec] Queue Methods - return status? Hi, All - This question has been posed to me a number of times and I am not 100% sure what the answer should be. Do the queue methods return any type of status if they fail? Looking over the LRM (clause 7.11.2 in Ballot Draft), the methods are described, but unlike mailbox methods, there does not appear to be any return status, nor is there any description of what should happen if the called methods fail. Examples: insert() method at an index. What happens if you try to insert into a queue at location 5 if there are only two entries in the queue? And where is the behavior described. This is a void function. delete() method at an index. Same type of issue. Deleting an entry that does not exist. pop_front() or pop_back() from an empty queue. What happens? Any status? The push_front(), push_back() and size() methods should all be okay. Thanks for any thoughts. Regards - Cliff ---------------------------------------------------- Cliff Cummings - Sunburst Design, Inc. 14314 SW Allen Blvd., PMB 501, Beaverton, OR 97005 Phone: 503-641-8446 / FAX: 503-641-8486 cliffc@sunburst-design.com / www.sunburst-design.com Expert Verilog, SystemVerilog, Synthesis and Verification Training -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed Jun 17 02:20:39 2009
This archive was generated by hypermail 2.1.8 : Wed Jun 17 2009 - 02:22:19 PDT