SPICE reader: recognize `.option scale` and suffixed scale factors
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start with the NetlistSpiceReader control-statement handling for .options and .option, and with where the scale value is parsed through tl::Extractor::try_read(double). Run the Python repro from the issue against the three directives and confirm that L and W come out as 0.45 and 1.5 in each case. Done means that .option scale=1e-6 is accepted without a warning, that suffixed values such as 1u scale correctly, and that the reader tests still pass.
索引モデルが issue の本文から書いたものです。
説明
NetlistSpiceReader can read micrometre geometry one million times too large when a deck uses the ngspice scale syntax found in sky130 model libraries.
For the same native M device:
| Directive | Read L (µm) |
Read W (µm) |
|---|---|---|
.options scale=1e-6 |
0.45 | 1.5 |
.options scale=1u |
450000 | 1500000 |
.option scale=1e-6 |
450000 | 1500000 |
Expected: all three declarations yield L=0.45, W=1.5. The singular spelling emits a control-statement warning. The suffixed value is accepted without the intended scaling.
The sky130 model library uses .option scale=1.0u. This affects comparison of those schematic dimensions with layout geometry.
from pathlib import Path
from tempfile import TemporaryDirectory
import pya
with TemporaryDirectory() as directory:
path = Path(directory) / 'scale.cir'
for option in ('.options scale=1e-6', '.options scale=1u', '.option scale=1e-6'):
path.write_text('* scale\n' + option + '\n.subckt cell d g s b\n'
'M1 d g s b n L=0.45 W=1.5\n.ends\n', encoding='utf-8')
netlist = pya.Netlist()
netlist.read(str(path), pya.NetlistSpiceReader())
device = next(netlist.top_circuit().each_device())
print(option, device.parameter('L'), device.parameter('W'))
Run with klayout -b -r repro.py, or replace import pya with import klayout.db as pya when using the Python module.
Current master still recognizes only .options and reads its value with tl::Extractor::try_read(double), which leaves the SPICE suffix unconsumed.
Versions: KLayout Python module 0.30.13 from PyPI, Python 3.14, macOS; ngspice 47 used to verify the intended geometry-scale behavior
- 主要言語
- C++
- スター
- 1.2k
- フォーク
- 305
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 11
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
KLayout/klayout のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
KLayout/klayout#2554 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
KLayout/klayout#2412 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
DRC functions not working properly with clip in place対応中かも @klayoutmatthias が今日担当しました。 オープンbug
KLayout/klayout#2553 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
Deep DRC can miss violations when a cell has many shapes再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
KLayout/klayout#2546 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
KLayout/klayout の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
LaneDibello/Kotor-Patch-Manager#375 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信