
In addition to ordinary operands, many FHDL statements have attributes which are of the form <name>=<value> or <name>=(<value1>, ... ). These types of operands are also acceptable to the macro processor. When an attribute is used on a macro call, both the name of the attribute and the value may be specified as expressions. In the macro definition, the name and the value of the attribute may be accessed separately using the 'aname and 'avalue built-in functions. Suppose the following macro call has been used.
stmt5: newmac (a,b,c),(d,e,f),type=large
Within the definition of "newmac" the expression 'aname('2) will return the value "type" and the expression 'avalue('2) will return the value "large". The expression 'aname('1) will return the null string, and the expression 'avalue('1) will return the list (d,e,f). In general if the operand of 'aname is not of the form <name>=<value> then 'aname will return the null string. If the operand of 'avalue is not of the form <name>=<value> then 'avalue will return the operand itself.
The 'aname and 'avalue functions may also be used to extract the components of expressions of the form <value>-><field-name>, which are used by the ROM and PLA preprocessors. For expressions of this form, 'aname returns the field name while 'avalue returns the value.