It looks like you're new here. If you want to get involved, click one of these buttons!
I have a nagging problem that I'd like to finally fix. For reference, I have multiple technologies that I switch between (different process PDKs with different library elements, layers, PCells, etc.) and there is some common naming of scripts and Pcells between them. When I load a GDS layout from a few years ago, the Pcells do not automatically populate and I have to run my "Load Pcells" script. If I look at the cells prior to running the script, an error indicates KLayout is looking at the wrong technology library for the Pcell script. Debugging, the PATH variable that I'm adding to in order to include my macros indicates the order of the scripts that are autorun during startup. This shows that more recently created technologies' scripts are run last. It looks like the PCell macro attempts to use the most recent PATH directory (pointing to a different technology) and it cannot find anything so the cell is left empty until I explicitly run my "Load Pcell" script which puts that directory on top of the PATH.
I'm simply adding to the $LOAD_PATH with the following line at the beginning of my "Load Pcell" script. I do this as my technologies and scripts are not located in the default location.
So I have 2 questions:
1. Is there a way to set the order that scripts are run when a file is opened or the application runs? In this way, I could set my "default" technology to take priority over my lesser used ones.
2. Is there a way to trigger a script that runs when the technology button is clicked? In that way, I could make it so that when I switch technologies, I can run scripts to load Pcells and libraries for that technology only.
I know someone is going to tell me to use unique names for everything, but that is only a solution moving forward. If I want to pull up old layouts and play with the Pcells, I need to keep the names as they are. This is also part of a bigger desire to make it so that technologies only load the compatible libraries instead of every Pcell and static library that I have ever worked on.