With Verilog-2001, users
can add named attributes (properties) to Verilog objects, such as modules,
instances, wires, etc. Attributes can also be specified on
SystemVerilog interfaces. Attributes can also be specified on the extended
SystemVerilog constructs and are included as part of the BNF (See Annex A). SystemVerilog
also defines a default data type for attributes.
Editor’s Note: What other new SV objects
can have attributes? (program blocks, assertions,
...)? I will update the BNF syntax excerpt once that has been determined. Will
additional text for these other objects need to be added in this section? I
suggest this entire section is not needed. The BNF for each new SV object shows
where attributes are legal, and does not need to be covered in a special
section. The only change to the attribute construct itself in SystemVerilog 3.0
is the default data type of bit. Verilog-2001 says the default value is 1
(true). Is it necessary for SystemVerilog to specify the data type of that
value in order for attributes to work with SystemVerilog constructs? If not,
then let the IEEE determine the appropriate default data type, the IEEE sees a
need for one.
6.2 Attribute syntax for interfaces Default attribute type
interface_declaration ::= // from Annex A.1.3
{ attribute_instance } interface interface_identifier
[ parameter_port_list ]
[ list_of_ports ]
; [unit] [precision] { interface_item }
endinterface
[: interface_identifier]
| { attribute_instance
} interface interface_identifier [ parameter_port_list ]
[ list_of_port_declarations
] ; [unit] [precision] { non_port_interface_item
}
endinterface
[: interface_identifier]
interface_item ::= // from Annex A.1.6
port_declaration
| non_port_interface_item
attribute_instance ::= (* attr_spec
{ , attr_spec } *) // from Annex A.9.1
attr_spec ::=
attr_name = constant_expression
| attr_name
attr_name ::= identifier
Syntax 6-1—Interface attribute
syntax (excerpt from Annex A)
An example of defining
an attribute for an interface declaration is:
(* interface_att
= 10 *) interface bus1.... endinterface
The default
type of an attribute with no value is bit, with a value of 1. Otherwise, the
attribute takes the type of the expression.
The modport declaration
can be preceded by an attribute instance, like any other interface item.
Editor’s Note: Update preceding BNF
excerpt with new BNF, once available.