ISSUE 242

Number 242
Category errata
Synopsis 23.9, 27.15: Is -f standard ?
State lrmdraft
Class errata-ptf
Arrival-DateJan 01 2003
Originator Shalom.Bresticker@motorola.com
Release 2001b: 23.9, 27.15
Environment
Description
Is the -f command-line argument standardized by 1364-2001?

The PLI routines in 23.9 and 27.15 seem to relate to it as
something standard, or at the very least seem to say that if
you use it, it must behave it in a certain way.

Yet, there is no mention of this anywhere else in the LRM.

Looking in my mail archives, I found that there were
discussions about this, but I did not find a definite
resolution to this. It seems to have ceased to be a subject
for discussion at some point.

(I don't have a PTF archive, and my VSG archive is only
partial. My BTF archive is almost complete.)
Fix
Section 23.9 acc_fetch_argv
page 425 (second paragraph)
Replace :
The argument following a -f argument shall contain a pointer
to a NULL terminated array of pointers to characters. This
new array shall contain the parsed contents of the file.
The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL
terminated character arrays containing the different options
in the file. The last entry in this array shall be a NULL.
If one of the options is a -f then the next pointer shall
behave the same as described above.


With:
"The vendor tool may provide a command line option to pass
a file containing a set of options. In that case, the
argument strings returned by acc_fetch_argv() shall contain
the vendor option string name followed by a pointer to a
NULL terminated array of pointers to characters. This new
array shall contain the parsed contents of the file. The
value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL
terminated character arrays containing the different
options in the file. The last entry in this array shall be
NULL. If one of the options is the vendor file option,
then the next pointer shall behave the same as described
above.


Section 27.15 vpi_get_vlog_info
page 682 last paragraph:
Replace :
The argument following a -f argument shall contain a pointer
to a NULL terminated array of pointers to characters. This
new array shall contain the parsed contents of the file.
The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL
terminated character arrays containing the different options
in the file. The last entry in this array shall be a NULL.
If one of the options is a -f then the next pointer shall
behave the same as described above.


With:
"The vendor tool may provide a command line option to pass
a file containing a set of options. In that case, the
argument strings returned by vpi_get_vlog_info() shall
contain the vendor option string name followed by a pointer
to a NULL terminated array of pointers to characters. This
new array shall contain the parsed contents of the file.
The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL
terminated character arrays containing the different options
in the file. The last entry in this array shall be NULL.
If one of the options is the vendor file option, then the
next pointer shall behave the same as described above.
Audit-Trail

Analyzed by etf@boyd.com on Thu Mar 27 13:54:54 2003
Detailed analysis:
The PLI function acc_fetch_argv and VPI function vpi_get_vlog_info have the following description:
"
The format of the argv array is that each pointer in the array shall point to a NULL terminated character array which
contains the string located on the tool's invocation command line. There shall be ‘argc’ entries in the argv array. The
value in entry zero shall be the tool's name.


The argument following a -f argument shall contain a pointer to a NULL terminated array of pointers to characters.
This new array shall contain the parsed contents of the file. The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL terminated character arrays containing the different options in
the file. The last entry in this array shall be a NULL. If one of the options is a -f then the next pointer shall behave
the same as described above.
"
The issue is that the standard does not standardize on any command line argument, except for the + args
but even there it is only the + which is part of the standard.
The PLI section seems to indicate that the argument -f is standard and is followed by the name of a file
containing a set of options.


Proposal:
remove the mention of a -f argument and state that the simulator tool may provide a command
line option to provide a file containing a set of options. In that case the acc_fetch_argv and vpi_get_vlog_info
will contain this option name followed by a pointer to null terminated array of pointers to characters.


Resolution
Replace :
The argument following a -f argument shall contain a pointer to a NULL terminated array of pointers to characters.
This new array shall contain the parsed contents of the file.


With:
"the simulator tool may provide a command
line option to provide a file containing a set of options. In that case the acc_fetch_argv and vpi_get_vlog_info
will provide the option string name followed by a pointer to null terminated array of pointers to characters.
This new array shall contain the parsed contents of the file"

Another alternative is to agree on a identifier marker such as <option_file> to replace the "-f" which would
semantically identify the fact that the following array of strings have been extracted
from an option file. This marker identifier will be output by acc_fetch_arg and vpi_get_vlog_info and
will replace any command line option name chosen by a given
simulator.


From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
To: ptf-bugs@boyd.com
Cc:
Subject: Re: errata/242: PROPOSAL - 23.9, 27.15: Is -f standard ?
Date: Sun, 30 Mar 2003 15:15:35 +0300

Resend:

Date: Thu, 27 Mar 2003 14:14:45 -0800
From: Stephen Williams<steve@icarus.com>

> "the simulator tool may provide a command line option to provide a
> file containing a set of options. In that case the acc_fetch_argv and
> vpi_get_vlog_info will provide the option string name followed by a
> pointer to null terminated array of pointers to characters. This new
> array shall contain the parsed contents of the file"

