Closed htfab closed 1 month ago
@htfab Do you foresee any problems with us merging this to main?
I have run a few tests with the patch rebased to main, and it looks ok.
Would you mind creating that PR? I would do it myself, but it would assign authorship of the PR to me which would be unfair.
Ok, created #474.
The current implementation for parsing Tcl config files fails to catch environment variables defined in subordinate
.tcl
files included from the main.tcl
with thesource
command. This breaks openlane1 compatibility for almost every user design submitted to Tiny Tapeout.Tcl config files are parsed using
TclUtils._eval_env()
. The current versionos.environ
to provide inputs to the script::env
to numbered variables on the tcl sideos.environ
set ::env(...)
constructs in the scriptThe last step is there to filter out entries inherited from the environment, but it also filters out entries defined in included files. This python-tcl interface relying on
os.environ
modifications and rewriting::env
to numbered variables also feels brittle in some other ways. I'm proposing to rewrite it in the following manner:env(...)
directly instead of modifying and rolling backos.environ
set
function to also call our callbackset
calls that matchenv(...)
to the returned dictionaryThis makes the code more robust and only saves environment variables explicitly set by the Tcl config, making it unnecessary to use the problematic filtering step.