FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-20-2006, 06:34 AM
Andrew FPGA
Guest
 
Posts: n/a
Default Are there any Modelsim hooks to allow testbench code to figure out procedure call stack?

Hi,
We are using Modelsim Xilinx Edition III 6.0d. Throughout my testbench
I make calls to procedures that generate stimulus or check results.
Sometimes these procedures might detect an errror condition and I use

report "Warning: BusWrite() detected invalid bus state prior to writing
to the bus"

Then if this error or warning condition occurs modelsim prints the
following in the transcript window.

# ** Note: Warning: BusWrite() detected invalid bus state prior to
writing to the bus"
# Time: 508552 ns Iteration: 0 Instance:
/pcmrxinterfacetxframerhornettb

The problem is, I make calls to BusWrite() in lots of places in my
testbench. How can I figure out which one of those calls was the one
that caused the message to be printed?

Are there any modelsim hooks that would allow my testbench code to
figure out the call stack and/or where in the source the procedure got
called from. I could print this info along with my error message above.


Regards
Andrew

Reply With Quote
  #2 (permalink)  
Old 04-20-2006, 07:57 AM
Mike Treseler
Guest
 
Posts: n/a
Default Re: Are there any Modelsim hooks to allow testbench code to figureout procedure call stack?

Andrew FPGA wrote:

> # ** Note: Warning: BusWrite() detected invalid bus state prior to
> writing to the bus"
> # Time: 508552 ns Iteration: 0 Instance:
> /pcmrxinterfacetxframerhornettb
>
> The problem is, I make calls to BusWrite() in lots of places in my
> testbench. How can I figure out which one of those calls was the one
> that caused the message to be printed?


Only by the time.
Bring up the waves and put a cursor on it.

> Are there any modelsim hooks that would allow my testbench code to
> figure out the call stack and/or where in the source the procedure got
> called from.


You could set a breakpoint in the source.

-- Mike Treseler
Reply With Quote
  #3 (permalink)  
Old 04-20-2006, 11:38 AM
Guest
 
Posts: n/a
Default Re: Are there any Modelsim hooks to allow testbench code to figure out procedure call stack?

Why not pass an additional parameter to BusWrite() that identifies the
caller

eg if you have 4 drivers, pass D1..D4 as a parameter with the call and
include this in any messages output.

ie.
# ** Note: Warning: D1 - BusWrite() detected invalid bus state prior to

writing to the bus"

- Norm

Reply With Quote
  #4 (permalink)  
Old 04-20-2006, 04:26 PM
Bill Mills
Guest
 
Posts: n/a
Default Re: Are there any Modelsim hooks to allow testbench code to figure out procedure call stack?

[email protected] wrote:
> Why not pass an additional parameter to BusWrite() that identifies the
> caller
>
> eg if you have 4 drivers, pass D1..D4 as a parameter with the call and
> include this in any messages output.
>
> ie.
> # ** Note: Warning: D1 - BusWrite() detected invalid bus state prior to
>
> writing to the bus"
>
> - Norm


A variation of this is to add a parameter to return the status of the
BusWrite procedure, and let the caller handle it.

Reply With Quote
  #5 (permalink)  
Old 04-20-2006, 11:56 PM
Andrew FPGA
Guest
 
Posts: n/a
Default Re: Are there any Modelsim hooks to allow testbench code to figure out procedure call stack?

Mike Treseler wrote:

> You could set a breakpoint in the source.
>

Embarrassed to admit I hadn't thought of that. Works well in this case,
I break and then step through until the procedure returns.

But I can imagine for more complicated testbenches, it won't be so easy
to step out quickly. I'm trying to move away from the modelsim gui and
be more automated about my testing. Say I run the testbench in batch
mode overnight and the assert happens near the end of the run...

Reply With Quote
  #6 (permalink)  
Old 04-21-2006, 12:01 AM
Andrew FPGA
Guest
 
Posts: n/a
Default Re: Are there any Modelsim hooks to allow testbench code to figure out procedure call stack?

Ok, but the downside is I need to remember to pass in unique
identifiers each time I make the call.

Reply With Quote
  #7 (permalink)  
Old 04-21-2006, 12:34 AM
Mike Treseler
Guest
 
Posts: n/a
Default Re: Are there any Modelsim hooks to allow testbench code to figureout procedure call stack?

Andrew FPGA wrote:

> But I can imagine for more complicated testbenches, it won't be so easy
> to step out quickly. I'm trying to move away from the modelsim gui and
> be more automated about my testing. Say I run the testbench in batch
> mode overnight and the assert happens near the end of the run...


There are two phases to simulation:
debugging errors and regressing changes.

The GUI is useful for ad hoc debugging phase.
I want as much information as possible
to find the errors. But one they are
found and fixed, this effort is reduced to
comments in the code.

Once everything is working and meets timing
I need to close the loop on the testbench.
Here, I run a simulation to quickly verify that my small
change has not broken any major function that was
working before. I want to verify all the critical
expected values and see either
a PASS at the end or a break at the first
failure.

Have a look at my reference testbench for
an example.

-- Mike Treseler
Reply With Quote
Reply

Bookmarks


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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
testbench procedure trouble Toby VHDL 12 02-19-2005 04:09 PM
testbench procedure trouble Toby VHDL 0 02-11-2005 04:09 PM
How to drive record fields from procedure AND testbench? Joe Vanderwall FPGA 11 05-09-2004 08:40 PM
Modelsim 5.8 corrupt call stack when adding signals to wave window. Marcus Svensson FPGA 2 12-03-2003 06:13 PM


All times are GMT +1. The time now is 12:03 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved