Using a Python Transform in WaferPro Express to Export Measured Data

Document created by michea on Mar 5, 2019Last modified by michea on May 23, 2019
Version 2Show Document
  • View in full screen mode

Since its introduction in 2015, WaferPro Express (WPE) has become the workhorse test executive for wafer level measurements and device characterization, combining the instrument automation of IC-CAP with wafer mapping and prober control. The software ships with numerous instrument drivers and routines that may be leveraged for all the most common measurements. The measurements are hierarchically organized by device type (MOSFET, BJT, DIODE, etc.), measurement type (DC, CV, S-parameter), routines (measurement configurations) and setups (instantiations of the routines).  Using any of the built-in routines, one can store measurement data with wafer information during the execution of a test plan.  For example, one can store measured DC I-V curves and single point extracted values for each device that is to be probed at every site across the wafer. 

 

But what if the test conditions required of one routine depend on extracted parameters from an earlier routine?  The earlier routine would need to not only collect the data but also output a relevant figure of merit. In other words, it might be useful to have interim data stored in an MDM file that could be read later from IC-CAP.  In this blog post, I will show you how, using the built-in Python environment within WaferPro Express. 

 

There are several IC-CAP functions available through the Python API included in WPE through the Python library iccap.py, located in the WaferPro Express installation directory C:\Keysight\WAFERPROXP_version>\iccap\lib\python. The icfuncs object within iccap.py provides several high-level functions for accessing IC-CAP data structures and writing them to a file in IC-CAP MDM format.

 

I recommend creating your own reusable Python utilities that you can call from any WPE project. Conveniently, the directory  <WPE_USER_HOME>/python is always accessible to any project, so that if you simply use import "your_python.py" to load a file in that directory, all of the functions in that file will become available to your WPE routine. You can grow and add capabilities to the utility module without having to modify transforms that you have written in the past.

 

In this example I will demonstrate how to initialize and execute a set of Python-based transforms within the WPE environment. I will also illustrate post measurement analysis on I-V data to extract threshold voltage (Vth). Finally, I will show how to export the measured data along with transform data to an MDM formatted file.  In this case, we will record drain current ID versus gate voltage VG data along with its derivative GM to our output .MDM file.

 

At the bottom of this post, I have attached the WPE project file with the full external utility Python source code.  I recommend backing up your existing <WPE_USER_HOME> directory (typically it is located in C:\Users\<username>\hpeesof\waferpro_2018), extracting the attachment and copying it to this directory.  To get started let's first load the WPE project.

 

Open the WPE Project File

1. Select File -> Open Project... and then either select Open Recent Project or Open Other Project ...

2. Select the <WPE_USER_HOME>\projects folder, which in my case is C:\Users\username\hpeesof\waferpro_2018\projects.

3. Select the Py_Ex_Derivative.wpx file to load the example project file.

 

Set System Variable debug = 1

1. Goto Menu -> Edit -> System Variables to edit the system variables table.

2. Add a variable named debug and set its value to 1 with the optional comment enable/disable debug printing

 

Open the Routine Editor

1. Goto Menu -> Edit -> Library and select Routine (Measurement Template)...

2. Select the MOSFET -> PYTHON -> WPro_Ex_Derivative_py folder in the routine editor window.

 

routinelibs python

 

Troubleshooting: If you do not see the WPro_Ex_Derivative_py in the list of Routines as shown above, then you can dig the routine out of the attached zip file. Copy the file waferpro_2018.zip\waferpro_2018\config\RoutineLibs\Routine~WPro_Ex_Derviative_py.dut file to the your <WPE_USER_HOME>\config/RoutineLibs directory. After restarting WaferPro Express, reloading the project and opening the routine editor, you should be able to find WPro_Ex_Derivative_py as shown above.  More elegantly, you can click the Load From File button on the toolbar of the Routine Editor to select the file WPro_Ex_Derivative_py.dut from the location where you saved and extracted the attached waferpro_2018.zip.

 

routinelibs from file 

  

3. Select Derivative

This will open the Setup and display the Inputs and Outputs. Notice the "Inputs (Stimulus)" block contains VG and "Outputs (Response)" block  contains the measured parameter ID.

      

