FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2005, 06:37 AM
Guest
 
Posts: n/a
Default 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;

Reply With Quote
  #2 (permalink)  
Old 11-03-2005, 10:39 AM
Symon
Guest
 
Posts: n/a
Default Re: Using inout ports in VHDL


<[email protected]> wrote in message
news:[email protected] oups.com...
> 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
>

**********
Are you sure you meant 'read_data' there? Else it only tristates when you're
not reading. I think.
HTH, Syms.
**********
>
> ddr_dq <= (others => 'Z');
> ddr_dqs <= 'Z';
> end if;
> end if;
> end process write;
>



Reply With Quote
  #3 (permalink)  
Old 11-03-2005, 10:41 AM
anupam
Guest
 
Posts: n/a
Default Re: Using inout ports in VHDL

The inout buses are controlled in the same manner as in or out buses
Make sure that the ddr_dq and u_data_i are getting values at the
previous edge of when u expects the data in the inout bus.

Reply With Quote
  #4 (permalink)  
Old 11-08-2005, 05:15 PM
gkirilov
Guest
 
Posts: n/a
Default re:Using inout ports in VHDL

Put the data busses out of the process. Write it as a concurren
statement and use one output_enable(OE) signal to control the inou
bus

inout_bus <= out_bus when OE = '1' ELSE (OTHERS => 'Z')
in_bus <= inout_bus

In this way you write to the INOUT only when OE is 1
The in_bus is always reading the INOUT

Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
modeling of the propagation delay between two inout ports Jim Verilog 5 11-16-2005 09:03 PM
Connecting two INOUT ports CODE_IS_BAD FPGA 1 06-08-2005 11:19 AM
I can't set inout port in vhdl code suntthekid FPGA 2 11-12-2004 06:56 AM
VHDL inout used for non bidirectional uses Brad Smallridge FPGA 6 09-29-2004 08:19 AM
inout ports? CupOfWater Verilog 2 10-10-2003 09:32 AM


All times are GMT +1. The time now is 12:21 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved