Add Proposal | Edit Analysis | Edit Class, Environment, or Release |
Number | 601
|
Notify-List |
|
Category | errata
|
Synopsis | macro formal argument usage
|
State | analyzed
|
Class | errata-discuss
|
Arrival-Date | Jul 23 2004
|
Originator | Eric Mahurin
|
Release |
|
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) |
Fix |
Unknown |
Audit-Trail |
Analyzed by eric_mahurin@yahoo.com on Sun Jul 25 12:27:56 2004 Another place where this can be an issue is in the "edge" construct: `define digits(x1) x1 edge[`digits(10)] // edge[10] or edge[x1] ? `define edge(x1) edge[x1] `edge(10) // edge[10] or edge[x1] ? All of these examples I've given are places where numbers/levels/edges can appear and not identifiers. But, these can also look like identifiers. So, are macro formal arguments replaced at these points? And if so, what if the formal argument identifier is the same as a valid number/level/edge? |
Unformatted |
|
Hosted by Boyd Technology