类属映射(Generic Map)

类属映射(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.
  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值