RE: [sv-ec] SV-EC errata Meeting November 8, 2004 Minutes

From: Warmke, Doug <doug_warmke@mentorg.com>
Date: Thu Nov 18 2004 - 18:39:51 PST

Hello SV-EC,

I read through your weekly minutes and came across the extensive
debates you had about SystemVerilog strings.

We had a good debate on DPI's handling of string arguments
in this week's SV-CC meeting. We decided that NULL bytes
are allowed by SystemVerilog 3.1a, and that DPI argument-passing
mechanics would not interpret, modify, or restrict string arguments.

   SV-CC 201 passed a straw poll vote by: 10Y, 1N, 2A
   http://www.eda.org/sv-cc/hm/2179.html

   There is some preliminary discussion of SV-CC 201 at
   http://www.eda.org/sv-cc/hm/2171.html

My opinions on Surrendra's AI's follow.
Please see the links above for background behind these opinions.

   [AI] Surrendra: 1) check for compatibility with sv-cc committee.
                   2) how should a null byte in the middle of a string
be
                      handled? Is the last portion of the string
reclaimed?
                   3) how does strlen handle an embedded null byte?

1) Compatability of SV3.1a is fine now that 201 is going to be passed
2) Null byte in middle of string has no effect on length.
   The trailing portion is not reclaimed until the user explicitly
   deletes or reallocates the string.
3) In SV, strlen() should count the null byte as one byte in the
string's
   length, and continue counting up until the last character in the last
   portion of the string.

In general, the SV-CC committee wanted SV strings to work as much as
possible like C strings. This essentially means that C strings are
arrays of char. You can put any value you want into any member of
the char array, including value '\0'. Certain utilities interpret
'\0' in a special way, i.e. the end-of-string marker.

Some advanced C++ string packages allow embedded nulls, and the
strlen functions of those packages count embedded nulls as ordinary
bytes in the overall string. This is the way I'd like to see
SystemVerilog work. It is simple to understand and has precedence
in the programming world. To do anything else would be to invent
a new semantic, without precedent, which would inherently be
non-intuitive to programmers.

Thanks and regards,
Doug

> -----Original Message-----
> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On
> Behalf Of Mehdi Mohtashemi
> Sent: Thursday, November 18, 2004 12:40 AM
> To: sv-ec@eda.org
> Subject: [sv-ec] SV-EC errata Meeting November 8, 2004 Minutes
>
>
> The unapproved sv-ec errata meeting minutes for November 8, 2004
> is attached as text.
>
> The text of minutes will be placed on the web page at
> http://www.eda.org/sv-ec/Minutes.html
>
> Please review the action items in the minutes, due by next
> meeting, next Monday.
> thanks,
> - Mehdi
>
>
Received on Thu Nov 18 18:40:19 2004

This archive was generated by hypermail 2.1.8 : Thu Nov 18 2004 - 18:40:28 PST