Table of Contents

Class Frequency

Namespace
CsraTestMethods.Timing
Assembly
CsraTestMethods.dll
[TestClass(Creation.TestInstance)]
[Serializable]
public class Frequency : TestCodeBase
Inheritance
TestCodeBase
Frequency
Inherited Members
TestCodeBase.AbortTest()
TestCodeBase.DebugBreak()
TestCodeBase.TheExec
TestCodeBase.TheHdw
TestCodeBase.TheProgram
TestCodeBase.FlowDomains
TestCodeBase.ShouldRunPreBody
TestCodeBase.ShouldRunBody
TestCodeBase.ShouldRunPostBody

Methods

Baseline(Pattern, PinList, double, double, string, string, string)

Measures the frequency of the given digital pin(s) with the frequency counter while the pattern is executing.

[TestMethod]
[Steppable]
[CustomValidation]
public void Baseline(Pattern pattern, PinList pinList, double waitTime = 0, double measureWindow = 0.01, string eventSource = "VOH", string eventSlope = "Positive", string setup = "")

Parameters

pattern Pattern

The pattern to be executed during the test.

pinList PinList

Digital pin(s) to measure the frequency.

waitTime double

Optional. Time to wait between the pattern start and the start of the frequency measurement.

measureWindow double

Optional. Time to measure the frequency, longer measurement times yield more accurate results.

eventSource string

Optional. The event source for the frequency counter (VOH, VOL or BOTH).

eventSlope string

Optional. The event slope for the frequency counter (Positive or Negative).

setup string

Optional. Setup to be applied before the pattern is run.

Details

Test Technique
  • to be added
Implementation

The validation section creates the pins and pattern objects.

The PreBody section applies levels and timing from the test instance context. Optionally, applies the specified setup. For all pins specified in the pinList it connects the dc path and leaves the gate as it is.

The Body section configures the measurePins for a frequency read, starts the pattern, measures the frequency on the measurePins after the specified wait and then forces the pattern to halt. The pattern must be long enough for the specified wait plus the measureWindow and will be forced to halt immediately after the measurement is taken. This halt allows for the pattern to be implemented as an infinite loop or as a standard vector sequence, but does not allow for additional device configuration or processing after the frequency is measured.

The PostBody section datalogs the measured frequency.

Platform Specifics

Utilizes the frequency counter for the measurements. Supports stepping capability for PreBody/Body/PostBody.

Pre Conditions
  • none
Post Conditions
  • none
Limitations
  • Only digital channels supported.
Code Reference
[TestMethod, Steppable, CustomValidation]
public void Baseline(Pattern pattern, PinList pinList, double waitTime = 0, double measureWindow = 10 * ms, string eventSource = "VOH",
    string eventSlope = "Positive", string setup = "") {

    if (TheExec.Flow.IsValidating) {
        TheLib.Validate.Pattern(pattern, nameof(pattern), out _pattern);
        TheLib.Validate.Pins(pinList, nameof(pinList), out _measurePins);
        TheLib.Validate.Enum(eventSource, nameof(eventSource), out _eventSource);
        TheLib.Validate.Enum(eventSlope, nameof(eventSlope), out _eventSlope);
        TheLib.Validate.InRange(measureWindow, 2.5 * ns, 10.7 * s, nameof(measureWindow)); // 2.5ns and 10.7s are instrument limits on UP2200
        TheLib.Validate.InRange(waitTime, 0, 600, nameof(waitTime));
    }

    if (ShouldRunPreBody) {
        TheLib.Setup.LevelsAndTiming.Apply(true);
        Services.Setup.Apply(setup);
    }

    if (ShouldRunBody) {
        TheLib.Setup.Digital.FrequencyCounter(_measurePins, measureWindow, _eventSource, _eventSlope);
        TheLib.Execute.Digital.StartPattern(_pattern[0]);
        TheLib.Execute.Wait(waitTime, true);
        _freqMeasure = TheLib.Acquire.Digital.MeasureFrequency(_measurePins);
        TheLib.Execute.Digital.ForcePatternHalt(_pattern[0]);
    }

    if (ShouldRunPostBody) {
        TheLib.Datalog.TestParametric(_freqMeasure);
    }
}