Skip to content

Py input - #264

Merged
nanocoh merged 4 commits into
mainfrom
pyInput
Oct 5, 2026
Merged

nanocoh merged 4 commits into
mainfrom
pyInput

Conversation

@nanocoh

@nanocoh nanocoh commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

… API

A design can now be given as Python scripts, the way py_tech_files give
primitives. Each script defines constructLibrary(lib) and creates the
design's modules, instances and nets with the naja module; the scripts of a
design run in order against the same library. Primitives come from
py_tech_files or Liberty as in every other mode, and a script looks a cell
up in the database's primitive libraries, since a Liberty library keeps the
name declared in its file.

CLI: -python / -py with --python_design1_top / --python_design2_top. YAML:
format: python (or py) with python_design1_top / python_design2_top. The
format is valid for LEC and SEC. The loader interface gains
loadDesignLibrary, which the standalone driver maps to
SNLPyLoader::loadLibrary and the in-process driver rejects, as it already
does for py_tech_files.

Tests cover an equivalent and a different pair built from Python
primitives, named and ambiguous tops, a missing constructLibrary, a
sequential pair built from Nangate cells in normal and compact SEC, and the
top options being refused with other formats. docs/python-design-input.md
documents the contract.
regress/sky130hd_gcd_py repeats the sky130hd_gcd CNF regression with both
netlists given as python-format scripts. verilog_to_naja_py.py generated
them from the Verilog netlists of kepler-formal-regress/sky130hd_gcd: it
reads a netlist with the Naja Python module and emits one call per term,
net, connection and instance in the order the Verilog reader created them,
so the loaded design is the same object for object. The case compares
against the sky130hd_gcd golden archives, linked rather than copied.

Locally the run reports Circuits are IDENTICAL and both miter.cnf and the
PO CNFs are byte identical to the Verilog run. The LEC workflow runs the
case after sky130hd_gcd with leak detection off, since the embedded Python
interpreter leaks at exit by design.
The REUSE check requires a copyright and license notice on every file. The
generator now emits the header at the top of each script it writes, and the
case config carries one too. The regenerated scripts still give identical
CNF files.
reuse 3.0, which the compliance action runs, reads the generator's header
and then meets the same tag again inside the string the generator emits,
and reports the file as having no licensing information. Building the
emitted tag from two string pieces leaves the file's own header as the only
occurrence. The generated scripts are unchanged.
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bin/CppDriver.cpp 60.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@nanocoh
nanocoh merged commit acb85ea into main Oct 5, 2026
212 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant