Table of Contents

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
TestCodeBase
PatternHandshake
Inherited Members
TestCodeBase.AbortTest()
TestCodeBase.DebugBreak()
TestCodeBase.TheExec
TestCodeBase.TheHdw
TestCodeBase.TheProgram
TestCodeBase.FlowDomains
TestCodeBase.ShouldRunPreBody
TestCodeBase.ShouldRunBody
TestCodeBase.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

pattern Pattern

Pattern name to be executed.

stopFlag int

Pattern flag to stop at.

numberOfStops int

Number of total stop in the pattern.

executableClass string

Fully-qualified name of class which contains properties and Execute() to be called at each stop.

testFunctional bool

Whether to test the functional results.

setup string

Optional. 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:

  1. Starts the pattern
  2. Waits for the cpu flag condition to occur defined by the stopFlag parameter
  3. Executes the stopAction delegate function, passing in the pattern and the current stop index.
  4. Adds the results returned from the stopAction delegate to its return value
  5. Continues to the next pattern stop by clearing the stopFlag
  6. 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

forcePinList PinList

The pins to modify in the pattern.

pattern Pattern

The pattern to execute.

patternModule string

The pattern module containing the vector block.