The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> PLI functionality in VerilogA
https://designers-guide.org/forum/YaBB.pl?num=1081617978

Message started by cupric on Apr 10th, 2004, 10:26am

Title: PLI functionality in VerilogA
Post by cupric on Apr 10th, 2004, 10:26am

Is it possible to run a C executable from inside a VerilogA module and use its results as the output of my VerilogA module.

For example:
Suppose my module's output is the sum of the inputs to the module in1 and in2. Now, can I write a C function and call it from inside VerilogA module which passes the instantaneous input values to produce the desired output.

thanks!
cupric

Title: Re: PLI functionality in VerilogA
Post by Andrew Beckett on Apr 12th, 2004, 4:39am

In spectre this isn't possible. It may be possible with AMS Designer, but I've never tried it (I've done it with ncsim but
never got around to it with AMS - I'll have to give it a try at
some point!)

Can you not write the algorithm in Verilog-A directly?

Andrew.

Title: Re: PLI functionality in VerilogA
Post by cupric on Apr 16th, 2004, 10:28am

Basically, I need to do some matrix manipulation (solving Ax=B) which in turn, would generate the output of my VerilogA module. Now, if I try implementing this in VerilogA, first, it would be really complicated and huge (and I can't use a standard matrix package) and second, will be really slow due to the interpretive nature of VerilogA.

Hence, I was thinking of using some sort of PLI.

Also, I am a bit confused by what ncsim and AMS designer are and how are they different from spectre. Are they different simulators from Cadence (??) or some other company?

cupric

Title: Re: PLI functionality in VerilogA
Post by Andrew Beckett on Apr 17th, 2004, 11:51pm

AMS Designer is Cadence's mixed signal simulator. It is a single executable simulator, based around the spectre kernel (for the analog solver) and ncsim (for the digital "solver"). ncsim is Cadence's mixed-language digital simulator (the "nc" means "native code" because it uses a compiler approach).

The simulator supports:

Verilog
VHDL
Verilog-AMS
Verilog-A
VHDL-AMS
spectre/spice subckts and models

ncsim itself supports PLI - and so would AMS Designer. What I've not tried is using PLI in any mixed-signal module, but I have in the past with ncsim written PLI functions which manipulate real numbers, so you could almost certainly do this somehow.

There are lots of advantages in AMS Designer - models can be more efficient by allowing true mixed-signal models with Verilog-AMS (can have both digital and analog content in the same module - the digital is handled via the event driven simulation engine, and the analog content by the matrix-solved analog engine).

If I have a chance, I'll try to have a play with PLI in AMS and report back.

BTW, if you're going to look at this, I'd recommend looking at the "vpi" (PLI 2.0) interface rather than the older PLI 1.0
interface - it's much cleaner.

Regards,

Andrew.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.