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

Reply

VHDL - ModelSim & tcl testbench

 
Thread Tools Search this Thread
Old 10-07-2003, 06:52 PM   #1
Default ModelSim & tcl testbench


I'm reasonably OK at writing VHDL code & testbenches, but I now need to
write a testbench in tcl rather than VHDL
so I can control the flow better. (I have a counter that wraps at 5
seconds, so i want to use FORCE to make it jump from a low to a high value,
by using the WHEN command in tcl.
(There's also a large counter that wraps every 550 years! Dont ask, it's
what the softies require, but even they can't explain).

However, I don't really know where to start although I have done some simple
tcl programming & scripting.

1. Do I just read in the VHDL design entity into ModelSim
2. Anyone have a sample/simple bit of code.
3. Point me a t the right website "tcl & modelsim for idiots" etc.

Regards, Niv.

--
remove ***SPAM-OFF** to reply




Niv
  Reply With Quote
Old 10-07-2003, 07:57 PM   #2
Jonathan Bromley
 
Posts: n/a
Default Re: ModelSim & tcl testbench
"Niv" <niv**mines_a_pint_you_spamheads**@ntlworld.com> wrote in
message news:V8Dgb.41$...

> I'm reasonably OK at writing VHDL code & testbenches, but I now
> need to write a testbench in tcl rather than VHDL so I can
> control the flow better.


VHDL can do control stuff pretty well, too... are you *sure* you need
a Tcl testbench?

> Dont ask, it's what the softies require, but even they can't explain


hmmm... I sympathise.

> 1. Do I just read in the VHDL design entity into ModelSim


You *can* do that, but you are likely to end up with a very inefficient
(slow) simulation because you need interaction between Tcl and the
simulator for each and every input signal transition. It's likely
to be far better to write the detailed time-dependent signal-wiggling
stuff in a VHDL test harness, and provide a few signals to control its
functionality. You can then manipulate those "control knobs" from
your Tcl jacket using [force] commands.

> 2. Anyone have a sample/simple bit of code.


Sure. Fancy coming on one of our Tcl courses?

You need to learn just three new ModelSim commands: [force], [when]
and [examine]. Read the docs on them, in detail. Note that you can
[force] signal changes planned for the future, and [examine] signal
values in the past; that means you don't need to stop and start the
sim very frequently, but instead you can run it in "batch mode",
setting-up numerous planned signal changes and then examining all
their effects when you eventually stop the sim.

> 3. Point me at the right website "tcl & modelsim for idiots" etc.


Not too many idiots visit our website, but you may still find a few
hints and code snippets at
www.doulos.com/knowhow/tcltk

We also have some nifty tricks for interaction between a running VHDL
sim and a Tcl program using pipes, but that is MUCH too interesting
to give away on the NG...

When you get really good at this stuff you will find yourself
controlling ModelSim from Tcl via a sockets interface. Ask your
friendly local Mentor rep about this, because the standard docs
don't say too much about it.

Enjoy.
--
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, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
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.





Jonathan Bromley
  Reply With Quote
Old 10-07-2003, 09:26 PM   #3
Mike Treseler
 
Posts: n/a
Default Re: ModelSim & tcl testbench
Niv wrote:
> I'm reasonably OK at writing VHDL code & testbenches, but I now need to
> write a testbench in tcl rather than VHDL


> (There's also a large counter that wraps every 550 years!


Consider passing the counter reset value to the entity
as a generic constant.

Make the default is all zero, so synthesis is not affected.

The VHLD testbench can then drive multiple instances
with different generic reset values,
say zero and 549.99999 years.

-- Mike Treseler



Mike Treseler
  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
Error in Modelsim 6.0a boitsas Software 1 10-26-2009 05:36 AM
Xilinx 7.1 and testbench error boitsas Software 0 01-15-2008 04:14 PM
simprim problems on modelsim saiyijinprince Hardware 2 04-05-2007 02:24 PM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 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