attribute my_att : string;
attribute my_att of beh : architecture is "my_value"
attribute DONT_TOUCH : string;
attribute DONT_TOUCH of beh : architecture is "yes";
Be careful while using custom attributes on signals as well. When a
custom attribute is seen on a signal, the synthesis tool attempts to put that attribute
on the item; however, this item could be translated to a register or a net, depending on
how the tool evaluates the RTL code. Also, as with hierarchies, because a signal has a
custom attribute, the tool can optimize that signal, and the attribute is lost. To
retain custom attributes on signals with custom attributes, you must place the DONT_TOUCH
or the KEEP
attribute on those signals.
Finally, because a signal in RTL could describe both a register and
the net coming out of the register, the synthesis tool checks any items with custom
attributes and the DONT_TOUCH
attribute. If the net in
question is driven by a register, synthesis copies that custom attribute to the register
and the net because there are multiple ways of using custom attributes. Sometimes, the
attribute is wanted on the register, and sometimes the net.