[vhdl-200x-ft] to_string for real and time

From: David Bishop <dbishop@server.vhdl.org>
Date: Tue Aug 24 2004 - 11:17:36 PDT

 From last night's telecon again:

   function to_string (
     VALUE : in REAL;
     JUSTIFIED : in SIDE := right;
     FIELD : in WIDTH := 0;
     format : in string := " "
     ) return STRING ;
Will also accept "f" "e", "E", "g" and "G" notation
(just like the C printf command). Defaults to a 'image
Example "8.3f" for 3.14 will give you " 3.140"
(This should be fun to implement, maybe call the PLI "printf" command)

   function to_string (
     VALUE : in TIME;
     JUSTIFIED : in SIDE := right;
     FIELD : in WIDTH := 0;
     resolution : in TIME := Sim_Resolution
     ) return STRING ;
Where "Sim_Resolution" will be a differed constant comming from package
std.standard.

This if you do a to_string (1.6 us) with a simulator resolution
set to "1 ns" then you will get "1600.0 ns" as the resulting string.
Question though, what do you get if your resolution is "10 ps"?
Received on Tue Aug 24 11:17:39 2004

This archive was generated by hypermail 2.1.8 : Tue Aug 24 2004 - 11:17:43 PDT