Using inout ports in VHDL
Hello,
I'm trying to implement a bidirectional bus. I've declared the port as
inout std_logic_vector, and the simulation shows only "UUU...". Any
idea how I control the inout bus?
read: process(clk2x)
begin
if rising_edge(clk2x) then
if read_data = '1' then
u_data_o <= ddr_dq;
u_data_valid <= '1';
else
u_data_o <= (others => '0');
u_data_valid <= '0';
end if;
end if;
end process read;
write: process(clk2x)
begin
if falling_edge(clk2x) then
if write_data = '1' then
ddr_dq <= u_data_i;
ddr_dqs <= clkstr;
elsif read_data = '0' then
ddr_dq <= (others => 'Z');
ddr_dqs <= 'Z';
end if;
end if;
end process write;
|