SPICE reader: recognize `.option scale` and suffixed scale factors
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C++
- Estrellas
- 1.2k
- Forks
- 305
- Merge medio
- 3 d 2 h
- PR fusionados (30 d)
- 11
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de KLayout/klayout
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
KLayout/klayout#2554 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
KLayout/klayout#2412 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
DRC functions not working properly with clip in placePosiblemente ocupada @klayoutmatthias la tomó hoy. Abiertobug
KLayout/klayout#2553 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
Los mantenedores suelen responder en 1 día
-
Deep DRC can miss violations when a cell has many shapesQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
KLayout/klayout#2546 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de KLayout/klayout
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Integer underflow and buffer overrun in detail::count_rows on disconnected distance matricesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
LaneDibello/Kotor-Patch-Manager#375 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día