[sv-ec] String maniulation functions

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu May 29 2008 - 22:24:17 PDT
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, and is
believed to be clean.
Received on Thu May 29 22:25:17 2008

This archive was generated by hypermail 2.1.8 : Thu May 29 2008 - 22:25:49 PDT