Seems to be wrong because it legislates away portability. A programmer
needs to know, when scanning the arguments, that the argument is a
pointer to a sub-array instead of a char*. The prefix to this array
pointer needs to be standardized, or standard argument scanners are
theoretically impossible.


Date: Fri, 28 Mar 2003 05:53:00 +0300 (IDT)
From: Shalom.Bresticker@motorola.com

What would be the problem in making that prefix customizable?
In point of fact, -f is today not universally standard.


Date: Thu, 27 Mar 2003 19:00:27 -0800
From: Stephen Williams<steve@icarus.com>

> What would be the problem in making that prefix customizable?
> In point of fact, -f is today not universally standard.

The PLI code would need to be informed what that flag is
so that it could properly traverse the argument list. If
it assumes "-f" for one Verilog, and it works, then that
same PLI program could crash when run by another compiler
that uses a different prefix.

Proposal #2 would not suffer this failing.:

> "the simulator tool may provide a command line option to denote a file
> containing a set of options. In that case the acc_fetch_argv and
> vpi_get_vlog_info will provide the string name "<option_file>"
> followed by a pointer to null terminated array of pointers to
> characters. This new array shall contain the parsed contents of the
> file"

I believe this would work.



From: Debi Dalio <debid@model.com>
To: ptf-bugs@boyd.com
Cc:
Subject: [Fwd: Re: errata/242: PROPOSAL - 23.9, 27.15: Is -f standard ?]
Date: Mon, 31 Mar 2003 09:49:20 -0800

>Category: errata
>Confidential: no
>Originator: Debi Dalio <debid@model.com>
>Release: 2001b
>Class: TBD
>Description:
This is a multi-part message in MIME format.
--------------050603010605040407030207
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Precedence: bulk

Just to thrown my 2 cents in here regarding the handling of
-f in acc_fetch_argv and vpi_get_vlog_info:

ModelSim does not maintain the knowledge that a -f was
used. It simply concatenates all simulator options into
one char * array. Therefore, for acc_fetch_argv and
vpi_get_vlog_info a simple char * array is returned.
I don't see any particular reason why anyone would
need to know that a -f was used; I would think it is
mostly important just to know which command line options
were specified, no matter where they came from. Keep it
simple and and just have these routines return simple
char * arrays.

Debi

--
Debi Dalio
Staff Engineer office: 503-685-0856
Model Technology fax:
8105 SW Boeckman Rd email: debid@model.com
Wilsonville, OR 97070-7777 USA web: www.model.com

--------------050603010605040407030207
Content-Type: message/rfc822;
name="Re: errata/242: PROPOSAL - 23.9, 27.15: Is -f standard ?"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Re: errata/242: PROPOSAL - 23.9, 27.15: Is -f standard ?"

Received: from relay1.mentorg.com ([192.94.38.131]) by out.model.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13)
id HQ7BXVQC; Sun, 30 Mar 2003 04:20:04 -0800
Received: from gw.boyd.com ([64.171.19.218] helo=max.boyd.com)
by relay1.mentorg.com with esmtp
id 18zbnD-0007in-00 from owner-ptf@boyd.com
for debid@model.com; Sun, 30 Mar 2003 04:20:07 -0800
Received: (from majordomo@localhost)
by max.boyd.com (8.11.0/8.11.0) id h2UCK5W16398
for ptf-list; Sun, 30 Mar 2003 04:20:05 -0800
Received: (from mail@localhost)
by max.boyd.com (8.11.0/8.11.0) id h2UCK3W16392
for ptf@boyd.com; Sun, 30 Mar 2003 04:20:03 -0800
Received: (from gnats@localhost)
by max.boyd.com (8.11.0/8.11.0) id h2UCK2Y16382;
Sun, 30 Mar 2003 04:20:02 -0800
X-Authentication-Warning: max.boyd.com: majordomo set sender to owner-ptf@boyd.com using -f
Date: Sun, 30 Mar 2003 04:20:02 -0800
Message-Id: <200303301220.h2UCK2Y16382@max.boyd.com>
To: ptf-bugs@boyd.com
From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
Subject: Re: errata/242: PROPOSAL - 23.9, 27.15: Is -f standard ?
Sender: owner-ptf@boyd.com

Precedence: bulk

The following reply was made to PR errata/242; it has been noted by GNATS.

From: Shalom Bresticker <Shalom.Bresticker@motorola.com>
To: ptf-bugs@boyd.com
Cc:
Subject: Re: errata/242: PROPOSAL - 23.9, 27.15: Is -f standard ?
Date: Sun, 30 Mar 2003 15:15:35 +0300

Resend:

Date: Thu, 27 Mar 2003 14:14:45 -0800
From: Stephen Williams<steve@icarus.com>

> "the simulator tool may provide a command line option to provide a
> file containing a set of options. In that case the acc_fetch_argv and
> vpi_get_vlog_info will provide the option string name followed by a
> pointer to null terminated array of pointers to characters. This new
> array shall contain the parsed contents of the file"

