Skip to content

Fix nix develop invocation for verification scripts - #305

Merged
jcirimel merged 1 commit into
VLSIDA:stablefrom
ThVerg:fix-nix-develop-flake-path
Aug 13, 2026
Merged

Fix nix develop invocation for verification scripts#305
jcirimel merged 1 commit into
VLSIDA:stablefrom
ThVerg:fix-nix-develop-flake-path

Conversation

@ThVerg

@ThVergThVerg commented Aug 11, 2026

Copy link
Copy Markdown

Fixes#295 together with PR #304 .

Problem

run_script() launches the DRC/LVS scripts through the Nix devShell:

p_cmd= [
"nix",
"--extra-experimental-features", "nix-command flakes",
"develop",
"--command",
scriptpath,
]
p=subprocess.Popen(p_cmd, stdout=fo, stderr=fe, cwd=OPTS.openram_temp)

nix develop resolves its flake from the working directory, but the working directory here is OPTS.openram_temp, which contains no flake.nix. The error lands in the script's .err file:

path '/tmp/openram_<user>_<pid>_temp' does not contain a 'flake.nix', searching up
error: could not find a flake.nix file

The script never runs, so no report is written, and verification fails on the missing file rather than on the nix error. That is what #295 reports:

ERROR: file magic.py: line 326: Unable to load LVS results from /tmp/openram_dario_19123_temp/....lvs.report
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/openram_dario_19123_temp/....lvs.report'

Depending on which check runs first the same cause can also surface at the DRC stage as Unable to find the total error line in Magic output.

Change

Name the flake explicitly, so it is resolved from the repository while the script still runs with its working directory in the temp dir — which run_drc.sh relies on for its relative cp of the cell library.

repo_root=os.path.abspath(os.path.join(os.environ["OPENRAM_HOME"], ".."))
p_cmd= ["nix", ..., "develop", "path:{}".format(repo_root), "--command", scriptpath]

OPENRAM_HOME is guaranteed to be set here — __init__.py puts it in os.environ during setup, and install_nix() already derives the flake location the same way.

Verification

sky130 build with use_nix = True (magic 8.3.568, netgen 1.5.323):

  • before:could not find a flake.nix file in the .err file, no report produced, run asserts
  • after: DRC and LVS both run through the devShell and write their reports

The workaround until this lands is use_nix = False in the config, which uses whatever tools are on PATH.

run_script() launches the DRC/LVS scripts with
nix develop --command <script>
from a working directory of OPTS.openram_temp. nix develop resolves its
flake from the working directory, and the temp directory has no
flake.nix, so the command fails before the script ever runs:
path '/tmp/openram_<user>_<pid>_temp' does not contain a 'flake.nix', searching up
error: could not find a flake.nix file
Nothing is written to the report file, so verification then dies on the
missing output rather than on the nix error itself, which makes this
confusing to diagnose:
ERROR: file magic.py: Unable to load LVS results from
/tmp/openram_<user>_<pid>_temp/<name>.lvs.report
FileNotFoundError: [Errno 2] No such file or directory
Name the flake explicitly so it is resolved from the repository while
the script still runs in the temp directory, which the scripts depend on
for their relative copies.
Verified on a sky130 build with use_nix = True: before the change no
report is produced and the run asserts, after it both DRC and LVS run
through the devShell and write their reports.
@jcirimel
jcirimel merged commit 744cb98 into VLSIDA:stableAug 13, 2026
Sign up for freeto 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.

LVS report missing

3 participants

@ThVerg@jcirimel@fanisvergos-art