The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Porting HSpice .print statement to Spectre
https://designers-guide.org/forum/YaBB.pl?num=1051812366

Message started by Eric_Gamble on May 1st, 2003, 11:06am

Title: Porting HSpice .print statement to Spectre
Post by Eric_Gamble on May 1st, 2003, 11:06am

Hello,

I am working on porting a data extraction script from HSpice to Spectre and am having difficulty finding the analog of the .PRINT statement in HSPICE.
Particularly, my application is something like this (simplified):

* Data
.DATA parameter_sweep M1_l M1_w M1_mx M1_my vds vgs vsb
+       0.5e-06 4e-06 1 1 0.05 0.5 0
+       0.5e-06 4e-06 1 1 0.05 0.5 0.3
+       0.6e-06 6e-06 1 1 0.075 0.6 0
+       0.6e-06 6e-06 1 1 0.075 0.6 0.3
.enddata

* Spice Netlist
M1 d g s b nch  L='M1_l'  W='M1_w'
vgs g s 'vgs'
vds d s 'vds'
vsb s 0 'vsb'
vbg b 0 0

* Simulation
.dc DATA=parameter_sweep

* Measure the parameters
.print dc
+ id=par('abs(lx4(m1))')
+ vt=par('abs(lv9(m1))')
+ gm=par('abs(lx7(m1))')

.end


currently, my Spectre deck looks something like this:

simulator lang=spectre

parameters m1_w=4.0e-6
parameters m1_l=0.5e-6
parameters  vgs=0.5
parameters  vds=0.05
parameters  vsb=0.0

datasweep paramset {
   m1_l    m1_l  vds   vgs   vsb
   0.5e-06 4e-06 0.05  0.5   0
   0.5e-06 4e-06 0.05  0.5   0.3
   0.6e-06 6e-06 0.075 0.6   0
   0.6e-06 6e-06 0.075 0.6   0.3
}

m1 (d g s b)  nch l=0.5e-6 w=4e-6
vsrc_gs g s vsource dc=vgs type=dc
vsrc_ds d s vsource dc=vds type=dc
vsrc_s0 s 0 vsource dc=vsb type=dc
vsrc_bg b 0 vsource dc=0   type=dc

swp1 sweep paramset=datasweep  {
      dc info where=logfile
     }

This seems to print the operating point info from the first data point 4 times.  I don't whether this is simulating with the different parameters,and I don't know how to print specific values in Spectre.
I also would like to specify an output file for the data.

Can anyone help me out?

Thanks,
Eric.

Title: Re: Porting HSpice .print statement to Spectre
Post by Mighty Mouse on May 7th, 2003, 5:45pm

Eric,
In Spectre version 5.0 and beyond you can use MDL to print. I suggest that you take a look at the SpectreMDL users guide to get a feeling for MDL, since there is a lot it can do.

Here is what I did to run your example. First, here is the netlist (a file named netlist):

Code:
// Example of sweeping and printing
simulator lang=spectre

parameters m1_l=0.5u m1_w=4u m1_mx=1 m1_my=1 vds_S1=0.05 vgs_S1=0.5 vsb_S1=0

model nch mos1 type=n

parameter_sweep paramset {
   m1_l        m1_w    m1_mx   m1_my   vds_S1  vgs_S1  vsb_S1
   0.5e-06     4e-06   1       1       0.05    0.5     0
   0.5e-06     4e-06   1       1       0.05    0.5     0.3
   0.6e-06     6e-06   1       1       0.075   0.6     0
   0.6e-06     6e-06   1       1       0.075   0.6     0.3
}

m1  (d g s b) nch l=m1_l w=m1_w
vgs (g s) vsource dc=vgs_S1
vds (d s) vsource dc=vds_S1
vsb (s 0) vsource dc=vsb_S1
vbg (b 0) vsource dc=0

saveOptions options save=allpub
save m1:oppoint

Then I created an MDL file that describes the analyes and expressions that you want Spectre to evaluate (a file named netlist.mdl):

Code:
alias measurement dcrun {
       run  dc
       export real id=abs(I(m1:1))
//      export real vt=abs(m1:vt)
//      export real gm=abs(m1:gm)
}

foreach parameter_sweep {
       run dcrun as dcrun1
}

Unfortunately, MDL does not yet allow you access to the operating point parameters (vt and gm). That is why they are commented out.

Finally, I ran the simulation using

Code:
spectremdl -design netlist

It put the printed results in netlist.measure. spectremdl is a perl script,  so you can modify it to change the way things are printed.

- MM -

Title: Re: Porting HSpice .print statement to Spectre
Post by Eric_Gamble on May 8th, 2003, 3:58pm

Thank you MM,

 Your example does a good job of demonstrating the use of SpectreMDL.  Unfortunately, this particular simulation is not very interesting without being able to look at the operating point parameters.
 I am able to access the operating point data from ocean, so I'm writing a script to post-process the data and print it to a file.

Thanks,
Eric.

Title: Re: Porting HSpice .print statement to Spectre
Post by Julian18 on May 30th, 2007, 11:29pm


Eric_Gamble wrote on May 8th, 2003, 3:58pm:
Thank you MM,

 Your example does a good job of demonstrating the use of SpectreMDL.  Unfortunately, this particular simulation is not very interesting without being able to look at the operating point parameters.
 I am able to access the operating point data from ocean, so I'm writing a script to post-process the data and print it to a file.

Thanks,
Eric.


Hi, Eric
    How to write scripts to get access to the operating point data from OCEAN?

Title: Re: Porting HSpice .print statement to Spectre
Post by ywguo on Aug 20th, 2007, 8:47pm

Hi guys,

That is interesting. Sometimes I measure some parameters in HSPICE. An example is shown below. Can I do the similar thing in spectre?

* Measure the parameters
.probe tran
+ id=par('abs(lx4(m1))')
+ vt=par('abs(lv9(m1))')
+ gm=par('abs(lx7(m1))')


Thanks
Yawei

Title: Re: Porting HSpice .print statement to Spectre
Post by Scott Flinchbaugh on Aug 21st, 2007, 8:37pm

Eric,

The .print statement is supported in Spectre as of the Spectre 6.0 release.

To insert a spice language statement in a Spectre netlist please use the following:

simulator lang = spice
.print V(out)

simulator lang = spectre

<spectre statements>


The same thing can be done with MDL, but only in later versions.  Please take a look at
your SpectreMDL user's guide.  With MDL strict spice print output file is not produced, rather
you can use a free format file with the use of the MDL fmt() statement.

Thanks,
-scott F.

Title: Re: Porting HSpice .print statement to Spectre
Post by Scott Flinchbaugh on Aug 21st, 2007, 8:39pm

Yawei,

Similar to the .print syntax that is now recognized by Spectre after 6.0, the same can be done with
the .probe statement.

Thanks,
-scott

Title: Re: Porting HSpice .print statement to Spectre
Post by John O Donovan on Aug 28th, 2007, 5:03am


Also the operating point parameters should be accessible using the dev:param syntax. First check the name of the parameter by using 'spectre -h mos1' or bsim3v3, bsim4, ... All input, output and oppoint parameters should be accessible. If you can access it via Ocean, it should be accessible via MDL too.

Regards,
 John

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