W
Wojtek
Guest
Hi, I have a problem:
entity Data_Bus_Buffer is
port(
clk : in std_logic;
P_I_Load : in std_logic;
P_I_Store : in std_logic;
P_IO_D0 : inout std_logic;
P_IO_D1 : inout std_logic;
P_IO_D2 : inout std_logic;
P_IO_D3 : inout std_logic;
P_IO_Bus : inout std_logic_vector(3 downto 0)
);
end Data_Bus_Buffer;
architecture Behavioral of Data_Bus_Buffer is
begin
zegar: process(clk,P_I_Load,P_I_Store)
begin
if (clk'event and clk = '1') then
if (P_I_Load = '1' and P_I_Store = '0') then
P_IO_Bus(3) <= P_IO_D3;
P_IO_Bus(2) <= P_IO_D2;
P_IO_Bus(1) <= P_IO_D1;
P_IO_Bus(0) <= P_IO_D0;
elsif (P_I_Load = '0' and P_I_Store = '1') then
P_IO_D3 <= P_IO_Bus(3);
P_IO_D2 <= P_IO_Bus(2);
P_IO_D1 <= P_IO_Bus(1);
P_IO_D0 <= P_IO_Bus(0);
else
P_IO_Bus <= "ZZZZ";
P_IO_D0 <= 'Z';
P_IO_D1 <= 'Z';
P_IO_D2 <= 'Z';
P_IO_D3 <= 'Z';
end if;
end if;
end process zegar;
end;
When i am simulating I can not initalize in testbench ports P_IO_DX before
P_I_Load = '0';
MAybe I should use only ports of type 'in' or 'out', and not inout ??
entity Data_Bus_Buffer is
port(
clk : in std_logic;
P_I_Load : in std_logic;
P_I_Store : in std_logic;
P_IO_D0 : inout std_logic;
P_IO_D1 : inout std_logic;
P_IO_D2 : inout std_logic;
P_IO_D3 : inout std_logic;
P_IO_Bus : inout std_logic_vector(3 downto 0)
);
end Data_Bus_Buffer;
architecture Behavioral of Data_Bus_Buffer is
begin
zegar: process(clk,P_I_Load,P_I_Store)
begin
if (clk'event and clk = '1') then
if (P_I_Load = '1' and P_I_Store = '0') then
P_IO_Bus(3) <= P_IO_D3;
P_IO_Bus(2) <= P_IO_D2;
P_IO_Bus(1) <= P_IO_D1;
P_IO_Bus(0) <= P_IO_D0;
elsif (P_I_Load = '0' and P_I_Store = '1') then
P_IO_D3 <= P_IO_Bus(3);
P_IO_D2 <= P_IO_Bus(2);
P_IO_D1 <= P_IO_Bus(1);
P_IO_D0 <= P_IO_Bus(0);
else
P_IO_Bus <= "ZZZZ";
P_IO_D0 <= 'Z';
P_IO_D1 <= 'Z';
P_IO_D2 <= 'Z';
P_IO_D3 <= 'Z';
end if;
end if;
end process zegar;
end;
When i am simulating I can not initalize in testbench ports P_IO_DX before
P_I_Load = '0';
MAybe I should use only ports of type 'in' or 'out', and not inout ??