Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to output/save gain, bandwidth, phase margin, gain margin in Spectre?

Status
Not open for further replies.

Alex Liao

Member level 4
Joined
Apr 8, 2013
Messages
75
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,991
Hi. Say I use command line to run simulation.
For example in Hspice my input stimuli is like this:
[section]
Code:
.op
.options ingold=2 list node post
.print ac vdb(6) vp(6)
.ac dec 100 0.001 10g 	

* net 6 = /out
.MEAS AC gain MAX vdb(6)                     		*gain
.MEAS AC bandwidth WHEN vdb(6)=0                    *Unity Gain Frequency (Bandwidth)
.MEAS AC PM FIND PAR('180+vp(6)') WHEN vdb(6)=0     *Phase Margin 180+phase
.MEAS AC GM FIND PAR('0-vdb(6)') WHEN vp(6)=0  		*Gain Margin

.end

By doing so, I have those four results saved in my local result file.

How can I do the same thing in Spectre/SpectreS? I guess the format is different.
I have attached a section of my stimuli file (spectreFinal) like this:
Code:
opBegin  dc  oppoint=rawfile  save=allpub  maxiters=150
+          maxsteps=10K  annotate=status  write="spectre.dc"
acSweep    ac  start=1.0  stop=1e9  annotate=status save=selected
                     		
modelParameter info what=model where=file file = "./info.what0"
element info what=models where=file file = "./info.what1"
outputParameter info what=output where=file file = "./info.what2"
What command should be inserted in order to do the same thing as Hspice?
Thanks.
 

I'd suggest using Calculator to Print these results, in an
interactive session, save the memories, save the session
as an Ocean script and you can edit it to redirect output
to a file, add PVT loops and whatever else you want. The
foreground environment is pretty crappy for I/O unless
you want to screen-grab plots or save-as the output
text window.
 
Hi dick_freebird
The attached picture may help you

 
Hi dick_freebird,

Thank you for this. I think your approach is dependent on ocean script which has something to do the the User Interface. What I want to find is spectre language based approach which is more like command based. Are you familiar with spectre language?

Alex

- - - Updated - - -

Hi tompham,

Do you have some knowledge on Spectre Language?
 

How to output an result into file (say gain) using Spectre language?

As the title implied, using Graphic-based ADE tool as well as ocean script, result can be found. But what if I want to use Spectre language, how to achieve that. Screen display an simulation result (gain,bandwidth). I already have the formula copied from calculator in ADE. I tried to write the result in SpectreFinal which is the stimuli file used as the input of a simulation.
I only know the way of doing it using Hspice like this:
Code:
.op
.options ingold=2 list node post
.print ac vdb(6) vp(6)
.ac dec 100 0.001 10g 	

* net 6 = /out
.MEAS AC gain MAX vdb(6)                     		*gain
.MEAS AC bandwidth WHEN vdb(6)=0                    *Unity Gain Frequency (Bandwidth)
.MEAS AC PM FIND PAR('180+vp(6)') WHEN vdb(6)=0     *Phase Margin 180+phase
.MEAS AC GM FIND PAR('0-vdb(6)') WHEN vp(6)=0  		*Gain Margin

.end

My current Spectre based file (spectreFinal) with partial section displayed here:
Code:
opBegin  dc  oppoint=rawfile  save=allpub  maxiters=150
+          maxsteps=10K  annotate=status  write="spectre.dc"
acSweep    ac  start=1.0  stop=1e9  annotate=status save=selected
                     		
modelParameter info what=model where=file file = "./info.what0"
element info what=models where=file file = "./info.what1"
outputParameter info what=output where=file file = "./info.what2"

The gain from calculator is like this:
Code:
*Gain = value(dB20((VF("/vout") / (VF("/1") - VF("/2")))) 2)

How to edit the attached spectreFinal such that I could output the gain into a file using Spectre language?

Thanks,
 

You can find the syntax in the Spectre Circuit Simulator User Guide. G00GLE it!
 
Hi ALex Liao

Please seee this attached website and follows it. You can do what you want

**broken link removed**
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top