Corrections

This is a guide on how to utilize the PreFab Python API for correcting the fabrication of a target structure using a silicon-on-insulator (SOI) e-beam process. The tutorial is designed to help you navigate the following steps:

  1. Preparing an image of the target structure for correction
  2. Executing a correction
  3. Analyzing the results of a correction

Required libraries

To begin, we need to import the necessary libraries:

import matplotlib.pyplot as plt
import prefab as pf

Loading a device image

The first step involves preparing a device image for correction. Refer to GDS for a guide on reading from GDS layout files. This requires loading an image of a device as a numpy matrix with binary pixel values: 0 or 1. In this tutorial, we'll use an image of a cross, but feel free to explore with other structures available in /devices or on GitHub, or include your own images.

The image scale should ideally be 1 nm/px. If not, ensure you specify the actual length of the device image (in nanometers) when loading the image. In this case the image is 256 px wide, and the device is 256 nm wide, so we can omit the img_length_nm parameter.

IMG_LENGTH_NM = 1000
device = pf.load_device_img(
    path="../devices/target_32x128_256x256.png",
    img_length_nm=IMG_LENGTH_NM
)

plt.imshow(device)
plt.title("Nominal Device")
plt.ylabel("Distance (nm)")
plt.xlabel("Distance (nm)")
plt.show()

Making a correction

Next, we perform the correction on our target structure. Each model is labeled by its fabrication facility and process name, model version, and dataset version. Refer to Models for the list of available models.

By default, the corrector provides raw corrections, which include "fuzzy" or uncertain areas of the structure that may vary between different fabrication runs or even between different instances of the same target structure on the same chip. However, by choosing a binarized output, the corrector will output the most likely corrected design, creating a fabricatable structure. It's also possible to binarize the output post-correction, allowing you to compare both the raw and binarized corrections.

# Note: Initial correction may take longer due to server startup and model loading.
#       Subsequent corrections will be quicker.

MODEL_NAME = "ANT_NanoSOI"
MODEL_TAGS = "v5-d4"
correction = pf.correct(
    device=device,
    model_name=MODEL_NAME,
    model_tags=MODEL_TAGS,
    binarize=True
)

plt.imshow(pf.binarize(correction))
plt.title("Corrected Device")
plt.ylabel("Distance (nm)")
plt.xlabel("Distance (nm)")
plt.show()

Correction analysis

The prediction analysis technique in Predictions is a powerful tool for understanding the potential variations in the fabrication process. It provides a probabilistic prediction of the fabrication outcome, rather than a deterministic one. This means that instead of predicting a single, definite outcome, it provides a range of possible outcomes, represented as a "region of uncertainty".

This region of uncertainty is crucial for design refinement and process optimization. It allows designers to anticipate potential fabrication variations and adjust their designs accordingly to achieve the desired performance. For example, if the analysis identifies high uncertainty in the rounding of a device's corners, the designer might choose to adjust the design to be more robust to such variations.

In the correction process, the corrector compensates for expected deterministic fabrication errors by adjusting the design. It adds silicon in places where it predicts an over-etch and removes silicon where it predicts an under-etch. This helps to mitigate the effects of the fabrication variations, leading to a final device that is closer to the intended design.

By combining the prediction analysis with the correction process, we can effectively manage the uncertainties in the fabrication process. This leads to more reliable and consistent fabrication outcomes, improving the overall quality and performance of the fabricated devices.

variation = device - correction
plt.imshow(variation, cmap="jet", vmin=-1, vmax=1)
plt.title("Changes to Device")
plt.ylabel("Distance (nm)")
plt.xlabel("Distance (nm)")
cb = plt.colorbar()
cb.set_label("Added Silicon                    Removed Silicon")
plt.show()

In the final step, we predict the fabrication outcomes for both the nominal and corrected target structures using the prediction model. We then visualize the predicted outcomes, highlighting the fidelity improvements achieved through the correction process.

In the corrected design, the corners are expected to be sharper and the middle openings are better resolved compared to the nominal design.

outcome = pf.predict(
  device=correction, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True
)
prediction = pf.predict(
    device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True
)

fig, axs = plt.subplots(1, 2, figsize=(10, 5))
axs[0].imshow(prediction)
axs[0].imshow(pf.generate_device_contour(device), cmap="spring")
axs[0].set_title("Prediction of Nominal Device")
axs[0].set_ylabel("Distance (nm)")
axs[0].set_xlabel("Distance (nm)")
axs[1].imshow(outcome)
axs[1].imshow(pf.generate_device_contour(device), cmap="spring")
axs[1].set_title("Prediction of Corrected Device")
axs[1].set_xlabel("Distance (nm)")
plt.show()