vhdl model length of wire with delay ?

T

Tony Benham

Hi,
I'm trying to connect the bidirectional databuses of two models together,
and create a delay in the path between them for a testbench. So in effect I
need a piece of wire with a delay that will connect two bidirectional
signals. So if neither bus is driving both ends of the 'wire' would be
tristate, but if either end drives the signal it should be delayed at the
other end of the 'wire', and driven.
I cannot see how to model this at the moment. Can anyone suggest a way of
doing this ?
Regards
Tony
 
J

Jonathan Bromley

I'm trying to connect the bidirectional databuses of two models together,
and create a delay in the path between them for a testbench. So in effect I
need a piece of wire with a delay that will connect two bidirectional
signals. So if neither bus is driving both ends of the 'wire' would be
tristate, but if either end drives the signal it should be delayed at the
other end of the 'wire', and driven.
I cannot see how to model this at the moment. Can anyone suggest a way of
doing this ?

It's hard, and a weakness of VHDL that it can't easily model such
things.

If you can, by any means at all, split the wire into two
unidirectional pieces, then it is easy. It's worth almost
any amount of effort to do that.

If you really, really can't do that, then there are some tricks
to play that will work in some special cases. For example, if
each bit of your wire is only ever driven with '0', '1', 'X' or
'Z', you can abuse the weak-value states 'H', 'L' and 'W' to
get something like the desired effect. But it's VERY tricky,
especially if either end of the bus has more than one driver
on it.

It's depressingly easy in Verilog: just annotate the wire's
declaration with a delay value.

Ben Cohen's website has a zero-delay bidirectional wire model.
It has some limitations, but it's a lot better than nothing
and you may be able to hack it to add a delay.

Finally, another possible approach is to modify each driver
on the wire so that it implements the delay *in the driver*.
This is messy because you must modify several bits of code,
but it's easy to understand and it's sure to work.

Good luck
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:[email protected]
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top