⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@Kimplul
Copy link

@Kimplul Kimplul commented Jan 15, 2026

When IN_NIX_SHELL is defined, flow/scripts/variables.mk defines some commonly used variables like OPENROAD_EXE with OPENROAD_EXE ?= $(shell ...). The conditional assignment (?=) is a deferred assignment, so every time OPENROAD_EXE is expanded, the corresponding shell command is run. Apparently some of these variables are expanded often enough that the deferred assignment has a somewhat significant impact on runtime, here's how long make takes to run after having synthesized the Ibex example from the docs:

Before:

$ time IN_NIX_SHELL=1 make DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk
[...]

real    0m52.177s
user    0m42.582s
sys     0m14.881s

The fix here is to immediately re-expand the newly defined variables so the shell command is only ran once.

After:

$ time IN_NIX_SHELL=1 make DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk
[...]

real    0m0.644s
user    0m0.520s
sys     0m0.146s

@rovinski
Copy link
Collaborator

I think your methodology is faulty because it's not possible ibex finished in under 1 second. Did you make clean between your measurements?

@Kimplul
Copy link
Author

Kimplul commented Jan 16, 2026

@rovinski To clarify, I'm not running the full Ibex flow, I've previously finished the flow and running make again just prints out resource usages of each stage. I guess a more clear example would be make DESIGN_CONFIG=... elapsed? This PR just removes some unnecessary overhead from running the Makefile.

@maliberty
Copy link
Member

There is something pathologically bad about NIX if doing essentially no work takes 50s. @hzeller have observed this?

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.

3 participants