类属映射(Generic Map)
类属映射将值与模块中的正式类属进行连接。
A generic map associates values with the formal generics for a block
语法(Syntax)
generic map ( [ 类属名 => ] 设定值, ... )
generic map ( [ generic_name => ] expression, ... )
说明(Description)
类属映射给类属赋值。通常在例化时赋值,也可以在配置中赋值。值可以是位置性关联或者指定的关联。
A generic map gives the value to a generic. Usually given in an instance but can also appear in a configuration. The values can be given via positional association or via named association.
为了提高程序的可读性,降低编译出错率,建议使用指定的关联来赋值。
Use of named association is advised to improve readability and reduce the risk of making errors.
例程(Example)
architecture Structure of Top is
component CompA
generic (TPLH, TPHL: TIME := 0 ns);
port (...);
end component;
begin
u1: CompA generic map (1.9 ns, 2.8 ns)
port map (...);
u2: CompA generic map (TPLH => 2 ns, TPHL => Top_Tphl)
port map (...);
end Structure;
注释(Notes)
- 类属映射的结尾没有分号
- A generic map does not end with a semicolon.