首页/硬件与电子工程/semiconductor-photomask-design-skill
S

semiconductor-photomask-design-skill

by @Elder-Driverv
3.5(20)

用 Python 和 gdstk 参数化生成可制造 GDSII 光罩版图,并完成导出后校验。它把尺寸、层号、标签、对准标记、阵列和禁布区当作制造数据管理,适合半导体与微纳加工团队快速迭代掩模设计、做参数扫描和流片前检查,减少读图与几何错误。

photomaskgdsiigdstkpythonsemiconductorGitHub
安装方式
git clone https://github.com/Elder-Driver/semiconductor-photomask-design-skill.git
compare_arrows

Before / After 效果对比

1 组
使用前

手动写 gdstk 脚本,尺寸和层号散落,标签用注释代替,对准标记与阵列靠目测,导出后不读回 GDS,容易遗漏禁布冲突和单位精度错误。

使用后

用参数化源文件和读回校验流程,层号、标签、对准标记、阵列、禁布区自动生成并检查,只在冲突时省略器件,GDS 边界、单元和重复数可追踪。

SKILL.md

name: designing-python-photomasks description: Use when creating, modifying, or checking Python-generated GDSII photomasks with gdstk, including geometric features, physical labels, alignment marks, parameter sweeps, arrays, keepouts, and sample-bound validation.

Designing Python Photomasks

Overview

Create a parameterized Python source of truth, export GDSII, and verify the serialized file rather than trusting an in-memory preview. Treat all dimensions, layer assignments, label geometry, alignment features, and placement rules as fabrication data.

Workflow

  1. Inspect existing Python and reference GDS files when present. Read actual layers, polygons, references, and bounds; do not infer geometry from display color or screenshots alone.
  2. Establish a compact design contract: user unit and precision, sample envelope, layer/datatype map, polarity, diameter versus radius, per-side clearances, label convention, alignment-mark geometry, and array rules. Ask only about missing choices that materially change fabrication; otherwise expose assumptions as named parameters.
  3. Build reusable cells for devices, labels, and marks. Place them with references in a top cell. Keep fabrication layers explicit on every polygon.
  4. Use parameter lists as the source of design variants. Derive human-readable labels from those parameters and keep a Markdown table of design IDs, dimensions, repeat counts, and later performance.
  5. Place alignment marks at explicit coordinates. Compute conflicts from placed device bounding boxes and keepout boxes, then omit only conflicting references. Prefer integer-micrometre centers when instrument coordinates require them.
  6. Write GDS, read it back with gdstk.read_gds, and verify units, precision, layers, cell/reference counts, critical bounds, labels, mark origins, per-design repeats, and the full sample envelope. Also inspect the result in KLayout before fabrication.

Geometry Rules That Prevent Common Errors

  • “Clearance on every side” changes a diameter by twice the clearance.
  • Use gdstk.ellipse(..., inner_radius=...) for a true annulus. Use Boolean subtraction only when the inner and outer shapes are not concentric circles.
  • gdstk.text returns physical polygons; it is not a viewer annotation. Put labels on the process layer that should print.
  • GDS stores curves as polygons. Visible segment boundaries or fracture lines in a viewer are not automatically physical gaps; verify polygon continuity and Boolean union when continuity matters.
  • For a lead that must touch a ring, overlap the intended region explicitly. A merely coincident-looking preview is not sufficient.
  • Reuse cells with references; do not flatten the fabrication GDS merely to make an SVG viewer happy. Flatten only a separate preview when necessary.

References and Starter

Deliverables

Return the parameterized Python source, generated GDS, any useful layer/overlay preview, a design/performance table for parameter sweeps, and verification evidence. State what was checked automatically and what still requires KLayout or fabrication review.

--- README.md ---

Semiconductor Photomask Design Skill

A reusable Codex skill for designing semiconductor and microfabrication photomasks with Python and gdstk. It helps turn a geometry and process-layer specification into parameterized, inspectable GDSII layout rather than a one-off drawing.

Use it for devices with circles, annuli, rectangles, leads, physical text labels, alignment marks, parameter sweeps, repeated arrays, keepouts, and sample-bound checks.

What it covers

  • Explicit GDSII units, layers, datatypes, and cell hierarchy
  • Disks, rings, Boolean geometry, connected leads, and split-layer alignment marks
  • Physical GDS polygon labels such as 30-1
  • Parameterized design variants and repeat-count tracking
  • Alignment-mark placement with integer coordinates and minimal device removal
  • GDS export followed by readback validation of geometry, layers, labels, marks, references, and sample bounds

The included starter script produces a two-layer example GDS and validates it after serialization:

python3 -m pip install -r requirements.txt
python3 assets/gdstk_photomask_starter.py --output output/starter_mask.gds

Use as a Codex skill

Clone this repository into either a project-local .agents/skills/ directory or your Codex skills directory, then invoke it by name:

Use $designing-python-photomasks to create a parameterized GDS mask for a two-layer semiconductor device array.

The skill entry point is SKILL.md. It routes to focused references for primitives and labels, or arrays, alignment marks, and GDS validation.

Fabrication boundary

This skill creates and validates layout data. It does not determine resist polarity, mask-writer fracture settings, foundry minimum feature rules, process overlay accuracy, or electrical performance. Review the exported GDS in KLayout and run the applicable foundry/process DRC before fabrication.

License

MIT. See LICENSE.

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量0
评分3.5 / 5.0
版本
更新日期2026年9月29日
对比案例1 组

用户评分

3.5(20)
5
35%
4
35%
3
15%
2
10%
1
5%

为此 Skill 评分

0.0

兼容平台

🔧Manual

时间线

创建2026年9月29日
最后更新2026年9月29日
🎁 Agent 知识卡片
调研问卷