Note: The measured data is not measured in real-time, but rather defined as lists of x-y data in a Python program (or "algorithm") called idvg_derivative.py.  The __init__ function of the of the class idvg_derivative defines the x-y data arrays and initializes their values.   The Start, Stop and NPoints (number of points) values have been set to the same values of the sample data that we have defined in idvg_derivative.py.  These values need to match the x-y data exactly or else errors will occur when storing the data to the WPE internal data structures.

 

 

setup inputs outputs

 

4. Select the Edit Transform button to view the transforms defined for the Derivative Setup.

 

Observe the following transforms that have been defined for this example project: WPRO_INIT, WPRO_EXECUTE and WPRO_ANALYZE

 

Note:  WaferPro Express executes WPRO_INIT and WPRO_EXECUTE when the Manual Measurement or Start/Resume Test Plan button is selected.

 

wpro_init

 

The WPRO_INIT transform is where you can specify imports of common Python modules that you will need to use throughout your project. In addtion I set the sys.path to include the directory <WPRO_USER_HOME>\python, so that WPE knows where to load my user Python .py files. This transform can also be used to set various Global Variables which are available from the WPE runtime environment.

 

After executing the WPRO_INIT transform, WPE will execute the WPRO_EXECUTE transform and any statements contained within.  In this example we import the idvg_derivative.py module which implements the functionality of our algorithm to simulate our Id vs. Vg measurement and return the ID and VG data to WPE. You can see that we first instantiate the class idvg_derivative passing it the current RoutineName ("dname") and SetupName ("sname") and then call the run( ) function.

 

We can then set the simulated I-V data by transferring the arrays to WPE data structures by subsequently calling the set_IC_Data( ) function.  Once the data is transfered to the WPE data structures the export_IC_Data( ) function can be called to write the results to a user specified .MDM formatted file.  After the data has been acquired WPRO_EXECUTE can call the WPRO_ANALYZE transform to perform any post-processing of the data. In our example we will compute the derivative of the Id vs. Vg data and then extract the threshold voltage Vth.

 

By simply using these 3 transforms we can perform initialization, measurement and post-analysis. 

 

wpro_execute

 

You can enable or disable the export to MDM file by setting the export_Results_MDM variable in the Setup Variable

table. There are a few other variables in the Setup Variable table which provide the PATH and FileName of the exported MDM file.

 

 

setup_variables

 

To export the data from your transforms you need to specify MDM_EXPORT_XFORM_DATA = True and provide the MDM_XFORM_LIST in order for your transform data to also be written to the file. In this example the GM data vector will be written to the MDM file. The _calc_vth_gm_max G specifies the transform data to be exported. _calc_vth_gm_max is the label for the data set that was created by the statement set_return_array("M", gm) in the transform and the G specifies the data type to be of type transconductance.  This additional type parameter is important as it allows exporting only the Real part of the measured data which is natively stored as a Complex data type. Without the G parameter the Real and Imaginary data vectors would be exported to the file.

 

5. In order to interactively test the code you can simply select the transforms WPRO_INIT and WPRO_EXECUTE and click the Execute button for each one in Routine Editor -> Edit Transform window.  Now you should find the time stamped MDM vth_gm_max (i.e. vth_gm_max_2019_05_29_17_01_14.mdm) file stored in the <WPE_USER_HOME>\data\example\mdm directory.   

 

! VERSION = 6.00
BEGIN_HEADER
ICCAP_INPUTS
VG V _NA_ GROUND SMU1 1E-006 LIN 1 0 1.65 34 0.05
ICCAP_OUTPUTS
ID I _NA_ GROUND SMU1 B
_calc_vth_gm_max G
END_HEADER

BEGIN_DB

#VG       ID             R:_calc_vth_gm_max(1,1)
 0        8.33e-012      -3.841e-010
 0.05     3.607e-011      1.4937e-009
 0.1      1.577e-010      6.5789e-009
 0.15     6.9396e-010     2.8886e-008

 ...

 

Running the Algorithm from WPE

 

To Run this routine in the WPE environment you need to perform a few additional steps.

