我得到我的代碼以下錯誤:** Failure: (vsim-3808) Incompatible modes for port "d_out".
不兼容模式
我指定一個新的組件,定義了它的實體,連接它的端口,一切seemd OK,甚至編譯,但是當我跑了結核病它寫道,出現在標題
這部分代碼的錯誤:
signal jal_nor_out: std_logic;
jal_unit: jal_nor
port map(
data_in(5 downto 0) => instruction(31 downto 26),
d_out => jal_nor_out
);
jal_writedata_mux : Mux_2to1_xN
port map(
sel => jal_nor_out,
d_in1 => WriteData,
d_in2 => pc_inc,
d_out => data_mux_out
);
,並在另一個文件中,我有:
entity jal_nor is
port(
data_in : in std_logic_vector(5 downto 0);
d_out : out std_logic
);
end jal_nor;
architecture bhv of jal_nor is
begin
process (data_in)
begin
if data_in="000011" then
d_out <= '1';
else
d_out <= '0';
end if;
end process;
end bhv;
這是複用代碼
entity Mux_2to1_xN is
generic(
WIDTH : integer := 32);
port(
sel : in std_logic;
d_in1 : in std_logic_vector((WIDTH - 1) downto 0);
d_in2 : in std_logic_vector((WIDTH - 1) downto 0);
d_out : out std_logic_vector((WIDTH - 1) downto 0));
end Mux_2to1_xN;
任何幫助嗎?
你得到什麼樣的錯誤? – simon
**失敗:(vsim-3808)端口「d_out」的模式不兼容。 – boaz
我想這個錯誤是因爲你使用輸入/輸出端口作爲輸出/輸入。你確定這個錯誤發生在你的'jal_nor'實體嗎?你的'Mux_2to1_xN'實體中有一個同名的端口。你能顯示那個代碼嗎? – simon