我正在從編譯器這個messege所有 「busreg」 位:無法處理註冊多司機
topld:busshift.vhd:(E463) 'busreg(7)' - 能」處理註冊的多驅動程序。
topld:busshift.vhd:(E446)無法在所選設備中處理'busreg(7)'的多個驅動程序。
我被要求做移位rigister,我可以放在從兩邊放,因爲我選擇取決於DIR。
我的代碼:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
use ieee.std_logic_arith.all;
ENTITY shiftbus IS
PORT
(
busreg : inout std_logic_vector(7 downto 0);
dir,clk : IN std_logic;
pinL,pinR : inout std_logic
);
END shiftbus;
ARCHITECTURE behavioral OF shiftbus IS
BEGIN
busreg<="00000000";
process(clk,dir)
begin
if (rising_edge(clk)) then
if(dir='1') then --1 we input from right
busreg<=busreg(6 downto 0)&pinR;
else-- else is 0 and we input from left
busreg<=pinL & busreg(7 downto 1);
end if;
end if;
end process;
END behavioral;