配置声明(Configuration Declaration)

配置声明(Configuration Declaration)

配置是一种如何将多层级的设计联结到一起的概念。

A configuration is a construct that defines how the design hierarchy is linked together.

语法(Syntax)

configuration configuration_name of entity_name is
  [ configuration_declarations ]
  for architecture_name
    [ configuration_item ]
  end for;
end [ configuration ] [ configuration_name ];

configuration_item = for instance_label : component_name
                       [ use_item
                         [ generic_map ]
                         [ port_map ]; ]
                       [ configuration_item ]
                     end for;

use_item = entity [ library_name. ] entity_name [ ( architecture_name ) ] |
           configuration [ library_name. ] configuration_name 

configuration 配置名 of 实体名 is
  [ 配置声明 ]
  for 结构体名
    [ 结构体项 ]
  end for;
end [ configuration ] [ 配置名 ];

结构体项 = for 实例标签 : 元件名
                       [ 使用项
                         [ 类属映射 ]
                         [ 端口映射 ]; ]
                       [ 配置项 ]
                     end for;

使用项 = entity [ 库名. ] 实体名 [ ( 结构体名 ) ] |
           configuration [ 库名. ] 配置名 


说明(Description)

一个配置声明定义了在加工阶段如何将多层级的设计联合起来,通过列出使用的实体和结构体中的每个元件的例化信息。

A configuration declaration defines how the design hierarchy is linked together during elaboration, by listing the entities and architectures used in place of each component instantiation within an architecture.


一个简单的配置仅包含一个结构体的引用。多层级的配置允许嵌套多个配置。这种机制允许在层级底层对元件例化和设计实体进行绑定。

A simple configuration contains reference to only one architecture body. Hierarchical configurations allow to nest configurations. This mechanism allows binding component instantiations with the design entities down the hierarchy.


当元件中定义的端口数和类属不等于实体中定义的副本是,可以使用标识符来确定端口和类属的映射。这也是类属映射和端口映射的目的。

When the ports and generics in the component declaration are not equal to their counterparts in the entity declaration, one can use an explicit notification on how the ports and generics in the entity should be bound to ports and generics of the component instance. The generic map and port map are used for this purpose.


例程(Example)

-- an architecture of a microprocessor 
architecture Structure of MicroProcessor is 
  component ALU port (...); end component; 
  component MUX port (...); end component; 
  component LATCH port (...); end component; 
begin 
  A1: ALU port map(...); 
  M1: MUX port map(...); 
  M2: MUX port map(...); 
  M3: MUX port map(...); 
  L1: LTACH port map(...); 
  L2: LATCH port map(...); 
end Structure;
  
-- a configuration of the microprocessor
library TTL, work; 
use TTL.all;
use work.all; 
configuration Cfg4 of MicroProcessor is 
  for Structure 
    for A1: ALU 
      use configuration TTL.SN74LS181; 
    end for; 
    for M1, M2, M3: MUX 
      use entity Multiplex4(behavior); 
    end for; 
    for all: LATCH 
      use entity Work.Latch; 
    end for;
  end for; 
end configuration Cfg4;


注释(Note)

  • 尽管配置非常使用,但许多综合器并不支持。所以,最好写个脚本来正确地综合结构体。
  • Although configurations are relevant and useful for selecting which entities and achitectures make up the design hierarchy, many synthesis tools do not support them. You better write a script to synthsize the correct architectures.
  • 实体,和他的结构体和配置必须在同一个库中。
  • The entity, it's architectures and configurations must be compiled in the same library.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值