结构体(Architecture)

结构体(Architecture)

一个结构体用来定义内部的组织或操作。例如描述其相关联实体的行为、数据流或者结构。

An architecture defines the internal organization or operation, i.e. describes the behaviour, data flow, or structure, of an associated entity.

语法(Syntax)

architecture 结构体名 of 实体名 is
  [ 结构体说明语句 ]
begin 
  功能描述语句
end [ architecture ] [ 结构体名 ]; 

architecture architecture_name of entity_name is
  [ architecture_declarations ]
begin 
  concurrent_statements
end [ architecture ] [ architecture_name ]; 

说明(Description)

一个结构体定义硬件模块的内部视图,例如硬件的功能、行为或者结构。一个结构体和一个定义了接口的实体相关联。

An architecture defines the internal view of a block of hardware, i.e. the functionality, behaviour or structure of the hardware. An architecture is assigned to an entity which defines the interface.
一个实体可以拥有多个结构体与之相关联。如果所有的结构体都和同一个实体相关联,则他们的名字必须不同,但是和不同实体相关联的结构体名可以相同。
An entity can have multiple alternative architectures assigned to it. All the architectures assigned to the same entity must have different names, but architectures assigned to different entities can have the same name.

例程(Example)

architecture Test of TbDff is 
  signal Clk, D, Q: std_logic := '0'; 
  component Dff 
    port(Clk, D: in std_logic; Q: out std_logic); 
  end component; 
begin 
  uut : Dff port map (Clk => Clk, D => D, Q => Q);
  Clk <= not (Clk) after 25 ns;
  stimulus : processAn architecture may not be used without an entity.
All declarations defined in an entity are fully visible and accessible within each architecture assigned to this entity.
  begin
    wait for 50 ns;
	D <= '1';
    wait for 100 ns;
	D <= '0';
    wait for 50 ns;
  end process stimulus;
end Test;


注释(Notes)

  • 结构体可以脱离开实体单独被使用
  • An architecture may not be used without an entity.
  • 所有在实体中声明的定义都必须对其相关联的结构体可见,并且可以访问。
  • All declarations defined in an entity are fully visible and accessible within each architecture assigned to this entity.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值