Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Bidirectional bus in Spartan-3

 
Thread Tools Search this Thread
Old 09-09-2005, 12:13 AM   #1
Default Bidirectional bus in Spartan-3


Hi,

I am using Spartan-3 XC3S200 and trying to build a bidirectional bus
('port_1'). Through this bus I put some data (data_ram_out) from internal
BRAM to the output of the chip (generator mode) in one situation (signal
'generator' =1) and sample data from input to BRAM (analyzer mode) in the
second situation (generator = 0). To make this possible, I used the template
from ISE Webpack:

buf_loop: for i in 0 to 7 generate
begin

IOBUF_inst : IOBUF
generic map (
DRIVE => 12,
IOSTANDARD => "DEFAULT",
SLEW => "SLOW")

port map (
O => data_0_7(i), -- Buffer output
IO => port_1(i), -- Buffer inout port (connect directly to
top-level port)
I => data_ram_out(i), -- Buffer input
T => not generator -- 3-state enable input
);

end generate buf_loop;

(My port and signals:

port_1 : inout std_logic_vector(7 downto 0);

signal data_0_7 : std_logic_vector(7 donwto 0);
signal data_ram_out : std_logic_vector(7 downto 0);
signal generator : std_logic;
)

But it seems like only analyzer mode is working ok. (when I make a little
change: ' T => generator' , only the generator mode works).
What could I do wrong? Did you ever use the IOBUF with success? Or tried any
other way of creating a bidirectional bus?

Regards,
Tomek




rybol
  Reply With Quote
Old 09-09-2005, 03:35 AM   #2
Andrew FPGA
 
Posts: n/a
Default Re: Bidirectional bus in Spartan-3
Another way is:

--inside the architecture body
data_in <= data_bus;
data_bus <= data_out when drive_bus = '1' else (others => 'Z');

or

TristateDriver: process(data_out, drive_bus)
begin
if(drive_bus = '1') then
data_bus <= data_out;
else
data_bus <= (others => 'Z');
end if;
end process TristateDriver;

You can also use the .ucf file to assign slew rate, drive strength etc
properties to IO.

Regards
Andrew

rybol wrote:
> Hi,
>
> I am using Spartan-3 XC3S200 and trying to build a bidirectional bus
> ('port_1'). Through this bus I put some data (data_ram_out) from internal
> BRAM to the output of the chip (generator mode) in one situation (signal
> 'generator' =1) and sample data from input to BRAM (analyzer mode) in the
> second situation (generator = 0). To make this possible, I used the template
> from ISE Webpack:
>
> buf_loop: for i in 0 to 7 generate
> begin
>
> IOBUF_inst : IOBUF
> generic map (
> DRIVE => 12,
> IOSTANDARD => "DEFAULT",
> SLEW => "SLOW")
>
> port map (
> O => data_0_7(i), -- Buffer output
> IO => port_1(i), -- Buffer inout port (connect directly to
> top-level port)
> I => data_ram_out(i), -- Buffer input
> T => not generator -- 3-state enable input
> );
>
> end generate buf_loop;
>
> (My port and signals:
>
> port_1 : inout std_logic_vector(7 downto 0);
>
> signal data_0_7 : std_logic_vector(7 donwto 0);
> signal data_ram_out : std_logic_vector(7 downto 0);
> signal generator : std_logic;
> )
>
> But it seems like only analyzer mode is working ok. (when I make a little
> change: ' T => generator' , only the generator mode works).
> What could I do wrong? Did you ever use the IOBUF with success? Or tried any
> other way of creating a bidirectional bus?
>
> Regards,
> Tomek




Andrew FPGA
  Reply With Quote
Old 09-09-2005, 07:30 AM   #3
ajahn
 
Posts: n/a
Default Re: Bidirectional bus in Spartan-3
Hi Tomek,
you say, both modes work correct when you change the t => (not)
generator assignment?
Without taking a closer look, that sounds like your io-buffers work
okay, but you should check on what the generator signal does: Does it
switch the correct way?
Cheers,
Andreas.



ajahn
  Reply With Quote
Old 09-09-2005, 09:04 AM   #4
rybol
 
Posts: n/a
Default Re: Bidirectional bus in Spartan-3
> Hi Tomek,
> you say, both modes work correct when you change the t => (not)
> generator assignment?
> Without taking a closer look, that sounds like your io-buffers work
> okay, but you should check on what the generator signal does: Does it
> switch the correct way?
>


Of course, the generator signal 'didn't switch the correct way', but now
everything works fine.
Thanky you very much!

Tomek




rybol
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
vhdl bidirectional transceiver with enable qtr Hardware 1 08-22-2007 06:30 AM
vhdl code for bidirectional transceiver qtr General Help Related Topics 0 07-05-2007 05:00 PM
DVD Verdict reviews: HELLBOY, SPARTAN, THE A-TEAM: THE COMPLETE FIRST SEASON, and more! DVD Verdict DVD Video 0 08-16-2004 10:03 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46