errata/601: macro formal argument usage

From: eric_mahurin@yahoo.com
Date: Fri Jul 23 2004 - 15:41:40 PDT

  • Next message: eric_mahurin@yahoo.com: "errata/602: Extraneous semicolons in pulse_control_specparam"

    >Number: 601
    >Notify-List:
    >Category: errata
    >Originator: Eric Mahurin
    >Environment:
    >Description:

    The spec doesn't clarify how formal argument substitution should occur in several end cases. "A formal argument can be used in the macro text in the same manner as an identifier" doesn't seem to cut it. Here are a few issues I can think of:

    * can a macro formal argument be a keyword?

    * will the argument be substituted when it appears in the 3rd digits token of a based number? For example:

    `define digits(x1) x1
    2'b`digits(10) // 2'b10 or 2'bx1 ?
    `define number(x1) 2'b x1
    `number(10) // 2'b 10 or 2'b x1 ?
    `define number(x1) 2'bx1
    `number(10) // 2'b10 or 2'bx1 ?

    * can macros with formal arguments be used in a udp between table and endtable? This seems problematic since all of the tokens within the table are single characters, there are no identifiers, and there are edge/level letters that might collide with the formal arguments. Examples (within a table):

    `define entry(bx,x) bx : x ;
    `entry(10,0)
    // "bx" and "b x" normally equivalent in table
    `define entry(bx,x) b x : x ;
    `entry(10,0)



    This archive was generated by hypermail 2.1.4 : Fri Jul 23 2004 - 15:41:56 PDT and
    sponsored by Boyd Technology, Inc.