Writing Test Code
Complete the following steps to use Semiconductor Test Library in your test code:
- Create a new TSMSessionManager object and any other local variables that are necessary for your test.
- Use the TSMSessionManager object to query the session for the target pins.
- Configure the instrumentation connected to the target pins and configure the relay modules.
- Source and/or measure the signals.
- Burst the patterns required to configure the DUT.
- Calculate and/or publish the required test results.
- Repeat steps 4 through 6 as necessary for your test.
- Clean up and restore the state of the instrumentation after finishing the test.
Example C# Code Snippet of Workflow
public static void WorkFlowExample(
ISemiconductorModuleContext semiconductorModuleContext,
string[] sumPinNames,
string[] digitalPinNames,
string relayConfigBeforeTest,
string relayConfigAfterTest,
string patternName)
{
var sessionManager = new TSMSessionManager(semiconductorModuleContext);
double voltageLevel = 3.3;
double currentLimit = 0.01;
double settlingTime = 0.001;
var measureSettings = new DCPowerMeasureSettings()
{
ApertureTime = 0.001,
Sense = DCPowerMeasurementSense.Remote
};
var smuPins = sessionManager.DCPower(sumPinNames);
var digitalPins = sessionManager.Digital(digitalPinNames);
smuPins.ConfigureMeasureSettings(measureSettings);
semiconductorModuleContext.ApplyRelayConfiguration(relayConfigBeforeTest, waitSeconds: settlingTime);
smuPins.ForceVoltage(voltageLevel, currentLimit);
PreciseWait(timeInSeconds: settlingTime);
var currentBefore = smuPins.MeasureAndPublishCurrent(publishedDataId: "CurrentBefore");
digitalPins.BurstPatternAndPublishResults(patternName, publishedDataId: "PatternResults");
PreciseWait(timeInSeconds: settlingTime);
var currentAfter = smuPins.MeasureAndPublishCurrent(publishedDataId: "CurrentAfter");
var currentDifference = currentBefore.Subtract(currentAfter).Abs();
semiconductorModuleContext.PublishResults(currentDifference, publishedDataId: "CurrentDifference");
smuPins.ForceVoltage(voltageLevel: 0, currentLimit: 0.001);
PreciseWait(timeInSeconds: settlingTime);
semiconductorModuleContext.ApplyRelayConfiguration(relayConfigAfterTest, waitSeconds: settlingTime);
}