RE: [sv-ec] $psprintf $psdisplay // In VCS not in P1800

From: <Ryan.S.Warner_at_.....>
Date: Wed Nov 22 2006 - 08:06:38 PST
Further regarding 'p' in psprintf:

The Apache webserver has a psprintf function which I believe refers to the
fact that it returns a pointer to a char array.  This makes the most sense
for the actual origin of the 'p'.  Regardless of whether it stands for Perl
or pointer it is an anachronism in SystemVerilog, and naming consistant
with Verilog system tasks should be defined as Steve suggests.

In C, the trailing 'f' in printf stands for format which $display, $write
and $format already imply.  Also, $swriteb and $swriteo imply a type of
formatting by the trailing character, so using $swritef to mean function
seems a bit confusing.

I suggest overloading $sformat.  It already has two signatures defined:

$sformat(output_reg, format_string, list_of_arguments);
length = $sformat(output_reg, format_string, list_of_arguments);

Might as well add a third signature:

string = $sformat(format_string, list_of_arguments);


Ryan Warner
Seagate Technology
ryan.s.warner@seagate.com



                                                                           
             "Bresticker,                                                  
             Shalom"                                                       
             <shalom.bresticke                                          To 
             r@intel.com>              "Steven Sharp" <sharp@cadence.com>, 
             Sent by:                  <sv-ec@server.eda-stds.org>         
             owner-sv-ec@serve                                          cc 
             r.eda.org                                                     
             No Phone Info                                         Subject 
             Available                 RE: [sv-ec] $psprintf $psdisplay // 
                                       In VCS not in P1800                 
                                                                           
             11/22/2006 04:16                                              
             AM                                                            
                                                                           
                                                                           
                                                                           




Regarding the p in the name, some people wrote:

1. It is called psprintf for no reason other than "that's what it was
called in Vera".
2. The customer who asked for that feature to be added to Vera, he asked
for "Perl's sprintf()" function. Hence "psprintf()".

Shalom

> -----Original Message-----
> From: Steven Sharp [mailto:sharp@cadence.com]
> Sent: Wednesday, November 22, 2006 3:37 AM
> To: vhdlcohen@aol.com; sv-ec@eda-stds.org; Bresticker, Shalom
> Subject: RE: [sv-ec] $psprintf $psdisplay // In VCS not in P1800
>
>
> >From: "Bresticker, Shalom" <shalom.bresticker@intel.com>
>
> >What about $psdisplay?
>
> It is a more consistent name than $psprintf.  There is no $printf
> in Verilog.  $psdisplay would presumably add a newline at the end.
> The version that did not add a newline (which is presumably what
> you want most of the time) would be called $pswrite.  But what does
> the p stand for anyway?  How does p imply function instead of task?
>
> If we want to add this functionality to Verilog, we should make the
> names consistent with the existing system tasks.  I see a couple of
> choices:
>
> 1. $swritef (where the f stands for function) and possibly $sdisplayf,
>    which would work like $swrite and $sdisplay.
>
> 2. $sformatf, which would work like $sformat.
>
>
> Steven Sharp
> sharp@cadence.com
Received on Wed Nov 22 08:06:46 2006

This archive was generated by hypermail 2.1.8 : Wed Nov 22 2006 - 08:07:01 PST