Fortran subroutines in Cadence

G

greendays_01

Guest
Hi

I have a new DGMOSFET model written in PowerSpice. This PowerSpice
model calls a fortran subroutine to calculate the current through the
DGMOSFET. Now, my task is to import this model into Cadence, so that I
can run simulation with the model in Analog Artist.

However, I realize that Cadence doesn't support PowerSpice. So does
any of you know what should I do? Here is what I come up with:

1) Translate the model (including the fortran subroutine) to SPICE
and put it in Cadence
2) Translate the model (including the fortran subroutine) to
VerilogA and put it in Cadence

So which of the above method is better?
Also, I have another question that I would like to ask

Q1) Can I call a fortran function in a SPICE file?
For example, can I model the a current souce like this:

I1 1 0 FUN1(arg1, arg2, .....)

where FUN1 is a fortran subroutine that calculats current

Comment of suggestion of any kind is appreciated. Thank you very much

Chris
 
If you have to translate you model to
Analog Artist you have to make sure for which simulator.

Analog Artist is just the GUI for a bunch of Cadence internal
or external simulators of other EDA vendors.

I guess you have to translate the model to Spectre the most
used simulator within Analog Artist.

Then you should use Spectre syntax for your model.
You can either use a Spectre model and call a VerilogA
behavioural model for you current calculations or
use the Spectre internal bsource component for that.

Have a look at the Cadence documentations.
Unfortunately I have no glue about PowerSpice, what kind
of model is your DGMOSFET model?

Bernd
 
On Oct 10, 11:48 pm, "greendays_01" <siulun...@gmail.com> wrote:

Also, I have another question that I would like to ask

Q1) Can I call a fortran function in a SPICE file?
For example, can I model the a current souce like this:

I1 1 0 FUN1(arg1, arg2, .....)

where FUN1 is a fortran subroutine that calculats current
Have a look at appendix C in spectreuser.pdf. There it is described how
to create plugins in C/C++ with gcc. Don't know much more about fortran
than I need to know, but maybe the gnu compiler can even massage your
fortran into a *.so that you can load.

--
Svenn
 
Svenn Are Bjerkem wrote:
On Oct 10, 11:48 pm, "greendays_01" <siulun...@gmail.com> wrote:


Also, I have another question that I would like to ask

Q1) Can I call a fortran function in a SPICE file?
For example, can I model the a current souce like this:

I1 1 0 FUN1(arg1, arg2, .....)

where FUN1 is a fortran subroutine that calculats current


Have a look at appendix C in spectreuser.pdf. There it is described how
to create plugins in C/C++ with gcc. Don't know much more about fortran
than I need to know, but maybe the gnu compiler can even massage your
fortran into a *.so that you can load.
It has long been possible to co-compile fortran and C, and since o.p.
only has a Fortran subroutine, the main routine can be in C/C++.

But the appendix C you mention, although it explains a lot about
the path where the compiled files have to be put, does not actually
address the question of how the function header in the C-code itself
should look like. In fact it doesn't show any C-code examples at all.

So the question above, about the function and its arguments to describe
a current source, is probably described somewhere else in the
documentation. Does anyone know where?

-- Jos
 
Jos Bergervoet wrote:

But the appendix C you mention, although it explains a lot about
the path where the compiled files have to be put, does not actually
address the question of how the function header in the C-code itself
should look like. In fact it doesn't show any C-code examples at all.
This statement made me suspicious and I went off to sourcelink to
check, and you are right, in documentation to versions prior to 5.2
appendix C is called "Using Compiled-Model Interface" and contains a
lot of places to place stuff and no C-code.

I was, in the hurry of giving a bit of advice, only checking in the
documentation of the version I had in front of me and that was a later
version where appendix C is called: "Netlist Compiled Functions (NCF)"
and does contain some C-code explaining how to create a plugin. Unless
you have version 5.2 or 6.0 you will probably not have this interface
at all and thus have to wait for it to land on your harddisk.

So the question above, about the function and its arguments to describe
a current source, is probably described somewhere else in the
documentation. Does anyone know where?
If you have access to Sourcelink, then try a search on Fortran there
and you will come up with the cspiceref.pdf for 5.1.41. A statement
tells that Fortran support is not a part of the standard Cadence
program so you got to talk to somebody at Cadence about that.

Unless somebody from Cadence step up and give other information, I
would wait for 6.0 or 6.1 to become a part of my design flow.
--
Svenn
 
I was, in the hurry of giving a bit of advice, only checking in the
documentation of the version I had in front of me and that was a later
version where appendix C is called: "Netlist Compiled Functions (NCF)"
and does contain some C-code explaining how to create a plugin. Unless
you have version 5.2 or 6.0 you will probably not have this interface
at all and thus have to wait for it to land on your harddisk.
Hi,

NCF is an interface that allows you to create functions in
C/C++/Fortran, compile them into a shared object, load that shared
object into Specte/UltraSim and then call the functions from the
netlist. However, the functions are still only netlist functions. They
will not be called during an analysis, and their arguments cannot be
voltages/currents. NCF is very useful if you have complex expressions
that you cannot code in the netlist or want to move from the netlist,
but does not solve the problem of adding an arbitrary behavioral
function to Spectre.

You best options are
0. Check to see if an existing model compares to the model you
are trying to implement. You could get lucky and end up just
aliasing parameters, but this is unlikely hence the 0.
1. If an existing model can be used as the core, you could wrap
it in a sub-circuit and use bsources or Verilog-A to add new
elements around it.
2. You could code the new model completely in Verilog-A, and
use ADMS or Spectre's Compiled Verilog-A flow to compile the
code.
3. The more difficult but the most flexible approach is to use CMI
to add the new model to Spectre, just as all other devices are
added. If you already have the code for the equation evaluation,
derivative calculation, this may be the best approach. To use
CMI you must have access to the CMI documentation, headers,
etc. You should contact you CAD group. They will have this
information.

Best Regards,
John
 
On 12 Oct 2006 16:38:49 -0700, "Svenn Are Bjerkem" <svenn.are@bjerkem.de> wrote:

If you have access to Sourcelink, then try a search on Fortran there
and you will come up with the cspiceref.pdf for 5.1.41. A statement
tells that Fortran support is not a part of the standard Cadence
program so you got to talk to somebody at Cadence about that.

Unless somebody from Cadence step up and give other information, I
would wait for 6.0 or 6.1 to become a part of my design flow.
John has answered the NCF bit, but the above reference for cdsSpice is for an
extremely obsolete product - the old Cadence SPICE simulator. It's not going to
be any use to anyone, so don't spend time talking to Cadence about this...

All the "socket" interfaces which used cdsSpice have gone in IC5251, and
cdsSpice itself is no longer there in the upcoming IC610 release.

Regards,

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.
 

Welcome to EDABoard.com

Sponsor

Back
Top