PLI: manipulating reg data through VPI

  • Thread starter Girish Venkataramani
  • Start date
G

Girish Venkataramani

Guest
Hi

I'm new to and trying to learn Verilog PLI -- specifically VPI. I have a
few questions:

1. Is there any good/standard documentation on VPI? I searched the web,
and could only find titbits.


2. Does VPI allow you to change values of registers/nets/ports? If so how?

2.(a) Is this different from the tf_ interface (where you can do this
through tf_getp() and tf_putp())?

2.(b) Do the regs/nets that I'm attempting manipulate be passed as
arguments to a user/system task (a la tf_ interface);

2.(c) If I had a handle to this register (by traversing the design
hierarchy), can I change/query the value of the register through VPI?

2.(d) I thought vpi_get_value() and vpi_put_value() were designed to
this. But, I'm apparently mistaken (since vpi_get_value only seems to
return information about the value *type*), or I'm not doing this
properly. Your comment on this will be appreciated.

3. Here's what I'm doing - I define a usertask that I call from the
$initial block of my top module. In this task, I start a separate thread
that is designed to run concurrently with the verilog simulation. I want
the verilog simulation and thread execution to interact by
sharing/manipulating values of "certain data items" in the Verilog
modules (could be registers, nets or nets connected to ports). I want to
be able to change the values held in certain registers from this thread
(using handles to regs obtained from traversing the design hierarchy).
Is this possible?

4. Any advice on this topic will be tremendously useful.

Thanks
Girish
 
Hi Girish,

Stu Sutherland has a great book that can be used to learn VPI. Its
title
is "The Verilog PLI Handbook".

It is indeed possible to get and put values through VPI, just like in
PLI 1.0.
You can pass nets/regs as arguments to a system task, or you can walk
around
the design to find them. vpi_get_value() and vpi_put_value() are the
routines
to use to get and put values for Verilog objects.

VPI is not thread safe, so you need to be carefull about accessing VPI
while using threads. Let me know if this sufficiently answers your
question.

-Chas
 
I am a new guy in digital design
Now I have PC version Debussy and Synopsys VCS
But I Open Debussy , find it need *.fsdb
when I use VCS to compiler *.v
I cannot create *.fsdb to feed in Debussy for wavefor view
Somebody tell me in VCS need CALL PLI to produce *.fsdb file
so my question is

1.What is PLI ?
2.how to call PLI in VCS (6.0), need another PLI software /Library?where can
I find it, or just in VCS include PLI then compiler it?
3.How to create *.fsdb in PC environment??
Can Anyone help me !

Very Appreciate!!!!


"Charles Dawson" <chas@cadence.com>
???????:d7349a3b.0309161137.584f0b53@posting.google.com...
Hi Girish,

Stu Sutherland has a great book that can be used to learn VPI. Its
title
is "The Verilog PLI Handbook".

It is indeed possible to get and put values through VPI, just like in
PLI 1.0.
You can pass nets/regs as arguments to a system task, or you can walk
around
the design to find them. vpi_get_value() and vpi_put_value() are the
routines
to use to get and put values for Verilog objects.

VPI is not thread safe, so you need to be carefull about accessing VPI
while using threads. Let me know if this sufficiently answers your
question.

-Chas
 
Hinet_news wrote:
I am a new guy in digital design
Now I have PC version Debussy and Synopsys VCS
But I Open Debussy , find it need *.fsdb
when I use VCS to compiler *.v
I cannot create *.fsdb to feed in Debussy for wavefor view
Somebody tell me in VCS need CALL PLI to produce *.fsdb file
so my question is
If you merely want to interface Debussy to VCS, there should
be instructions in the Debussy documentation for how to do that.
I believe Debussy has all the parts that you need, and I'm pretty
sure it is documented.
--
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
 
Excuse me if I am just sharing my ignorance, but an .fsdb file is a
"fast signal data base" file. It is a file that contains the waveform
information from running a simulation of your design. I'm not sure of
all of the steps to create one using VCS, but here we use Modelsym (or
our own hand-written simulator) to run the circuit and generate a .vcd
file and read that .vcd file into Debussy and it will then write out
an .fsdb file--so that the waveform is quicker to read back in a 2nd
time. (That is, if I recall the steps properly--I haven't looked at a
waveform in over a year.) Thus, an .fsbd (or a .vcd) file is not a
direct output of VCS, but an output a running a simulation (with some
stimulus). I believe if you tell Debussy the name of a .vcd file
(including the .vcd suffix), when it is looking for an .fsdb file,
Debussy will do the right thing. Of course, you have to get a .vcd
file first--and you do that by running your simulation with some
command that tells it to write out a .vcd file that traces the
signals.

Hope this helps,
-Chris

*****************************************************************************
Chris Clark Internet : compres@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
19 Bronte Way #33M voice : (508) 435-5016
Marlboro, MA 01752 USA fax : (508) 251-2347 (24 hours)
------------------------------------------------------------------------------
 

Welcome to EDABoard.com

Sponsor

Back
Top