Educational implementation of optical proximity correction (OPC) and inverse lithography technology (ILT) for semiconductor manufacturing.
- Hopkins imaging model simulation
- Rule-based OPC (bias, assist features)
- Model-based OPC
- Gradient-based ILT
- Process window metrics
# Clone the repository
git clone https://github.com/Akbar-0/computational-lithography.git
cd computational-lithography
# Install in development mode
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"import numpy as np
from comp_litho import HopkinsModel
# Create imaging model (ArF 193nm lithography)
model = HopkinsModel(
wavelength=193.0, # ArF excimer laser
NA=1.35, # Numerical aperture
sigma=0.8, # Partial coherence
pixel_size=2.0, # 2nm pixels
)
# Create a simple mask pattern
mask = np.zeros((256, 256))
mask[:, 100:150] = 1 # Vertical line
# Simulate aerial image
aerial_image = model.simulate(mask, defocus=0.0, dose=1.0)
# Simulate resist development
resist_pattern = model.simulate_resist(aerial_image, threshold=0.5)
# Measure critical dimension
cd = model.calculate_cd(resist_pattern, direction='x')
print(f"Critical dimension: {cd:.2f} nm")from comp_litho import HopkinsModel, RuleBasedOPC
# Create imaging model and OPC engine
model = HopkinsModel(wavelength=193.0, NA=1.35, sigma=0.8)
opc = RuleBasedOPC(bias=5.0, sraf_enabled=True)
# Apply OPC corrections
target = create_your_pattern()
opc_mask = opc.correct(target, pixel_size=2.0)
# Simulate corrected mask
aerial = model.simulate(opc_mask)
resist = model.simulate_resist(aerial)from comp_litho import HopkinsModel, ModelBasedOPC
model = HopkinsModel(wavelength=193.0, NA=1.35)
opc = ModelBasedOPC(
imaging_model=model,
target_cd=100.0,
tolerance=2.0,
max_iterations=10
)
# Optimize mask to match target
target = create_your_pattern()
optimized_mask = opc.correct(target, pixel_size=2.0, verbose=True)from comp_litho import HopkinsModel, GradientILT
model = HopkinsModel(wavelength=193.0, NA=1.35)
ilt = GradientILT(
imaging_model=model,
learning_rate=0.05,
regularization=0.001,
max_iterations=100
)
# Find optimal mask for target pattern
target = create_your_pattern()
ilt_mask = ilt.optimize(target, verbose=True)
# Binarize for manufacturing
binary_mask = ilt.binarize_mask(ilt_mask)from comp_litho import HopkinsModel, ProcessWindow
model = HopkinsModel(wavelength=193.0, NA=1.35)
pw = ProcessWindow(
imaging_model=model,
dose_range=(0.9, 1.1),
focus_range=(-100, 100),
cd_tolerance=5.0
)
mask = create_your_mask()
# Calculate metrics
dof = pw.calculate_dof(mask, target_cd=100.0)
el = pw.calculate_exposure_latitude(mask, target_cd=100.0)
pw_area = pw.calculate_overlapping_process_window(mask, target_cd=100.0)
print(f"Depth of Focus: {dof:.2f} nm")
print(f"Exposure Latitude: {el:.2f}%")
print(f"Process Window: {pw_area*100:.1f}%")Complete examples are available in the examples/ directory:
01_basic_simulation.py- Basic Hopkins model simulation02_rule_based_opc.py- Rule-based OPC demonstration03_gradient_ilt.py- Gradient-based ILT optimization04_process_window.py- Process window analysis
Run an example:
cd examples
python 01_basic_simulation.py# Install pytest if needed
pip install pytest
# Run all tests
pytest tests/ -v
# Run specific test file
pytest tests/test_imaging.py -vThe Hopkins model describes partially coherent imaging in lithography systems. The aerial image intensity is computed as:
where:
-
$S$ is the source distribution -
$M$ is the mask spectrum -
$P$ is the pupil function -
$\mathbf{r}$ is the position on the wafer
OPC compensates for optical proximity effects by pre-distorting the mask pattern. Two approaches are implemented:
- Rule-based OPC: Uses geometric rules (bias, serifs, SRAFs)
- Model-based OPC: Iteratively adjusts mask using lithography simulation feedback
ILT formulates mask design as an inverse problem, finding the optimal mask
where:
-
$I(m)$ is the simulated image from mask$m$ -
$t$ is the target pattern -
$R(m)$ is a regularization term -
$\lambda$ is the regularization weight
The optimization uses gradient descent to iteratively improve the mask.
The process window quantifies robustness to process variations (dose and focus). Key metrics:
- Depth of Focus (DOF): Range of focus yielding acceptable CD
- Exposure Latitude (EL): Range of dose yielding acceptable CD
- NILS: Normalized image log slope (edge sharpness metric)
computational-lithography/
├── src/comp_litho/ # Main package
│ ├── __init__.py # Package initialization
│ ├── imaging.py # Hopkins imaging model
│ ├── opc.py # OPC implementations
│ ├── ilt.py # ILT implementation
│ └── metrics.py # Process window metrics
├── examples/ # Example scripts
├── tests/ # Unit tests
├── requirements.txt # Dependencies
├── setup.py # Package setup
└── README.md # This file
- Python >= 3.8
- NumPy >= 1.24.0
- SciPy >= 1.10.0
- Matplotlib >= 3.7.0
- scikit-image >= 0.20.0
- gdspy >= 1.6.0 (for GDS layout handling)
This is an educational project. Contributions, bug reports, and suggestions are welcome!
See LICENSE file for details.
- Wong, A. K. (2001). Resolution Enhancement Techniques in Optical Lithography. SPIE Press.
- Poonawala, A., & Milanfar, P. (2007). "Mask design for optical microlithography—An inverse imaging problem." IEEE Transactions on Image Processing.
- Mack, C. A. (2007). Fundamental Principles of Optical Lithography. Wiley.
Future enhancements:
- Source-mask optimization (SMO)
- Curvilinear ILT with manufacturing constraints
- Advanced pupil filters (phase-shift masks, off-axis illumination)
- 3D resist simulation
- GDS file import/export
- GPU acceleration