Ok, I'll bite. Why in std? Shalom ________________________________ From: Rich, Dave [mailto:Dave_Rich@mentor.com] Sent: Friday, May 30, 2008 9:07 PM To: Bresticker, Shalom; sv-ec@server.eda.org Subject: RE: [sv-ec] String maniulation functions What I would really like is std::itoa(i) :-) ________________________________ From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com] Sent: Friday, May 30, 2008 4:15 AM To: Rich, Dave; sv-ec@server.eda.org Subject: RE: [sv-ec] String maniulation functions Probably because they are not defined as built-in system functions, but rather as string variable methods, so str.itoa(i) converts i's decimal representation and stores it into a str. Otherwise, what do you need str for? What you would like is a $itoa, similar to $itor. Shalom ________________________________ From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On Behalf Of Rich, Dave Sent: Friday, May 30, 2008 8:24 AM To: sv-ec@server.eda.org Subject: [sv-ec] String maniulation functions Does anyone know why all the ato* (atoi, atohex, atooct, atobin, atoreal) methods are functions that return a value, and all the *toa (itoa, hextoa, octtoa, bintoa, realtoa) methods are void functions instead of returning a string? The LRM says the ato* methods are the inverse of the *toa methods. That's not true if the *toa functions are void functions. The reason I ask is that there seems to be a hole in SV in that you can covert a string parameter to an integer parameter, but you can't convert an integer parameter to a string parameter. Even if you try to create a wrapper function function string itoa(int arg); itoa.itoa(arg); endfunction This is not legal as a constant function because void functions are not legal inside constant functions. Also, mantis 2184 missed $sformatf as a valid constant system function if all arguments are constant expressions. David Rich Verification Technologist Design Verification & Test Division Mentor Graphics Corporation dave_rich@mentor.com Office: 408 487-7206 Cell: 510 589-2625 -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Sat May 31 13:18:47 2008
This archive was generated by hypermail 2.1.8 : Sat May 31 2008 - 13:19:51 PDT