結構體(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_statementsend [ 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.
新聞熱點
疑難解答