Class Functional
- Namespace
- CsraTestMethods.Search
- Assembly
- CsraTestMethods.dll
[TestClass(Creation.TestInstance)]
[Serializable]
public class Functional : TestCodeBase
- Inheritance
-
TestCodeBaseFunctional
- Inherited Members
-
TestCodeBase.AbortTest()TestCodeBase.DebugBreak()TestCodeBase.TheExecTestCodeBase.TheHdwTestCodeBase.TheProgramTestCodeBase.FlowDomainsTestCodeBase.ShouldRunPreBodyTestCodeBase.ShouldRunBodyTestCodeBase.ShouldRunPostBody
Methods
Binary(Pattern, PinList, double, double, double, bool, double, string)
The search range is divided in half at each iteration, with a check performed on the midpoint, and the search stops once the target condition is met. The input value where the condition passes is then returned as the result.
[TestMethod]
[Steppable]
[CustomValidation]
public void Binary(Pattern pattern, PinList forcePins, double from, double to, double minDelta, bool invertedOutput, double waitTime, string setup = "")
Parameters
patternPatternThe pattern to run.
forcePinsPinListThe pins that are being forced. The support pin types can be DC(DCVI, DCVS and PPMU) and Digital(Vih level).
fromdoubleThe starting value of the linear input ramp.
todoubleThe stopping value of the linear input ramp.
minDeltadoubleThe minimum allowable difference between successive input values, used to determine when the search should stop.
invertedOutputboolA flag indicating whether the output is inverted, affecting the search logic.
waitTimedoubleThe wait time per step during ramp execution, used to delay measurement after each force transition.
setupstringOptional. The name of the setup set to be applied through the setup service.
Details
Test Technique
- to be added
Implementation
The PreBody section applies levels and timing from the test instance context. Optionally, applies the specified setup. For the force pin, specified in forcePins, it disconnects any pin electronics and connects the DC path.
The Body section performs a binary search (via Vih for the Digital pin, voltage for DCVI/DCVS/PPMU pin) until it determines the device input condition for which the pattern passes. Finally, it returns the input value that produces a passing pattern result. If no such value is found, the function returns -999 as a failure indicator.
The PostBody section restores the pin electronics connection for digital pins after gating off and disconnecting the dc path. Finally, logs a parametric datalog.
Platform Specifics
Supports stepping capability for PreBody/Body/PostBody.
Pre Conditions
- none
Post Conditions
- none
Limitations
Pin features supporting DCVI, DCVS, PPMU, and Digital, note that PPMU must be used in combination with either DCVI or DCVS to function.
Code Reference
[TestMethod, Steppable, CustomValidation]
public void Binary(Pattern pattern, PinList forcePins, double from, double to, double minDelta, bool invertedOutput, double waitTime,
string setup = "") {
if (TheExec.Flow.IsValidating) {
TheLib.Validate.Pattern(pattern, nameof(pattern), out _pattern);
TheLib.Validate.Pins(forcePins, nameof(forcePins), out _pins);
TheLib.Validate.GreaterThan(minDelta, 0, nameof(minDelta));
TheLib.Validate.InRange(waitTime, 0, 600, nameof(waitTime));
_containsDcviDcvs = _pins.ContainsFeature(InstrumentFeature.Dcvi) || _pins.ContainsFeature(InstrumentFeature.Dcvs);
if (_containsDcviDcvs) _containsDigitalPins = _pins.ContainsFeature(InstrumentFeature.Digital);
}
if (ShouldRunPreBody) {
TheLib.Setup.LevelsAndTiming.Apply(true);
Services.Setup.Apply(setup);
if (_containsDcviDcvs) {
if (_containsDigitalPins) TheLib.Setup.Digital.Disconnect(_pins);
TheLib.Setup.Dc.Connect(_pins);
}
}
if (ShouldRunBody) {
if (_containsDcviDcvs) {
TheLib.Setup.Dc.ForceV(_pins, (from + to) / 2);
TheLib.Execute.Wait(waitTime); // first step may be bigger than the subsequent ones, use 2x settling
}
_values = TheLib.Acquire.Search.BinarySearch(from, to, minDelta, invertedOutput, (forceValue) => {
ForEachSite(site => {
if (_containsDcviDcvs) TheLib.Setup.Dc.Modify(_pins, voltage: forceValue[site]);
else TheLib.Setup.Digital.ModifyPinsLevels(pins: _pins, levelsType: ChPinLevel.Vih, levelsValue: forceValue[site]);
});
TheLib.Execute.Wait(waitTime);
TheLib.Execute.Digital.RunPattern(_pattern[0]);
return TheLib.Acquire.Digital.PatternResults();
},
patResult => patResult,
_notFoundResult
);
}
if (ShouldRunPostBody) {
if (_containsDcviDcvs) {
TheLib.Setup.Dc.Disconnect(_pins);
if (_containsDigitalPins) TheLib.Setup.Digital.Connect(_pins);
}
TheLib.Datalog.TestParametric(_values);
}
}
LinearFull(Pattern, PinList, double, double, int, double, string)
The measurements across the entire range are traversed without being evaluated during the linear search, after which the device input condition for which the pattern passes is provided.
[TestMethod]
[Steppable]
[CustomValidation]
public void LinearFull(Pattern pattern, PinList forcePins, double from, double to, int count, double waitTime, string setup = "")
Parameters
patternPatternThe pattern to run.
forcePinsPinListThe pins that are being forced. The support pin types can be DC(DCVI, DCVS and PPMU) and Digital(Vih level).
fromdoubleThe starting value of the linear input ramp.
todoubleThe stopping value of the linear input ramp.
countintThe number of input points for which the search is performed.
waitTimedoubleThe wait time per step during ramp execution, used to delay measurement after each force transition.
setupstringOptional. The name of the setup set to be applied through the setup service.
Details
Test Technique
- to be added
Implementation
The PreBody section applies levels and timing from the test instance context. Optionally, applies the specified setup. For the force pin, specified in forcePins, it disconnects any pin electronics and connects the DC path.
The Body section performs an unconditional linear search (via Vih for the Digital pin, voltage for DCVI/DCVS/PPMU pin) and determines the device input condition for which the pattern passes. Finally, it returns the input value that results in a passing pattern result. If no such value is found, the function returns -999 as a failure indicator.
The PostBody section restores the pin electronics connection for digital pins after gating off and disconnecting the dc path. Finally, logs a parametric datalog.
Platform Specifics
Supports stepping capability for PreBody/Body/PostBody.
Pre Conditions
- none
Post Conditions
- none
Limitations
Pin features supporting DCVI, DCVS, PPMU, and Digital, note that PPMU must be used in combination with either DCVI or DCVS to function.
Code Reference
[TestMethod, Steppable, CustomValidation]
public void LinearFull(Pattern pattern, PinList forcePins, double from, double to, int count, double waitTime, string setup = "") {
if (TheExec.Flow.IsValidating) {
TheLib.Validate.Pattern(pattern, nameof(pattern), out _pattern);
TheLib.Validate.Pins(forcePins, nameof(forcePins), out _pins);
TheLib.Validate.GreaterOrEqual(count, 2, nameof(count));
TheLib.Validate.InRange(waitTime, 0, 600, nameof(waitTime));
_containsDcviDcvs = _pins.ContainsFeature(InstrumentFeature.Dcvi) || _pins.ContainsFeature(InstrumentFeature.Dcvs);
if (_containsDcviDcvs) _containsDigitalPins = _pins.ContainsFeature(InstrumentFeature.Digital);
}
if (ShouldRunPreBody) {
TheLib.Setup.LevelsAndTiming.Apply(true);
Services.Setup.Apply(setup);
if (_containsDcviDcvs) {
if (_containsDigitalPins) TheLib.Setup.Digital.Disconnect(_pins);
TheLib.Setup.Dc.Connect(_pins);
}
}
if (ShouldRunBody) {
_measurements = [];
if (_containsDcviDcvs) {
TheLib.Setup.Dc.ForceV(_pins, from);
TheLib.Execute.Wait(waitTime); // first step may be bigger than the subsequent ones, use 2x settling
}
double increment = TheLib.Acquire.Search.LinearFullFromToCount(from, to, count, (forceValue) => {
if (_containsDcviDcvs) TheLib.Setup.Dc.Modify(_pins, voltage: forceValue);
else TheLib.Setup.Digital.ModifyPinsLevels(pins: _pins, levelsType: ChPinLevel.Vih, levelsValue: forceValue);
TheLib.Execute.Wait(waitTime);
TheLib.Execute.Digital.RunPattern(_pattern[0]);
_measurements.Add(TheLib.Acquire.Digital.PatternResults());
});
_results = TheLib.Execute.Search.LinearFullProcess(_measurements, from, increment, 0, _notFoundResult, condition => condition);
}
if (ShouldRunPostBody) {
if (_containsDcviDcvs) {
TheLib.Setup.Dc.Disconnect(_pins);
if (_containsDigitalPins) TheLib.Setup.Digital.Connect(_pins);
}
TheLib.Datalog.TestParametric(_results);
}
}
LinearStop(Pattern, PinList, double, double, int, double, string)
The measurements across the range are traversed with an evaluation performed at each iteration, and the search is stopped once the pattern passes (on all sites). The device input condition for which the pattern passes is then provided.
[TestMethod]
[Steppable]
[CustomValidation]
public void LinearStop(Pattern pattern, PinList forcePins, double from, double to, int count, double waitTime, string setup = "")
Parameters
patternPatternThe pattern to run.
forcePinsPinListThe pins that are being forced. The support pin types can be DC(DCVI, DCVS and PPMU) and Digital(Vih level).
fromdoubleThe starting value of the linear input ramp.
todoubleThe stopping value of the linear input ramp.
countintThe number of input points for which the search is performed.
waitTimedoubleThe wait time per step during ramp execution, used to delay measurement after each force transition.
setupstringOptional. The name of the setup set to be applied through the setup service.
Details
Test Technique
- to be added
Implementation
The PreBody section applies levels and timing from the test instance context. Optionally, applies the specified setup. For the force pin, specified in forcePins, it disconnects any pin electronics and connects the DC path.
The Body section performs a linear search (via Vih for the Digital pin, voltage for DCVI/DCVS/PPMU pin) until it determines the device input condition for which the pattern passes. Finally, it returns the input value that produces a passing pattern result. If no such value is found, the function returns -999 as a failure indicator.
The PostBody section restores the pin electronics connection for digital pins after gating off and disconnecting the dc path. Finally, logs a parametric datalog.
Platform Specifics
Supports stepping capability for PreBody/Body/PostBody.
Pre Conditions
- none
Post Conditions
- none
Limitations
Pin features supporting DCVI, DCVS, PPMU, and Digital, note that PPMU must be used in combination with either DCVI or DCVS to function.
Code Reference
[TestMethod, Steppable, CustomValidation]
public void LinearStop(Pattern pattern, PinList forcePins, double from, double to, int count, double waitTime, string setup = "") {
if (TheExec.Flow.IsValidating) {
TheLib.Validate.Pattern(pattern, nameof(pattern), out _pattern);
TheLib.Validate.Pins(forcePins, nameof(forcePins), out _pins);
TheLib.Validate.GreaterOrEqual(count, 2, nameof(count));
TheLib.Validate.InRange(waitTime, 0, 600, nameof(waitTime));
_containsDcviDcvs = _pins.ContainsFeature(InstrumentFeature.Dcvi) || _pins.ContainsFeature(InstrumentFeature.Dcvs);
if (_containsDcviDcvs) _containsDigitalPins = _pins.ContainsFeature(InstrumentFeature.Digital);
}
if (ShouldRunPreBody) {
TheLib.Setup.LevelsAndTiming.Apply(true);
Services.Setup.Apply(setup);
if (_containsDcviDcvs) {
if (_containsDigitalPins) TheLib.Setup.Digital.Disconnect(_pins);
TheLib.Setup.Dc.Connect(_pins);
}
}
if (ShouldRunBody) {
if (_containsDcviDcvs) {
TheLib.Setup.Dc.ForceV(_pins, from);
TheLib.Execute.Wait(waitTime); // first step may be bigger than the subsequent ones, use 2x settling
}
_values = TheLib.Acquire.Search.LinearStopFromToCount(from, to, count, 0, _notFoundResult, (forceValue) => {
if (_containsDcviDcvs) TheLib.Setup.Dc.Modify(_pins, voltage: forceValue);
else TheLib.Setup.Digital.ModifyPinsLevels(pins: _pins, levelsType: ChPinLevel.Vih, levelsValue: forceValue);
TheLib.Execute.Wait(waitTime);
TheLib.Execute.Digital.RunPattern(_pattern[0]);
return TheLib.Acquire.Digital.PatternResults();
},
patResult => patResult
);
}
if (ShouldRunPostBody) {
if (_containsDcviDcvs) {
TheLib.Setup.Dc.Disconnect(_pins);
if (_containsDigitalPins) TheLib.Setup.Digital.Connect(_pins);
}
TheLib.Datalog.TestParametric(_values);
}
}