<@U0175T39732>: Sorry for being AWOL through most...
# sky130
t
@User: Sorry for being AWOL through most of that thread. I used to have the open_pdks install just the way I liked it until Tim Ansell made me change it to be more compliant with typical Linux packages. At any rate, the value of $SHARED_PDKS_PATH is used by the open_pdks Makefile and is the only way to do an end-run around the Makefile inserting /share/ into the path everywhere. I documented that somewhere, but I need to figure out exactly where.
m
Whenever I use that variable I get this error over and over:
Copy code
# Install OSU T18 ls digital standard cells.
set -f ; ../common/foundry_install.py -std_format -source  -target /software/PDKs/open_pdks/sky130/sky130A \
        -techlef sky130_osu_sc_18T.tlef rename=sky130_osc_sc_18t_ls.tlef \
        -spice 18T_ls/cdl/*.spice compile-only exclude=*.*.spice \
        -lef 18T_ls/lef/*.lef \
        -lib 18T_ls/lib/*.lib \
        -gds 18T_ls/gds/*.gds compile-only \
                options=custom/scripts/gds_import_setup.tcl \
        -library digital sky130_osu_sc_18t_ls 2>&1 | tee -a sky130A_make.log
Traceback (most recent call last):
  File "../common/foundry_install.py", line 430, in <module>
    sourcedir = option[1]
t
That probably means that I broke something, as I have not tested the non-standard install location for some number of commits. I'll check that and confirm.
m
Actually, this could be something on my end. I think my version was pretty stale as well.
It seems to get ignored on the master branch:
Copy code
mrg@diode /software/PDKs/open_pdks (master)$ SHARED_PDKS_PATH=/software/PDKs make install
(cd sky130 && make install)
make[1]: Entering directory '/software/PDKs/open_pdks/sky130'
echo "Starting SKY130 PDK migration on "`date` > sky130A_install.log
../common/staging_install.py -std_format \
        -source /software/PDKs/open_pdks/sky130/sky130A \
        -target /usr/local/share/pdk/sky130A \
        -variable PDKPATH \
        -link_from none 2>&1 | tee -a sky130A_install.log
Installing in target directory /usr/local/share/pdk/sky130A
Traceback (most recent call last):
  File "../common/staging_install.py", line 381, in <module>
    os.makedirs(targetdir, exist_ok=True)
  File "/usr/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/pdk'
echo "Ended SKY130 PDK migration on "`date` >> sky130A_install.log
make[1]: Leaving directory '/software/PDKs/open_pdks/sky130'
Common install:  /usr/local/share is not writeable (ignoring).
Done.
It is hard coded to this in the open_pdks/sky130/Makefile:
prefix = /usr/local
datarootdir = ${prefix}/share
datadir = ${datarootdir}
...
SHARED_PDKS_PATH = $(datadir)/pdk
Just need to change to:
SHARED_PDKS_PATH ?= $(datadir)/pdk
t
Okay. I thought that for Makefiles, you only need to pass the variable to the "make" command, but if the "?=" works in the Makefile, then that's better.
m
That should only make the assignment if it isn't already defined
m
Since makefile overrides have always been a little confusing to me, I made the following test
Makefile
Copy code
TEST_VAR = default1
TEST_ENV_VAR ?= default2

test:
	echo $(TEST_VAR) > /dev/null
	echo $(TEST_ENV_VAR) > /dev/null
and ran the following script
Copy code
echo "default"
unset TEST_VAR
unset TEST_ENV_VAR
make test

echo " "
echo "command line override"
make TEST_VAR=commandLine1 TEST_ENV_VAR=commandLine2 test

echo " "
echo "environment override"
export TEST_VAR=override1
export TEST_ENV_VAR=override2
make test

echo " "
echo "environment/command line override"
make TEST_VAR=commandLine1 TEST_ENV_VAR=commandLine2 test
and got the following results
Copy code
default
echo default1 > /dev/null
echo default2 > /dev/null
 
command line override
echo commandLine1 > /dev/null
echo commandLine2 > /dev/null
 
environment override
echo default1 > /dev/null
echo override2 > /dev/null
 
environment/command line override
echo commandLine1 > /dev/null
echo commandLine2 > /dev/null
So environment variables override
?=
assignments but not
=
assignments, while command line assignments override both
?=
and
=
assignments and ignore environment variables. FWIW.
👍 1
m
Interesting. I was running like this: TEST_VAR=commandLine1 make test which must be an environment variable as well.
I didn't even realize I did that. This is why it worked in OpenLane which did a command line variable: make SHARED_PDKS_PATH=$(PDK_ROOT) install
Thanks @User
👍 1