The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 8:35am
Pages: 1 2 
Send Topic Print
Using a SPICE subcircuit in Spectre (Read 247 times)
vivkr
Community Fellow
*****
Offline



Posts: 780

Using a SPICE subcircuit in Spectre
Oct 02nd, 2007, 7:08am
 
Hi,

I am trying to include a SPICE model of a standalone component in my schematic made with Virtuoso.

The model is defined as a SPICE subcircuit. I think that some small format change is needed, but I have been
away from SPICE for years and don't remember anymore how one could convert a SPICE subckt to be used
with Spectre.

I tried the following:

1. Directly created a SPICE view and changed my reference view name to include "spice" ahead of "spectre". I am able to open
the SPICE netlist of the block through Virtuoso, but the netlisting does not work. It complains that it cannot descend into any
of the views although I am actually able to do so through the editor.

2. Converted the SPICE netlist to a Spectre one using spp. How does one create a "spectre" view for a given cell? There seems to be
no netlist example for this.

Could anyone suggest a solution?

Thanks
Vivek
Back to top
 
 
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 677
Munich, Germany
Re: Using a SPICE subcircuit in Spectre
Reply #1 - Oct 2nd, 2007, 8:27am
 
Here is what I usually do: Add a scasubckt component from analogLib to the schematic. For "Name of the model" enter the name after "subckt" in your Spectre netlist. For "Subckt file" enter the full path to the file with your Spectre netlist. For "Number of ports" enter the number of ports of your circuit. In the schematic, connect the "ref" port of the scasubckt component to a gnd component from analogLib. Finally, add a dummy port to your Spectre netlist at the end of the list (this corresponds to the unused "ref" port). For example, for a circuit with two ports, change the line "subckt mycircuit t1 t2" to "subckt mycircuit t1 t2 dummy". In the example given here, t1 and t2 would correspond to the ports b1 and b2 of the scasubckt component.
Back to top
 
 
View Profile WWW   IP Logged
vivkr
Community Fellow
*****
Offline



Posts: 780

Re: Using a SPICE subcircuit in Spectre
Reply #2 - Oct 10th, 2007, 2:35am
 
Thanks a lot Frank!!!

Vivek
Back to top
 
 
View Profile   IP Logged
claire
New Member
*
Offline



Posts: 5

Re: Using a SPICE subcircuit in Spectre
Reply #3 - Jun 19th, 2008, 5:57am
 
I have the same problem as Vivkr. I'm trying to do what Frank respond but I can't find "Number of ports". Where should I look for this? My component is a pnp. I don't see too what is the "ref" that you talk about.
Can you help me?
Thanks.
Claire
Back to top
 
 
View Profile   IP Logged
claire
New Member
*
Offline



Posts: 5

Re: Using a SPICE subcircuit in Spectre
Reply #4 - Jun 19th, 2008, 7:39am
 
I have managed to do all what Frank say but it still not working!!
I think that my netlist is wrong. The extension must be .cir or .scs?? My component is a pnp.
I give you my netlist :

simulator lang=spectre
subckt mypnp E B C dummy
model mypnp bjt type=pnp minr=1e-60 rbmod=spice bf=2.775 * bfa nf=1.013 * nfa is=3.5351e-18 * isa
+ ise=3.5351e-18 * isa isc=3.5351e-18 * isa ne=1.3977142 rb=54.76734 * rba irb=1.401332e-3
+ rbm=1.0965611 * rbma re=1.3979963 * rea ikf=8.2254e-4 nkf=0.477972 vaf=372.731
+ br=4.4013e-3 nr=0.993881 nc=0.98076 rc=20.08 * rca ikr=1.98804e-4 var=20.84541
+ xti=3 eg=1.17 xtb=0 trb1=1.493714e-3 tirb1=1.375303e-5 trm1=1.074565e-5 tre1=1.068665e-4
+ tikf1=-2.512025e-3 tikr1=-3.93e-3 trc1=8e-5 tbf1=4.9e-3 tbf2=1.1e-6 tnf1=-1.056025e-4
+ tne1=2.152336e-4 tvaf1=-4e-5 tbr1=-1.01e-3 tbr2=1.3e-5 tnc1=1.122277e-4 tnc2=0
+ tnr1=-1.026101e-4 tnr2=0 cje=3.2987e-14 * cjea vje=0.895226 mje=0.4345495 fc=0
+ cjc=3.965229e-14 * cjca vjc=0.5846489 mjc=0.2933243 tlev=0 tlevc=1 cte=2.0325e-3
+ ctc=8.900197e-4 tvje=1.572025e-3 tvjc=2.819e-3 tnom=25
//
ends mypnp

