Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Bidirectional Port Usage in VHDL?

Reply
Thread Tools

Bidirectional Port Usage in VHDL?

 
 
Pino
Guest
Posts: n/a
 
      07-01-2004
I'm not completely clear on how to use bidirectional ports in VHDL for
use with connecting to SDRAM shared data lines. How do I specify this
in my state machine if I am to read and then write to the line?

An example:

TX_RX_BUS :INOUT STD_LOGIC_VECTOR(31 DOWNTO 0);
....

CASE state IS

WHEN READ =>
TX_RX_BUS (31 DOWNTO 0) <= TX_RX_BUS (31 DOWNTO 0);

WHEN WRITE =>
TX_RX_BUS (31 DOWNTO 0) <= TX_RX_BUS (31 DOWNTO 0);
.....etc..

This is what I wrote in my code, but I am unclear what this actually
means. I know this is incorrect. What I want is somehow to place the
data content on the TX_RX_BUS line connected to my SDRAM, and then
when the SDRAM is in the READ state I can capture the contents of the
same bus as an input line.

Can anyone help me understand whether this is valid, and what the best
way to handle a shared bus for memory?


Regards,
Pino
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      07-02-2004
Pino wrote:

> I'm not completely clear on how to use bidirectional ports in VHDL for
> use with connecting to SDRAM shared data lines. How do I specify this
> in my state machine if I am to read and then write to the line?


http://groups.google.com/groups?q=vhdl+inout+oe

-- Mike Treseler
 
Reply With Quote
 
 
 
 
Pino
Guest
Posts: n/a
 
      07-02-2004
Mike Treseler <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Pino wrote:
>
> > I'm not completely clear on how to use bidirectional ports in VHDL for
> > use with connecting to SDRAM shared data lines. How do I specify this
> > in my state machine if I am to read and then write to the line?

>
> http://groups.google.com/groups?q=vhdl+inout+oe
>
> -- Mike Treseler


Thanks, I think this might be what I was looking for; however, just
one more clarification in case I mis-interpreted the solution. It
seems from this example you need to identify an input port, an output
port, and the bidirectional port.

When you want to be able to place data to the memory shared data line,
you take this from a instantiated input port and multiplex it directly
to the INOUT bidirectional port using an OE line; i.e, Z <= A;

If you want information from the memory data line, then you multiplex
in the data when OE = '0', and assign it to the bidirectional port,
but to what? This is where I am a bit confused.....sorry. That is Y
<= Z? Is this correct way of interpreting the response

Note Z represents the bidirectional port, A is an input port and Y is
an output port as per the example.

Your help is appreciated....
Pino
 
Reply With Quote
 
Just an Illusion
Guest
Posts: n/a
 
      07-02-2004
Hi Pino,

You must have something like:

Z : inout std_logic;
....

signal A, OE, Y : std_logic;


Z <= A when OE = '1' else '-';
Y <= Z ;

....

That would said that Y always follow the value of Z (and A when OE='1'),
and Z follow value of A only when OE = '1' (Z is output), in any other
case Z is input

JaI

Pino wrote:

>Mike Treseler <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
>
>
>>Pino wrote:
>>
>>
>>
>>>I'm not completely clear on how to use bidirectional ports in VHDL for
>>>use with connecting to SDRAM shared data lines. How do I specify this
>>>in my state machine if I am to read and then write to the line?
>>>
>>>

>>http://groups.google.com/groups?q=vhdl+inout+oe
>>
>> -- Mike Treseler
>>
>>

>
>Thanks, I think this might be what I was looking for; however, just
>one more clarification in case I mis-interpreted the solution. It
>seems from this example you need to identify an input port, an output
>port, and the bidirectional port.
>
>When you want to be able to place data to the memory shared data line,
>you take this from a instantiated input port and multiplex it directly
>to the INOUT bidirectional port using an OE line; i.e, Z <= A;
>
>If you want information from the memory data line, then you multiplex
>in the data when OE = '0', and assign it to the bidirectional port,
>but to what? This is where I am a bit confused.....sorry. That is Y
><= Z? Is this correct way of interpreting the response
>
>Note Z represents the bidirectional port, A is an input port and Y is
>an output port as per the example.
>
>Your help is appreciated....
>Pino
>
>


 
Reply With Quote
 
Nicolas Matringe
Guest
Posts: n/a
 
      07-02-2004
Just an Illusion a écrit:
> Hi Pino,
>
> You must have something like:
>
> Z : inout std_logic;
> ...
>
> signal A, OE, Y : std_logic;
>
>
> Z <= A when OE = '1' else '-';
> Y <= Z ;


