The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 6:38am
Pages: 1
Send Topic Print
Obtaining dynamic CPU time during Verilog execution (Read 3515 times)
cmolsen
Junior Member
**
Offline



Posts: 10
NY
Obtaining dynamic CPU time during Verilog execution
Aug 21st, 2009, 4:27pm
 
I would like to obtain CPU time at any given point within Verilog code or at least on every entry/iteration of the VA code or on every converged iteration.  The purpose of this is to debug runtime.

To what extent is this possible?

I can't find any Verilog functions that do this. So I'm guessing I may have to use the VPI to interface in a C program which accesses time and then passes it to the Verilog module.  

Assuming I have to go the VPI route, I have looked into this as follows:

In the Accellera Verilog manual there's a VPI example which does something like what I want to do, namely the report_cpu() function.  

As a start I've tried implementing some very simple VPI function in C which only requires including vpi_user.h for say printing "vpi_printf("hello");".  But VPI include files are nowhere to be found in my company's Spectre or Hspice install environments.

Is VPI supposed to be bundled with a Spectre or Hspice install?  Does it need to be activated?  Or is this a separate install and if so, from where?

Michael
Back to top
 
 
View Profile   IP Logged
Peruzzi
Community Member
***
Offline



Posts: 71

Re: Obtaining dynamic CPU time during Verilog execution
Reply #1 - Aug 22nd, 2009, 10:00am
 
Quick and dirty approach would be through waveform display.  Show evaluation points as well as smoothed waveform.  This may be enough for you to debug your situation.

Bob P.
Back to top
 
 
View Profile   IP Logged
Sumit Adhikari
Community Member
***
Offline



Posts: 44

Re: Obtaining dynamic CPU time during Verilog execution
Reply #2 - Aug 22nd, 2009, 8:19pm
 
It should come with your basic installation and you dont need to do
anything else. Just go to installation directory and type this command :
find . -name "vpi*.h"
I think you will be able to find the include path.
If not report your tool vendor.
BR,
Sumit
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Obtaining dynamic CPU time during Verilog execution
Reply #3 - Aug 25th, 2009, 7:34am
 
You can't use VPI with spectre, only with AMS Designer (ncsim).

You can also use $debug() to output statements on every iteration, although I don't think you can output CPU time information.

Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.