Re: errata/16: PROPOSAL - 19.7: `line - meaning of level parameter is unclear

From: James A. Markevitch (jam@magic.com)
Date: Tue May 04 2004 - 08:00:00 PDT

  • Next message: Kurt Baty: "Call for nominations for 1364 VSG officer positions"

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

    From: "James A. Markevitch" <jam@magic.com>
    To: etf-bugs@boyd.com
    Cc: Shalom.Bresticker@motorola.com
    Subject: Re: errata/16: PROPOSAL - 19.7: `line - meaning of level parameter is unclear
    Date: Tue, 4 May 2004 08:13:05 -0700 (PDT)

    > REWRITE 19.7 as follows:
    >
    > 19.7 `line
    >
    > It is important for Verilog tools to keep track of the filenames of the
    > Verilog source files and the line numbers in the files. This information
    > can be used for error messages or source code debugging, and can be
    > accessed by the Verilog PLI.
    >
    > In many cases, however, the Verilog source is preprocessed by some other
    > tool, and the line and file information of the original source file can
    > be lost because the preprocessor might add additional lines to the source
    > code file, combine multiple source code lines into one line, concatenate
    > multiple source files, and so on.
     
     If a goal is to handle the case where lines are combined, then it might
     be useful to have the `line directive take effect immediately (not on
     the next line) and to allow it to be embedded anywhere within a line.
     Thus,
     
     always @(posedge clk) `line 4 "file" 0 begin a <= 1'b1; end
     
     would support the case where the "begin" block was part of concatenated
     lines.
     
     Not sure whether I would support this or not, since it is counter to
     what is done in preprocessors, such as C, but it is completely general
     and doesn't require any "wierd" scanner behavior that was the source of
     concern yesterday.
     
     This would also probably be a change from de facto behavior today where
     the `line applies to the next line.
     
    > The `line compiler directive can be used to specify the original source
    > code line number and filename. This allows the location in the original
    > file to be maintained if another process modifies the source. After the
    > new line number and filename are specified, the compiler can correctly
    > refer to the original source location. However, a tool is not required to
    > produce `line directives. These directives are not intended to be inserted
    > manually into the code, although they can be.
    >
    > The compiler shall maintain the current line number and filename
    > of the file being compiled. The `line directive shall set the current line
    > number and filename to those specified in the directive.
     
     Suggest adding a clarifying sentence, such as "The new line number and
     filename apply on the next line in the source."
     
    > The directive can be specified anywhere within the Verilog HDL source
    > description. However, only white space may appear on the
    > same line as the `line directive.
    > All parameters in the `line directive are required.
    > The results of this file are not affected by the `resetall directive.
     
     Should this read "The results of this directive ..."?
     
    >
    > The syntax for the `line directive is given in Syntax 19-7.
    >
    > line_compiler_directive ::=
    > `line number "filename" level
    >
    > Syntax 19-7 Syntax for `line compiler directive
    >
    > The number parameter shall be a positive integer that specifies
    > the new line number of the following text line. The filename parameter shall
    > be a string constant that is treated as the new name of the file. The filename
    > can also be a full or relative path name. The level parameter shall be 0, 1,
    > or 2. The value 1 indicates that the following line is the first line after
    > an include file has been entered. The value 2 indicates that the following line
    > is the first line after an include file has been exited. The value 0 indicates
    > any other line.
    >
    > Example:
    > `line 3 "orig.v" 2 // Next line is line 3 of orig.v after exiting include file
     
     The comment is no longer legal in the example.
     
    > As the compiler processes the remainder of the file and new
    > files, the line number shall be incremented as each line is
    > read and the name shall be updated to the new current file
    > being processed. The line number shall be reset to 1 at the
    > beginning of each file. When beginning to read include files, the current line
    > and filename shall be stored for restoration at the termination of the include
    > file. The updated line number and filename information shall be available for
    > PLI access. The mechanism of library searching is not affected by the effects
    > of the `line compiler directive.
    >
    > http://boydtechinc.com/cgi-bin/issueproposal.pl?cmd=view&database=default&pr=16
     
     James Markevitch
     



    This archive was generated by hypermail 2.1.4 : Tue May 04 2004 - 08:00:07 PDT and
    sponsored by Boyd Technology, Inc.