What's wrong??
Back to top
 
 
View Profile   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: Using a SPICE subcircuit in Spectre
Reply #5 - Jul 4th, 2008, 9:59pm
 
Claire,

  If you would share the error message, it would be easier to identify
the issue and propose solutions.

Also Frank's approach is not required for device models. For a device
model, you can just place the component in schematic and define the
model name, in your case, "mypnp".

On other observation, usually device models are not wrapped inside
of subcircuits. Spectre has a special construct called inline subcircuits
for device models. You should check the online help or manual for
details. The other option would be to just treat your model as a
model.

                                                            Best Regards,

                                                               Sheldon
Back to top
 
 
View Profile   IP Logged
tkhan
Junior Member
**
Offline



Posts: 23

Re: Using a SPICE subcircuit in Spectre
Reply #6 - Aug 15th, 2008, 11:15am
 
i am trying to import an inductor i made in momentum and generated the spice netlist for. i followed the instructions above  but get this error:

Error found by spectre in `asdf', during circuit read-in.
   "/*****/asdf.cir" 1: Syntax error in
       specification of `spice'.
Warning from spectre, in `asdf', during circuit read-in.
   "/*****/asdf.cir" 17: Subcircuit name missing in
       closing the nested definition for `asdf'.

any help would be appreciated.
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Using a SPICE subcircuit in Spectre
Reply #7 - Sep 15th, 2008, 9:24am
 
claire wrote on Jun 19th, 2008, 7:39am:
subckt mypnp E B C dummy
model mypnp bjt type=pnp minr=1e-60 rbmod=spice bf=2.775 * bfa nf=1.013 * nfa
...
What's wrong??


1) you've got a model card, but no instance of anything in the subckt
2) you probably don't want the model card to have the same name as the subckt
3) BJT terminals are usually ordered as C B E (not E B C)
4) where are "bfa" and "nfa" declared/assigned values?


subckt mypnp E B C dummy
model pnpmod bjt type=pnp minr=1e-60 rbmod=spice bf=2.775 * bfa nf=1.013 * nfa
...
q1 (C B E) pnpmod
endst mypnp
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Using a SPICE subcircuit in Spectre
Reply #8 - Sep 15th, 2008, 9:27am
 
tkhan wrote on Aug 15th, 2008, 11:15am:
i am trying to import an inductor i made in momentum and generated the spice netlist for. i followed the instructions above  but get this error:

Error found by spectre in `asdf', during circuit read-in.
   "/*****/asdf.cir" 1: Syntax error in
       specification of `spice'.