1. Create a Measurement Group by selecting Edit -> Measurement Groups ...

2. Add New Measurement Group

 

measurement group add python

 

3. Select PYTHON and define MeasGroup1

 

measure group1

 

4. Select Derivative

 

measure group derivative

 

5. Next create an entry in the Measurement Device Table and select the PYTHON:MeasGroup1

 

measurement device table

 

6. Press the Run Manual Measurement button

7. Press Measure to execute the custom Python algoithm

 

manual measurement execute

 

8. Observe the VTH results.

 

 

DEEP DIVE

 

The following is a program listing of each of the transform included in the project with a discussion of the function of each transform. Please review

the Python source code for detailed implementation details.

 

WPRO_INIT

 

The WPRO_INIT transform is called when the Run Manual Measurement or Start/Resum Test Plan button is pressed.

This transform performs a high-level initialization including appending the path to our User Python files to the sys path. We also import the external Python modules and then get the current RoutineName and SetupName variables to be used in some of our other transforms and external functions. 

 

Note:  You should always execute this transform first before any of the other transforms in order to initialize these variables.

 

# update: explicit

#############################################################################

#

# [WPRO_INIT]

#

# WaferPro Express Initialization

#

#############################################################################

import os

from iccap import *

import sys

sys.path.append( os.getenv('USERPROFILE') + "/hpeesof/waferpro_2018/python")

 

import numpy as np

import ic_export_data as ex

from ic_export_data import *

import itertools

 

. . .

 

#--- Define local variables for this Program

thisSetup = Setup(".")

_, mname, dname, sname = thisSetup.get_fullname().split("/")

Path2Setup = thisSetup.get_fullname()

RoutineName = dname

SetupName = sname

print "WaferPro Express Initializing ... "

print "Routine = {} Setup = {}".format(dname, sname)

 

. . .

 

#-------------------------

set_return_value(1)

 

 

WPRO_EXECUTE

 

The WPRO_EXECUTE transform is called after WPRO_INIT when the Run Manual Measurement or Start Test Plan button is pressed.

This performs a high-level execution of our transform to execute a measurement.  Notice we can call other high-level

WaferPro Express API functions such as the Clear Data as well as executing our main idvg_derivative.run( ) function. 

 

WPRO_EXECUTE also optionally calls WPRO_ANALYZE which can perform post-analysis on the measured data set by

calling additional transforms to extract parameters.

 

 

#############################################################################

#

# [WPRO_EXECUTE]

#

# WaferPro Express Execute

#

#############################################################################

# update: explicit

 

#--- Clear data

wpro_func(".", "Clear Data/Both")

 

# instance idvg_derivative algorithm class - passing routine and setup

alg = idvg_derivative(dname, sname)

 

# run measurement and acquire data

alg.run

if bOk: bOk = alg.set_IC_Data()

 

# export data to mdm file

if exp_mdm:

   if bOk: bOk = alg.set_IC_Data()

 

# Call "WPRO_ANALYZE" for data checking, Pass/Fail analysis,

# PT/ET/Spot data calculation and saving, and so forth.

if bOk: iccap_func("WPRO_ANALYZE","execute")

 

#--- Store results

#if Mode.get_val().startswith('Measure'):

# if bOk: bOk = icfuncs.WPro_SaveDataRoutine(Path2Setup)

 

#-------------------------

set_return_value(1)

 

The idvg_derivative.run( ) function is the entry point to our user defined Python-based algorithm which will initialize our measured data arrays,

store the data in the WPE data structures and export the data to the user specified MDM file.

 

The following Python function is implemented in the _run transform and calls the external Python module ic_export_data.py.  This function

uses the built-in WPE function icfuncs.icdbf_export_data() to export the WPE data structure to the MDM file.

 

WPRO_ANALYZE

 

The WPRO_EXECUTE transform is called from the WPRO_EXECUTE transform after the measured data has been returned.

