.MEASURE FREQ for a square wave outputs questionable values

20 views
Skip to first unread message

Pablo Soler Portilla

unread,
May 11, 2019, 10:07:21 PM5/11/19
to xyce-users
I am using .MEASURE FREQ for a (0,Vdd) square wave to measure its frequency. The square wave is very clean except for a 200mV spike above Vdd on every negative edge.
 I am fairly confident that the square wave is changing period as I step a parameter. However, when I use
.MEASURE FREQ v(q) ON=1.65 OFF=0.15
(Vdd is 1.8V)

I extract the measurement at the end of every transient simulation for each step iteration but I seem to be getting the same measurement for every iteration.  I get several identical measurements (9400000Hz, reasonable in my case) and a few outliers that are comparable in magnitude. 

My question is..is the measurement tool adequate for this measurement? If so what can I do to fix it? If not, what is another xyce tool that will be more accurate?

Pablo Soler Portilla

unread,
May 12, 2019, 11:41:35 AM5/12/19
to xyce-users
And one other thing. The measurements all seem to be very round integers.  I have mostly measurements of 9400000 and a few of 9500000 Hz. It just seems odd and I want to make sure I am using the tool correctly.  

xyce-users

unread,
May 13, 2019, 4:52:19 PM5/13/19
to xyce-users
Pablo,

The FREQ measure was added at the request of an internal Sandia user, and is not present in the HSPICE tool.  The Xyce Reference Guide says this about the FREQ measure, which is admittedly unclear.  So, maybe we need to update the .MEASURE section of the Reference Guide.

  "An estimate of the frequency of <variable>, found by cycle counting during the simulation. Cycles are defi ned through the values of ON and OFF with MINVAL being used as a tolerance so that
the thresholds becomes (ON - MINVAL) and (OFF + MINVAL)."

If we look at the source code in the file IOInterfacePKG/Output/N_IO_MeasureFrequency.C then the "calculation result" (which is the value for the measure) is defined as:

    calculationResult_ = (0.5 *(onToOffCount_ + offToOnCount_))/totalAveragingWindow_;

So, since the FREQ measure is essentially counting how many times the waveform passes through the ON value (from below) and through the OFF value (from above), the onToOffCount_ + offToOnCount_ variables will both be integers.  The totalAveragingWindow_ is then equal to the total simulation time, or has been possibly windowed by the FROM and TO values for a given FREQ measure.  So, it possible (depending on the totalAveragingTime_ value) for a FREQ measure to evaluate to an integer (or a close approximation of one).

-- The Xyce Team
Reply all
Reply to author
Forward
0 new messages