As a wild guess (you don't actually show us line 1), I'm thinking line 1 is supposed to be a comment, but doesn't have a leading * because Spice always ignores the first line -- and then Spectre is reading the file thinking it's Spectre format and trying to parse the first line.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 677
Munich, Germany
Re: Using a SPICE subcircuit in Spectre
Reply #9 - Sep 16th, 2008, 12:10am
 
The subcircuit netlist is expected in Spectre format, not in Spice format. You can convert the Spice netlist to Spectre format with spp. See http://sourcelink.cadence.com/docs/files/Release_Info/Docs/spectreuser/spectreus... or type spp -h at the Unix prompt for a list of options.

You can also try to add the command line simulator lang=spice in front of the netlist and simulator lang=spectre after it. I have never tried this, though.
Back to top
 
 
View Profile WWW   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: Using a SPICE subcircuit in Spectre
Reply #10 - Sep 18th, 2008, 6:33pm
 
Another approach would be to tell Spectre that the block is not
in Spectre format. For example,

simulator lang=spice

*** My SPICE netlist

.SUBCKT
...
.ends

simulator lang=spectre

I believe that this is approach is preferred to using spp.

                                                                    Best Regards,

                                                                         Sheldon


Back to top
 
 
View Profile   IP Logged
fernando.g.r
New Member
*
Offline



Posts: 4

Re: Using a SPICE subcircuit in Spectre
Reply #11 - Dec 6th, 2010, 2:39am
 
Hello,

I've been reading the thread and trying to follow your advice.

Unfortunately, when i try to simulate my netlist all i get is:

Code:
Warning from spectre in `component', during circuit read-in.
    "example" 46: `gx': Encountered statement in Spectre format while in Spice language mode. This will not be supported in a future release.
Error found by spectre during circuit read-in.
    Primitive 'n1' does not support behavioural expressions( File:example, Instance:gx) 





here is part of the spice model (a current dependent  source) included in the spectre netlist:

Code:
simulator lang= spice

.SUBCKT component Plus 0
***********************************************
* STATE EQUATION MODELING *
Gx 0 N1 value= I(Roff)*mag*V(N1)

 



May you help me?

Thanks
Back to top
 
 
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 677
Munich, Germany
Re: Using a SPICE subcircuit in Spectre
Reply #12 - Dec 6th, 2010, 3:32am
 
Have you tried using correct SPICE syntax? See for example http://bwrc.eecs.berkeley.edu/classes/icbook/spice/UserGuide/elements.html#462.
Back to top
 
 
View Profile WWW   IP Logged
fernando.g.r
New Member
*
Offline



Posts: 4

Re: Using a SPICE subcircuit in Spectre
Reply #13 - Dec 6th, 2010, 6:45am
 
Thanks for the link, i've found the error.
Back to top
 
 
View Profile   IP Logged
apprentice
Community Member
***
Offline



Posts: 32

Re: Using a SPICE subcircuit in Spectre
Reply #14 - Apr 4th, 2011, 10:25pm
 
Hi all,

  Instead of using a scasubckt component, I tried creating a cell with a CDF parameter flowing the recipe somehow.  The detail recipe can be found from the link at the end of the post.
  However, I got a error.
Error found by spectre during circuit read-in.
   ERROR (SFE-23): "input.scs" 13: I1 is an instance of an undefined model abc_model.
   


input.scs
  // Generated for: spectre
// Generated on: Apr  4 22:06:27 2011
// Design library name: abc
// Design cell name: tb_abc
// Design view name: schematic
simulator lang=spectre
global 0

// Library name: abc
// Cell name: tb_abc
// View name: schematic
I1 (in_p in_n out) abc_model
V0 (in_p in_n) vsource type=bit edgetype=linear val0=0 val1=1 period=30p \
       rise=12p fall=12p data="0" rptstart=1 rpttimes=0
R0 (out 0) resistor r=1
simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=27 \
   tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
   digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
   checklimitdest=psf
tran tran stop=100p write="spectre.ic" writefinal="spectre.fc" \
   annotate=status maxiters=5
finalTimeOP info what=oppoint where=rawfile
modelParameter info what=models where=rawfile
element info what=inst where=rawfile
outputParameter info what=output where=rawfile
designParamVals info what=parameters where=rawfile
primitives info what=primitives where=rawfile
subckts info what=subckts  where=rawfile
saveOptions options save=allpub

--------------------
abc_model.scs (model library setup done - attached screen capture)

simulator lang=spectre insensitive=yes


subckt abc_model (in_p in_n out)
// *********************************************************************
// circuit
//
//
//
parameters d=0.01
...
...
...
// output circuit
...
ends abc_model
// *********************************************************************


  Which step could be wrong? Which part of message I should post to help troubleshoot?

thanks

http://www.cadence.com/Community/blogs/rf/archive/2009/01/07/tip-of-the-week-how...
Back to top
 

model_library_setup.png
View Profile   IP Logged
Pages: 1 2 
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.