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

From: pieper@synopsys.com
Date: Mon May 03 2004 - 09:32:07 PDT

  • Next message: Karen Pieper: "Meeting minutes for May 3, 2004"

    I have slightly modified the proposal I sent a few days ago.
    The proposal includes issue #291 as well.

    START PROPOSAL

    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.

    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.
    The directive can be specified anywhere within the Verilog HDL source
    description. All parameters in the `line directive are required.
    The results of this file are not affected by the `resetall 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

    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.

    END PROPOSAL

    Questions:

    - Can `line be followed by more code text (besides a comment)
    on the same line? What happens then? I propose to require
    `line to appear on a separate line, which may not be preceded
    by anything and followed on the same line only by a comment.

    - What happens if a level 2 appears without a preceding level 1?
    I propose not to deal with that (i.e., leave it unspecified).
    There is no end to the nonsense which someone can do if he
    really tries.

    http://boydtechinc.com/cgi-bin/issueproposal.pl?cmd=view&database=default&pr=16



    This archive was generated by hypermail 2.1.4 : Mon May 03 2004 - 09:32:25 PDT and
    sponsored by Boyd Technology, Inc.