Class PatternHandshake
- Namespace
- CsraTestMethods.Parametric
- Assembly
- CsraTestMethods.dll
[TestClass(Creation.TestInstance)]
[Serializable]
public class PatternHandshake : TestCodeBase
Overview
TestClass for all pattern handshaking related TestMethods.
Platform Specifics
Uses per test-instance test class object persistence ([TestClass(Creation.TestInstance)] attribute).
- Inheritance
-
TestCodeBasePatternHandshake
- Inherited Members
-
TestCodeBase.AbortTest()TestCodeBase.DebugBreak()TestCodeBase.TheExecTestCodeBase.TheHdwTestCodeBase.TheProgramTestCodeBase.FlowDomainsTestCodeBase.ShouldRunPreBodyTestCodeBase.ShouldRunBodyTestCodeBase.ShouldRunPostBody
Methods
Baseline(Pattern, int, int, string, bool, string)
Runs the specified pattern and executes executableClass's Execute() at each occurance of stopFlag in the pattern. Every result will be datalogged.
[TestMethod]
[Steppable]
[CustomValidation]
public void Baseline(Pattern pattern, int stopFlag, int numberOfStops, string executableClass, bool testFunctional, string setup = "")
Parameters
patternPatternPattern name to be executed.
stopFlagintPattern flag to stop at.
numberOfStopsintNumber of total stop in the pattern.
executableClassstringFully-qualified name of class which contains properties and Execute() to be called at each stop.
testFunctionalboolWhether to test the functional results.
setupstringOptional. Action to configure the dib or device.
Details
Test Technique
- to be added
Implementation
The Validation section instantiates the pattern object and converts the stopAction parameter into a delegate that can be called. In order for this
conversion to occur, there must be a function in the loaded dll's that is the same name as the stopAction parameter and has the prototype:
public static List<PinSite<double>> name(PatternInfo pattern, int stops);
The PreBody section applies levels and timing from the test instance context. Optionally, applies the specified config.
The Body section executes the RunPatternConditionalStop method and stores the results in values. The RunPatternConditionalStop method performs the following:
- Starts the
pattern - Waits for the cpu flag condition to occur defined by the
stopFlagparameter - Executes the
stopActiondelegate function, passing in thepatternand the current stop index. - Adds the results returned from the
stopActiondelegate to its return value - Continues to the next pattern stop by clearing the
stopFlag - Repeat steps 2-5 for each stop in the
pattern
All cpu flags that are present in the pattern must be properly handled during the RunPatternConditionalStop method or the patgen will hit a timeout. It is
possible to have different flag conditions for each stop. These can be updated by the stopAction delegate through the pattern SetFlag parameter.
The PostBody conditionally logs the functional test record and logs each parametric result returned by the stopAction delegate.
Platform Specifics
Supports stepping capability for PreBody/Body/PostBody.
Pre Conditions
- none
Post Conditions
- none
Limitations
- none
Code Reference
[TestMethod, Steppable, CustomValidation]
public void Baseline(Pattern pattern, int stopFlag, int numberOfStops, string executableClass, bool testFunctional, string setup = "") {
if (TheExec.Flow.IsValidating) {
TheLib.Validate.Pattern(pattern, nameof(pattern), out _pattern);
TheLib.Validate.GreaterOrEqual(stopFlag, 0, nameof(stopFlag));
TheLib.Validate.GreaterOrEqual(numberOfStops, 0, nameof(numberOfStops));
_pattern[0].SetFlags = stopFlag;
TheLib.Validate.GetObjectByClassName(executableClass, out _executableObject);
_executableObject.Vcc = new Pins("vcc");
}
if (ShouldRunPreBody) {
TheLib.Setup.LevelsAndTiming.Apply(true);
Services.Setup.Apply(setup);
}
if (ShouldRunBody) {
TheLib.Execute.Digital.RunPatternConditionalStop(_pattern[0], numberOfStops, _executableObject);
if (testFunctional) _patResult = TheLib.Acquire.Digital.PatternResults();
}
if (ShouldRunPostBody) {
if (testFunctional) TheLib.Datalog.TestFunctional(_patResult, pattern);
foreach (PinSite<double> value in _executableObject.Result) {
TheLib.Datalog.TestParametric(value);
}
}
}
PatternLabelOverWrite(PinList, Pattern, string)
Demonstrates modifying vector block data using different data ordering methods and reading back pattern values.
[TestMethod]
[Steppable]
[CustomValidation]
public void PatternLabelOverWrite(PinList forcePinList, Pattern pattern, string patternModule)
Parameters
forcePinListPinListThe pins to modify in the pattern.
patternPatternThe pattern to execute.
patternModulestringThe pattern module containing the vector block.