From: Shalom.Bresticker@freescale.com
Date: Thu Feb 10 2005 - 23:59:52 PST
Actually, we work with null characters in strings much more than you may
think.
Typically, we initialize a string variable (I mean a reg that we intend to use
to hold a string, not what SV defines as a string variable) to be an empty
string or to 0, which is the same thing. Later we assign it a value, often
shorter than the declared length of the string variable. Then we print it.
We do this all the time. So we are printing leading null characters.
Less often, but still common, is concatenation of string variables.
If the 2nd string contains leading nulls, the resulting string will have
embedded nulls.
In both cases, if we don't want the nulls to print as spaces, we will use
the %0s format. If we do, which is common if you want each field to have a
fixed length and print in specified columns, you will use the regular %s
format. This is the behavior we expect from experience and depend on.
So it would be Wrong to change it.
> > >I don't know if I agree that we should match Verilog-XL if we think it is
> > >doing something wrong. Seems like we cleaned up a couple of Verilog-XL-isms
> > >for IEEE Verilog-1995 and if we think printing a space when a
> > >null-character was requested is wrong, I am inclined to say so.
> >
> >And do you have any real argument that this is wrong?
>
> Not really. I just thought that printing a null character was the same as
> printing a non-existent character, but I don't do a lot of work with null
> characters so my opinion is probably not important :-)
Shalom
-- Shalom Bresticker Shalom.Bresticker @freescale.com Design & Verification Methodology Tel: +972 9 9522268 Freescale Semiconductor Israel, Ltd. Fax: +972 9 9522890 POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 5441478 [ ]Freescale Internal Use Only [ ]Freescale Confidential Proprietary
This archive was generated by hypermail 2.1.4
: Thu Feb 10 2005 - 23:41:57 PST
and
sponsored by Boyd Technology, Inc.