命名(Name)

来源:互联网 发布:淘宝摄影单反相机 编辑:程序博客网 时间:2024/06/03 11:35

标识符(Identifiers)

标识符为保留字和用户定义的参数名。别名是已存在项的别名。组是项的集合。
Identifiers are used as reserved words and as names defined by the designer. An alias is an alternative name for an existing named item. Group is a collection of items.

命名(Name)

VHDL的项通过其名字来区分。
Any VHDL item is identified by its name.

语法(Syntax)

identifier             -- simple name\extended_identifier\"operator"attribute_namename.name. ...         -- selected namename(range)            -- slice namename(expression, ...)  -- indexed name 

说明(Description)

当声明了一个有名字的标识符,就可以引用这个标识符。然而并不总是使用标识符来引用一个项或者其一部分。
Any declaration that introduces a named item defines an identifier which enables reference to such an item by using this identifier. However, it is not always possible to refer to an item or part of it by using just its identifier.
更多情况下是通过名字来引用项。名字中也包含目标的访问类型,复合类型的元素,复合目标的一部分或者在声明中有标识符的单位属性。名字有以下几种形式:
More general form of reference to items is by a name. Names can also indicate objects of the access type, elements of the composite type, parts of the composite object or unit attributes which have an identifier in their declaration. The name can have any of the following forms:

  • 简单名——简单名仅有标识符,在声明中把他分配给给定单元
  • simple name – The simple name consists only of the
    identifier, which is assigned to a given unit in its declaration
  • 运算符——运算符符号是字符串字面符号,它表示为该运算符符号声明的函数
  • operator symbol – The operator symbol is a string literal, which
    indicates the function declared for such an operator symbol
  • 属性名——标识符及其属性的组合
  • attribute name – The combination of the identifier and its
    attribute
  • 选取名——选取名通常用来从库或包中选取一个项
  • selected name – A selected name is commonly used to pick an
    item out of a library or package
  • 片名——片名用来选取一维数组的一部分
  • slice name – A slice name is used to pick out a part of
    an one-dimensional array
  • 索引名——索引名从一个数组中选取一个独立项
  • indexed name – An indexed name is used to pick an individual
    item out of an array

一个名包含字母、数字和下划线。当使用扩展标识符时,第一个字符不能是字母,最后一个字符是下划线,或者标识符有两个相邻的下划线。
A name consists of letters, digits and underscores. The extended_identifier has to be used when the first character is not a letter, the last character is an underscore, or when the identifier has two adjacent underscores.

例程(Examples)

ABC_66                      -- simple name\4A*@_\                     -- extended identifier"+"                         -- operator Clk'Event                   -- attribute nameIEEE.std_logic_1164."nor"   -- selected name SignalSlice(12 to 15)       -- slice nameDataSignal(5)               -- indexed name

注释(Note)

  • VHDL的保留字不能被用于其他项的命名。
  • None of the VHDL reserved words may be used as a name for other
    items.
0 0
原创粉丝点击