# PDK, Technology, and Xsection Loading Logic Path This document explains how the current code loads: - PDK component information: component folders, component YAML, images, and GDS assets. - Technology information: selected foundry/technology for each project. - Xsection information: routing cross-section defaults and Nazca layer bindings from `technology.yml`. Line numbers refer to the current codebase at the time this document was written. ## Mental Model There are three related but separate data paths. 1. Component PDK assets - Source: role-controlled PDK trees: - `opt_pdk_public/foundries` - `opt_pdk_atlas/foundries` - Controlled by user group through `pdk_root_for_session` (`backend/pdk_access.py` line 43). - Used for library browsing, component metadata, component images, and final component GDS resolution. 2. Technology registry and manifests - Source: the same role-controlled PDK trees as component assets. - Path: `///technology.yml`. - Used to list available technologies, save the project technology choice, load route defaults, and register Nazca layers/xsections. 3. Saved project layout YAML - Source: `database//layout//.yml`. - Contains placed component paths and `bundles.*.links[*].xsection`. - Consumed by `mxpic_router` when building SVG preview GDS or downloadable GDS. Important distinction: - The active role PDK root is now the single source of truth. - Normal/developer users read from `opt_pdk_public/foundries`. - Manager users read from `opt_pdk_atlas/foundries`. - The selected project technology scopes the library browser and selects which `technology.yml` is loaded from that same role root. ## Active Roots Backend startup defines the important paths: - `REPO_ROOT` (`backend/server.py` line 36) points two levels above `backend/`. - There is no separate technology-manifest copy inside `mxpic_EDA`. Role-based PDK root: `Flask session user_group` -> `current_pdk_root` (`backend/server.py` line 196) -> `pdk_root_for_session` (`backend/pdk_access.py` line 43) -> `pdk_root_for_group` (`backend/pdk_access.py` line 27) : choose: - manager -> `MXPIC_PDK_ATLAS_ROOT` or `../opt_pdk_atlas/foundries`. - developers/user -> `MXPIC_PDK_PUBLIC_ROOT` or `../opt_pdk_public/foundries`. ## Technology Selection Path Compact path: `Dashboard opens` -> `loadTechnologies` (`frontend/dashboard.html` line 1238) -> GET `/api/technologies` -> `list_technologies` (`backend/server.py` line 441) : scan `current_pdk_root()` -> return `{ foundry, technology, id, label }` -> dashboard fills the technology select. Detailed path: 1. The dashboard calls `/api/technologies`: - `loadTechnologies` starts at `frontend/dashboard.html` line 1238. - It stores `data.technologies` and creates `