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.

Cadence Specre continuous measurement

Status
Not open for further replies.

_farhad_

Newbie level 3
Joined
Dec 13, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Fayetteville, AR
Activity points
1,311
Cadence Spectre continuous measurement

Hello all,

I have been trying to measure rise/fall time of a signal continuously to average it later. I'm using Cadence Spectre and I have added all the required measure statements to the netlist. The Spectre runs successfully and creates ".measure" file but it only contains one value in it while I expect to see several values in the output file because the signal under test makes several rises/falls.

I have tried to use both Spice and Spectre MDL syntax but none of them works.

For Spectre MDL I used:

alias measurement Trise {
export Rise_Time
export real VDD = 1.2

run tran

Rise_Time = risetime(V(z),0,VDD,theta1=10,theta2=90)
}
run Trise

For Spice syntax I used:

simulator lang=spice
.meas tran Trise TRIG V(z) val=0.1 TARG V(z) val=1.1 Rise=1

(I know in HSpice you must use tran_cont instead of tran to get several values but it seems that Spectre doesn't support tran_cont since it ignores it with a warning)

For both cases the Spectre runs successfully and creates the measure files but they contain only one value for the very first rise time!

I am able to go around this problem by making separate netlists for each rise/fall scenario but it seems not the best way if Spectre can automatically measure several rise/fall events and put all of them together in one measure file.

I appreciate any help to solve this issue.
Thanks in advance
 

I think veriloga is your friend.

I've built things like veriloga widgets that watch one node for zero
crossings and compute a "present frequency" and produce it as a
voltage on a pin. I'm sure something similar for risetime would be
trivial (although you want to stay away from nanovolts as this will
be buried in simulator accuracy mud - so scale for volts=nS or
something, see code).

Then you attach your veriloga code to a veriloga view, make a
symbol view, add "veriloga" to a priority position in your switch-
view and stop-view lists, and bickety-bam, continuous print or
plot of your risetimes, all of 'em, just like the voltage it now is.


// VerilogA
// freq = instantaneous frequency of last 2 rising or last 2 falling edges
// freq Scale = 1V / GHz,

`include "constants.h"
`include "discipline.h"

module freqCounter(in,freq);
input in;
output freq;
electrical in,freq;

real cr1,cr2,f,T1,T2,V1,V2,cr;

analog begin
@ (initial_step) begin
cr1=0;
cr2=0;
f=0;
T1=0;
V1=0;
end

@ (cross (V(in))) begin
T2=$abstime;
V2=V(in);
if (T1>0 && V2-V1!=0) cr=T1-(V1*(T2-T1)/(V2-V1));
if (cr1>0 && cr>cr1) f=1.0/(1E9*(cr-cr1)); scaled 1V=1GHz
cr1=cr2;
cr2=cr;
end
T1=$abstime;
V1=V(in);
V(freq) <+ transition(f);
end

endmodule




I've also made one that just prints to a hard coded output
file. Which one would be more useful to you, I couldn't say.


// VerilogA for verilogTools, printFreq, veriloga

`include "constants.h"
`include "discipline.h"

module printFreq(vin,MHz);
input vin;
output MHz;
voltage vin,MHz;
integer rise;
integer out_file;
real lastrise,thisrise,freq;

analog begin
@ ( initial_step ) begin
rise=0;
lastrise=0;
thisrise=0;
freq=0;
out_file = $fopen("%C:h/zero_cross_%I.csv");
// $fstrobe(out_file,"# Generated by Spectre from instance `%M'");
V(MHz) <+ 0;
end

@ (cross (V(vin),+1) ) begin
rise=rise+1;
thisrise=$abstime;
freq=1/(thisrise-lastrise+1E-99);
lastrise=thisrise;
$fstrobe(out_file, "Rise,%d,%g,%g",rise,thisrise,freq);
end
V(MHz) <+ freq/1E6;

@ ( final_step ) begin
$fclose( out_file );
end

end

endmodule
 
Thanks freebird for your reply.

Verilog-A is definitely a choice but I was looking for a simpler solution.
I am specially interested to know if there is any way to do that by using Spectre simulator options or modifying the MDL script.
 

I believe your measurement is only looking at the first edge for rise time. You should use a "foreach" loop and a "clip" where you increment the clip (from - to) by your clock period and then take the risetime measurement.
 
I think this requires predicting the output rise/fall event based on the input values (if rise/fall event does not happen every clock cycle) and then one can clip the output signal appropriately such that the risetime/falltime function can only see the desired rise/fall event. Also, based on MDL user guide "clipping" can only be done along Y-axis. I'm curious how you do it along X-axis.

Thanks Joannes
 

Ooops, you are correct: I confused the "clip' command from ocean (x-axis clip) with the spectreMDL one (y-axis clip). What you need to do is a search for a transition and once you find it you can calculate the rise time. In this way you need not to know about the timing of the signal. Look for "search" in the spectreMDL reference.
 
Last edited:
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top