Canonical form here is
Z <= A when OE = '1' else 'Z';

or, for vectors:
Z <= A when OE = '1' else (others => 'Z');

'-' is "don't care" (never understood what this stands for, actually),
not "high impedance".

--
____ _ __ ___
| _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
| | | | | (_| |_| | Invalid return address: remove the -
|_| |_|_|\__|\___/

 
Reply With Quote
 
Jim Lewis
Guest
Posts: n/a
 
      07-02-2004
Nicolas,
> '-' is "don't care" (never understood what this stands for, actually),


By differentiating '-' and 'X', it is possible to
do something reasonable for:
Y <= std_match(A, "10---100") ; -- see numeric_std

case1: If A is 10111100 then Y is true.
case2: If A is XXXXXXXX then Y is false.

If there were only 'X' and no '-', then case 2 would
be true. This would be bad. I believe that this is
one if the issues with Verilog's casex.

Cheers,
Jim
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training (E-Mail Removed)
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
 
Reply With Quote
 
Pino
Guest
Posts: n/a
 
      07-02-2004
Nicolas Matringe <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Just an Illusion a écrit:
> > Hi Pino,
> >
> > You must have something like:
> >
> > Z : inout std_logic;
> > ...
> >
> > signal A, OE, Y : std_logic;
> >
> >
> > Z <= A when OE = '1' else '-';
> > Y <= Z ;

>
> Canonical form here is
> Z <= A when OE = '1' else 'Z';
>
> or, for vectors:
> Z <= A when OE = '1' else (others => 'Z');
>
> '-' is "don't care" (never understood what this stands for, actually),
> not "high impedance".


Thanks this helps clarify the notational details I was trying to think
about. Although from the above example it definitely seems that the
correct way to do this is defining other input & output ports so that
you can tie the shared data bus onto something that can be used to
observe the data (i.e. the Y signal) when it is READ from the memory
and a data line that is required to place data (i.e A) for a WRITE on
the data bus. I had assumed that there was another way to do this.

Also just a point of additional confusing concerning OE. Is the OE
enable line absolutely required, or if in certain portions of my state
machine if I absolutely know that I'm going to READ and WRITE (ie I'm
in that logical state), can I just ignore the inclusion of this
additional input signal and place the data on the line and/or read the
data from the line and store it directly into Y or take the data
directly from A? However, I run into an issue in that I'm not sure
how to invoke my FSM at the higher level to place the data on the bus
line as in the above code, it's keeping things in tristate all the
time. It seems in this instance, that is what I can use the OE line
for.....can someone please help clarify this confusion.

Your help has been excellent thus far...!

Regards
Pino
 
Reply With Quote
 
Nicolas Matringe
Guest
Posts: n/a
 
      07-05-2004
Pino a écrit:
[...]
>
> Thanks this helps clarify the notational details I was trying to think
> about. Although from the above example it definitely seems that the
> correct way to do this is defining other input & output ports so that
> you can tie the shared data bus onto something that can be used to
> observe the data (i.e. the Y signal) when it is READ from the memory
> and a data line that is required to place data (i.e A) for a WRITE on
> the data bus. I had assumed that there was another way to do this.


What I wrote (and I think most VHDL writers do too ) is a description
of how it is actually done in hardware: you have an output buffer with a
tristate control input, and an input buffer:

_____ OE
|
|/|
___/ |___ A
| \ |
| \|
Z --|
| |\
|___| \___ Y
| /
|/


> Also just a point of additional confusing concerning OE. Is the OE
> enable line absolutely required, or if in certain portions of my state
> machine if I absolutely know that I'm going to READ and WRITE (ie I'm
> in that logical state), can I just ignore the inclusion of this
> additional input signal and place the data on the line and/or read the
> data from the line and store it directly into Y or take the data
> directly from A?


Y will always take data from Z. Always assign a value to A. Enable the
output (i.e. assert OE) only when you really output data.
The two lines I wrote must be placed only in the top-level VHDL file
(well not really "must" but it's more adviseable)


--
____ _ __ ___
| _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
| | | | | (_| |_| | Invalid return address: remove the -
|_| |_|_|\__|\___/

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bidirectional connection between two bidirectional ports Manfred Balik VHDL 12 09-10-2006 08:53 PM
SRAM controller bidirectional port VHDL bittor VHDL 0 12-22-2004 02:51 PM
Webchecker Usage - a problem with local usage Colin J. Williams Python 1 02-26-2004 12:28 AM
Need help on memory usage VS PF usage metfan Java 2 10-21-2003 01:58 PM
how to test benching a bidirectional port jtj VHDL 2 10-02-2003 06:14 PM



Advertisments