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

Reply

VHDL - VHDL newbie question about wires???

 
Thread Tools Search this Thread
Old 03-15-2006, 11:57 PM   #1
Default VHDL newbie question about wires???


Hi,

I've just started using Xilinx ISE 7.1i and ModelSim (trial license).
I've seen some samples and created a few 7400 logic gates which compile
and I've seen waveforms of the various I/O.

I've can not get my head around wires and drivers. For example how
does one connect three devices together which bidirectional? I mean
say 3 74hc245's? On a drawing I'd just connect the buses together and
come up with combinational logic for the output enable (G) lines and
direction lines.

A -----------o--------------B
|
|
C

The only way I could come up with is a switch statement with lots of
assigns like
A <= B
A <= C
B <= A
B <= C
C <= A
C <= B

GD



coxsterdillon@hotmail.com
  Reply With Quote
Old 03-16-2006, 04:21 AM   #2
radarman
 
Posts: n/a
Default Re: VHDL newbie question about wires???
Depends on the part, though most synthesis tools will correctly map to
LUTS if the part doesn't support true internal tri-states.

Try:

Ts_Out <= Sig_A when Ctrl_A = '1' else 'Z';
Ts_Out <= Sig_B when Ctrl_B = '1' else 'Z';
Ts_Out <= Sig_C when Ctrl_B = '1' else 'Z';

Make sure you pull up (or pulldown) the output at some point:
Ts_Out <= 'H';

Note, you may have to add an attribute to Ts_Out to get the tristate
pullup/pulldown, in which case you would need to add -- synthesis
translate_off/translate_on statements around the pullup model.

For parts that do support internal tristates, like the Xilinx XC4000
series, this will work just like it appears. On more modern
architectures, that don't support internal tri-states, the synthesizer
will silently replace the whole structure with muxes - or, pretty much
what you described.

BTW - if you know your target part doesn't support internal tri-states
(and most modern parts don't) study how you would solve the problem
with muxes - since that is what the synthesizer will do for you anyway.
This way, your code will be more clear (or at least closer to what is
actually generated in hardware)

It also pays to study the datasheet for the device you are targetting.




radarman
  Reply With Quote
Old 03-16-2006, 02:16 PM   #3
Peter
 
Posts: n/a
Default Re: VHDL newbie question about wires???

skrev:

> Hi,
>
> I've just started using Xilinx ISE 7.1i and ModelSim (trial license).
> I've seen some samples and created a few 7400 logic gates which compile
> and I've seen waveforms of the various I/O.
>


Hi,

Forget everything about 7400 gates and start think functions. Try to
concentrate on what you want to create, instead of what was available
in the past. You will not see any benefit in VHDL if you hold on to
whats in the 7400 databook. Using small building blocks you get a big
overhead in component declarations, instatiations and wires. What you
can create with 7400 building blocks on one or two pages can often be
described with 5-10 lines of VHDL.
Tristate buses cant be used in programmable logic. Instead you must use
multiplexer structures.

Regards, Peter



Peter
  Reply With Quote
Old 03-16-2006, 04:56 PM   #4
Duane Clark
 
Posts: n/a
Default Re: VHDL newbie question about wires???
Peter wrote:
> ...
> Tristate buses cant be used in programmable logic. Instead you must use
> multiplexer structures.


I believe the various XC4000 families of Xilinx FPGAs had true tristate
internal buses. The synthesis tools I am aware of (XST and Synplify)
will correctly handle VHDL code for internal tristate buses in all newer
Xilinx FPGAs, too. Of course, it will physically be implemented with
multiplexers.

So maybe it would be preferable if programming FPGA internal logic to go
ahead and use multiplexers, but I think "must" might be a bit strong
Anyway, it wasn't clear to me the OP was talking about using them inside
an FPGA. Tristate buses are used all the time in testbenches, so he
would need to now how to write them for that case.


Duane Clark
  Reply With Quote
Old 03-16-2006, 06:14 PM   #5
Mike Treseler
 
Posts: n/a
Default Re: VHDL newbie question about wires???
wrote:

> I've just started using Xilinx ISE 7.1i and ModelSim (trial license).
> I've seen some samples and created a few 7400 logic gates which compile
> and I've seen waveforms of the various I/O.
> I've can not get my head around wires and drivers.


It is possible to create a design entity
at the wire and multiplexer level using vhdl,
as others have explained.

I find it more efficient to describe only
how the output ports are to be updated
at each clock tick, and leave the details
up to synthesis. For example, this netlist:

http://home.comcast.net/~mike_treseler/uart.pdf

includes over 50 muxes and hundreds of wires,
but few of these structures are specifically
described in the design entity source here:

http://home.comcast.net/~mike_treseler/uart.vhd


-- Mike Treseler



Mike Treseler
  Reply With Quote
Old 03-17-2006, 08:20 AM   #6
Peter
 
Posts: n/a
Default Re: VHDL newbie question about wires???
>Tristate buses are used all the time in testbenches, so he
> would need to now how to write them for that case.


Agreed!

/Peter



Peter
  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
Sorry for the painfully newbie question Chip L DVD Video 2 03-20-2007 03:25 PM
Newbie Question (with apologies to those who have gone before me) newatthis DVD Video 0 07-16-2006 08:53 PM
16:9 newbie type question ng_reader DVD Video 3 01-13-2005 03:38 AM
Another newbie question Jerold Pearson DVD Video 1 12-11-2004 02:25 AM
Newbie Question: DVD Capacities Chris Kotchey DVD Video 3 09-29-2004 03:49 PM




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