Seems to be wrong because it legislates away portability. A programmer
needs to know, when scanning the arguments, that the argument is a
pointer to a sub-array instead of a char*. The prefix to this array
pointer needs to be standardized, or standard argument scanners are
theoretically impossible.


Date: Fri, 28 Mar 2003 05:53:00 +0300 (IDT)
From: Shalom.Bresticker@motorola.com

What would be the problem in making that prefix customizable?
In point of fact, -f is today not universally standard.


Date: Thu, 27 Mar 2003 19:00:27 -0800
From: Stephen Williams<steve@icarus.com>

> What would be the problem in making that prefix customizable?
> In point of fact, -f is today not universally standard.

The PLI code would need to be informed what that flag is
so that it could properly traverse the argument list. If
it assumes "-f" for one Verilog, and it works, then that
same PLI program could crash when run by another compiler
that uses a different prefix.

Proposal #2 would not suffer this failing.:

> "the simulator tool may provide a command line option to denote a file
> containing a set of options. In that case the acc_fetch_argv and
> vpi_get_vlog_info will provide the string name "<option_file>"
> followed by a pointer to null terminated array of pointers to
> characters. This new array shall contain the parsed contents of the
> file"

I believe this would work.



--------------050603010605040407030207--

=====================
previous proposals
=====================

Proposal #1:
remove the mention of a -f argument and state that the simulator tool may provide a command
line option to provide a file containing a set of options. In that case the acc_fetch_argv and vpi_get_vlog_info
will contain this option name followed by a pointer to null terminated array of pointers to characters.


Resolution
Section 23.9 acc_fetch_argv
page 425 (second paragraph)
Replace :
The argument following a -f argument shall contain a pointer to a NULL terminated array of pointers to characters.
This new array shall contain the parsed contents of the file.The value in entry zero shall contain the name of the file.


With:
"the vendor tool may provide a command line option to pass a file
containing a set of options. In that case, the argument strings returned by acc_fetch_argv will contain the vendor option string name followed
by a pointer to null terminated array of pointers to characters. This new array shall contain the parsed contents of the file.
The value in entry zero shall contain the name of the file.

Proposal #2:
Agree on a string identifier which will be output by acc_fetch_arg and vpi_get_vlog_info and which
will be substituting any vendor specific command line switch denoting an option file.

Replace :
The argument following a -f argument shall contain a pointer to a NULL terminated array of pointers to characters.
This new array shall contain the parsed contents of the file.

With:
"the simulator tool may provide a command
line option to denote a file containing a set of options. In that case the acc_fetch_argv and vpi_get_vlog_info
will provide the string name "<option_file>" followed by a pointer to null terminated array of pointers to characters.
This new array shall contain the parsed contents of the file"


------------------------------------------------------------
After debate on 4.7 we opted for solution 1 (vendor option string).
options are not portable between tools so it is not an issue
to provide back the vendor option name for file inclusion
of options.
We cannot flaten the options set into 1 set because of the
way it is currently specified in the standard.

Final resolution is:
Section 23.9 acc_fetch_argv
page 425 (second paragraph)
Replace :
The argument following a -f argument shall contain a pointer to a NULL terminated array of pointers to characters.
This new array shall contain the parsed contents of the file.The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL terminated character arrays containing the different options in the file.
The last entry in this array shall be a NULL. If one of the options is a -f then the next pointer shall behave
the same as described above.


With:
"The vendor tool may provide a command line option to pass a file
containing a set of options. In that case, the argument strings returned by acc_fetch_argv will contain the vendor option string name followed
by a pointer to null terminated array of pointers to characters. This new array shall contain the parsed contents of the file.
The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL terminated character arrays containing the different options in the file.
The last entry in this array shall be a NULL. If one of the options is the vendor file option, then the next pointer shall behave
the same as described above.


Section 27.15 vpi_get_vlog_info
page 682 last paragraph:
Replace :
The argument following a -f argument shall contain a pointer to a NULL terminated array of pointers to characters.
This new array shall contain the parsed contents of the file.The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL terminated character arrays containing the different options in the file.
The last entry in this array shall be a NULL. If one of the options is a -f then the next pointer shall behave
the same as described above.


With:
"The vendor tool may provide a command line option to pass a file
containing a set of options. In that case, the argument strings returned by vpi_get_vlog_info will contain the vendor option string name followed
by a pointer to null terminated array of pointers to characters. This new array shall contain the parsed contents of the file.
The value in entry zero shall contain the name of the file.
The remaining entries shall contain pointers to NULL terminated character arrays containing the different options in the file.
The last entry in this array shall be a NULL. If one of the options is the vendor file option, then the next pointer shall behave
the same as described above.

------------------------------------------------------------
The proposal passed by the PTF on 6/16/2003 is in the fix field


Unformatted









Hosted by Boyd Technology