我正在學習VHDL並發現一些令人困惑的東西。假設你有以下實體:爲什麼在使用組件時端口被重新定義?
entity alu32 is
port(a, b : in STD_LOGIC_VECTOR(31 downto 0);
alucontrol : in STD_LOGIC_VECTOR(2 downto 0);
result : buffer STD_LOGIC_VECTOR(31 downto 0);
zero : out STD_LOGIC);
end alu32;
當使用它作爲其他實體的架構的組成部分,它的定義是這樣的:
component alu32
port(
a, b : in STD_LOGIC_VECTOR(31 downto 0);
alucontrol : in STD_LOGIC_VECTOR(2 downto 0);
result : buffer STD_LOGIC_VECTOR(31 downto 0);
zero : out STD_LOGIC
);
end component;
我的問題是,爲什麼我們重新定義端口?這似乎是一個毫無意義的練習,因爲它與實體聲明中的完全相同。爲什麼VHDL設計不允許你簡單地使用這樣的組件:
component alu32;
http://stackoverflow.com/questions/3641341/vhdl-components?rq=1 – mstbaum 2015-04-03 14:12:46
可能的重複此外,至於爲什麼這樣設計的東西,請記住,該語言最初是在1987年標準化。計算機遠那麼強大一點。 – 2015-04-03 14:38:25
另請參閱:http://electronics.stackexchange.com/questions/16692/vhdl-component-vs-entity – Josh 2015-04-03 14:53:19