On May 28, 9:44=A0am, rickman <gnu...@[EMAIL PROTECTED]
> wrote:
> On May 28, 7:55 am, KJ <kkjenni...@[EMAIL PROTECTED]
> wrote:
>
> > On May 27, 4:37 pm, rickman <gnu...@[EMAIL PROTECTED]
> wrote:
>
> > > I was considering what it will take to implement a bi-directional
> > > switch in VHDL and found this by Peter Ashenden. =A0The method is
pret=
ty
> > > much what I had thought of,
>
> > > I haven't simulated this. =A0Any idea if I am off base here?
>
> > Another example you might want to look at is Ben Cohen's zero ohm
> > resistor model.
>
>
>http://www.google.com/search?hl=3Den&rlz=3D1G1GGLQ_ENUS278&q=3D%22Ben+Coh=
en...
>
> > KJ
>
> I may have replied too soon. =A0I'm not sure his resistor even works.
> If A and B have different values, the model will drive each bus with a
> 'Z' initially. =A0Then after a delta delay each bus will be driven with
> the state of the other. =A0This will put an 'X' on each bus. =A0This
> triggers the process again and the model drives a 'Z' again. =A0Now the
> value of the bus returns to the values driven by the A and B drivers
> and the process repeats. =A0It looks to me like it will infinite loop
> oscillating, just advancing delta times and never advance in real
> time.
>
> Again, a simulation is worth a thousand code reviews.
>
I've used Ben's model and it 'works', but only under specific sets of
conditions whether they apply to your case or not I don't know. I'll
also say that I haven't run across a model for a resistor that works
under all configurations that you would use a resistor in, I'm
guessing that the bi-directional switch that you're working on might
be just as difficult.
Some typical resistor configuration and the problems that might occur:
- Series termination. Output can't go to 'Z' even for a delta cycle
on any sort of 'clock' signal or the 'rising_edge()' VHDL function
will fail.
- Pullup and down termination (i.e. 220/330 typical). You need to
ignore the larger valued resistor.
- Differential termination (i.e. 100 ohm across a pair). You need to
totally ignore the resistor.
As a result I came up with a handful of different resistor models and
used a VHDL configuration to select the appropriate one to use. The
PCBA model was generated by a CAD system which makes the model very
accurate but then not really directly editable since it would get
overwritten every time the schematic was updated.
Kevin Jennings


|