This is an optional transform which can be used for performing post-analysis (i.e. extraction routines for specific parameters.

I this example we call the _calc_vth_gm_max transform which extracts the threshold voltage from the I-V curve using the Extrapolation in Linear Region (ELR) method (see Device Modeling 101 - How to Extract Threshold Voltage of MOSFETs). The transconductance GM is first calculated

by taking the derivative of the I-V data. The Vth values is then extracted by computing a tangent line at the point closest to the index

of the maximum GM value. The x-intercept of the linear equation is the estimated Vth value which is set in the variable vtvalue.

 

 

#############################################################################
#

# [WPRO_ANALYZE]

#

# WaferPro Express Analysis

#

#############################################################################

# update: explicit

 

from iccap import *

import numpy as np

 

# This is run after measurement (data acquisition) in this Setup

# for data checking, Pass/Fail analysis,

# PT/ET/Spot data calculation and saving, and so forth.

 

. . .

 

#--- Run PT/ET/Spot data calculations on the measured data

# and export the point data to WaferPro.

if retNow == 0:

print "Extracting Vth ..."

wpro_func("_calc_vth_gm_max", "Execute")

 

#!--- Export to WaferPro (to be saved in csv file)

if Mode.get_val().startswith('Measure'):

if bOk: bOk = icfuncs.WPro_set_info("Device", "VTH", str(vtvalue))

 

#-------------------------

set_return_value(1)

 

The function icfuncs.WPro_set_info exports the Vth value to the WPE test executive to be save with the wafer map data.   

 

The following Python module listing shows the implementation of the data export to the MDM file functionality. This module is provided as an attachment to this article.

 

ic_export_data.py

import os
import datetime
from iccap import *
import icfuncts as f
#################################################################
#
# Export measured data values to MDM file
#
#################################################################
def ic_export_data_mdm(ds_name):
   """
   Export IC-CAP data structures to MDM formatted file.

   This function uses the icdbf_export_data from iccap_funcs to
   write the IC-CAP data structures to MDM formated file defined
   in Setup variables table.

   Args:
         self:         This instance of the ic_export_data_mdm() function.
   Kwargs:

   Returns:
           bOk       Boolean that indicated success or failure of write op
   Raises:
   """
   bOk = True

   if debug: print "IC export measured data :: setupName : {}".format(ds_name)
   userProfile = os.getenv('USERPROFILE')
   # build the export file using same path and filename from the CSV TableVars
   fileNameMDM_PATH = userProfile + SVar("fileName_PATH").get_val() + "/mdm"
   if debug: print "MDM Filepath is = " + fileNameMDM_PATH
   fileNameMDM = SVar("fileName").get_val() + "_{date:%Y-%m-%d_%H_%M_%S}.mdm".format(date=datetime.datetime.now() )
   if debug: print "MDM Filename is " + fileNameMDM

   mdmFileName = fileNameMDM_PATH + "/" + fileNameMDM
   if debug: print "MDM Full Path and Filename is " + mdmFileName

   # create directory structure if it doesn't exist
   if os.path.isdir(fileNameMDM_PATH) == False:
      os.makedirs(fileNameMDM_PATH)
   else:
      os.chdir(fileNameMDM_PATH)
   
   # open the data file for export
   try:
      dbfo = f.icdbf_open(mdmFileName)
   except AssertionError as e:
      print "{} - unable to open IC-CAP .mdm file {} ".format(e, mdmFileName)
      bOk = False
   # export the measured data for the setup
   if debug: print "Exporting IC-CAP .mdm file: {}".format(mdmFileName)

   try:
      f.icdbf_export_data(dbfo, ds_name, "M")
   except AssertionError as e:
      print "{} - unable to export IC-CAP data to .mdm file: {} ".format(e, mdmFileName)
   f.icdbf_close(dbfo)

   return bOk;

 

 

Conclusion

 

I hope this quick example of developing custom Python transforms for extracting the gate threshold voltage and exporting data will serve as a starting point for developing your own custom routines for use in WaferPro Express.  In follow on articles, I will demonstrate additional features of WPE to streamline and customize your Python transforms using the WPE's built-in user interface elements to allow using parameters entered in the Inputs / Outputs tables to provide settings for use in your Python transforms. 

 

References

 

Python Programming in WaferPro Express

WaferPro Express Functions

Device Modeling 101 - How to Extract Threshold Voltage of MOSFETs

 

 

 

Attachments

Outcomes