# efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr architecture

> Architecture diagram of the GitHub repository efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr
- Repository: https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr

## Overview

##### Core components
- cells/klayout/pymacros – Python “PCells” (parameterized cells) that generate GDS layouts
- cells/xschem – Schematic symbol definitions for Xschem
- models – Raw SPICE measurement Excel data, cleaned datasets, and extraction scripts
- models/ngspice & models/xyce – Spice/Xyce netlists and regression‐test suites
- rules/klayout – DRC/LVS rule macros for KLayout
- tech/klayout – KLayout technology files (layer mappings, styles)
- third_party/make-env – Environment‐setup scripts (Conda, Make, CI)
- Makefile / CI workflows – Orchestrator for builds, tests, regression runs

##### Relationships & data flows
a) “Raw Data” (Excel in models/180MCU_SPICE_DATA) feeds
→ Cleaning Scripts (models_clean/scripts) →
→ “Clean Data” (CSV in models_clean/gf180mcu_data)
b) Clean Data + PCell definitions (cells/klayout/pymacros)
→ Generate GDS PCells → loaded via tech/klayout into KLayout
c) Clean Data + Symbol definitions (cells/xschem)
→ Generate Xschem symbol library → used in schematic capture
d) Clean Data + SPICE Netlists (models/ngspice & models/xyce)
→ Regression Scripts (models/ngspice/testing & models/xyce/testing)
→ External Simulators (Ngspice, Xyce)
→ Test Results
e) KLayout PCells + tech files + DRC/LVS macros
→ Layout verification runs via rules/klayout macros
f) Makefile and GitHub Actions (/.github/workflows) coordinate all of the above

##### Architectural patterns
– Modular plugin‐style: each subdirectory is a self‐contained plugin for an EDA tool
– Data pipeline: raw measurement → clean data → device macros & netlists
– Test harness: Python pytest for PCells, Spice regression suites for models
– CI orchestration: Makefile targets + GitHub Actions for repeatable builds/tests

##### Essential elements
– Clear component labels (e.g., “PCells Python Macros”, “Clean SPICE Data”, “DRC/LVS Rules”)
- Code modules
- Data stores
- External EDA tools

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Pipeline
    subgraph "Data Pipeline"
        RawExcel[(Raw SPICE Data)]:::datastore
        CleaningScripts["Data-cleaning Scripts"]:::code
        CleanData[(Clean SPICE Data)]:::datastore
    end

    RawExcel -->|"clean"| CleaningScripts --> CleanData

    %% Cells Modules
    subgraph "KLayout Cells Module"
        PythonPCells["Python PCells (pymacros)"]:::code
        PCellImpl["PCell Implementations (GDS templates)"]:::code
        PCellTests["PCell Testing Harness"]:::code
    end

    CleanData -->|"generate GDS"| PythonPCells --> PCellImpl -->|"test PCells"| PCellTests
    PCellImpl --> GDSOutput[(GDS Artifacts)]:::datastore

    %% Xschem Modules
    subgraph "Xschem Module"
        XschemSymbols["Xschem Symbol Library"]:::code
        XschemTests["Xschem Tests"]:::code
    end

    CleanData -->|"generate symbols"| XschemSymbols -->|"test symbols"| XschemTests

    %% SPICE Models Modules
    subgraph "SPICE Models Module"
        NgspiceNetlists["Ngspice Netlists"]:::code
        NgspiceTests["Ngspice Regression Tests"]:::code
        XyceNetlists["Xyce Netlists"]:::code
        XyceTests["Xyce Regression Tests"]:::code
    end

    CleanData -->|"use SPICE"| NgspiceNetlists -->|"run regression"| NgspiceTests
    CleanData -->|"use SPICE"| XyceNetlists -->|"run regression"| XyceTests

    %% KLayout Verification
    subgraph "Layout Verification"
        TechFiles["KLayout Technology Files"]:::code
        DRCMacros["DRC/LVS Rule Macros"]:::code
    end

    PCellImpl -->|"load tech"| TechFiles
    PCellImpl -->|"apply rules"| DRCMacros
    TechFiles --> KLayout["KLayout"]:::tool
    DRCMacros --> KLayout

    %% External Tools
    XschemSymbols --> Xschem["Xschem"]:::tool
    NgspiceNetlists --> Ngspice["Ngspice Simulator"]:::tool
    XyceNetlists --> Xyce["Xyce Simulator"]:::tool

    NgspiceTests --> TestResultsNg[(Ngspice Test Results)]:::datastore
    XyceTests --> TestResultsXy[(Xyce Test Results)]:::datastore

    %% Orchestration
    subgraph "CI & Build Orchestration"
        EnvScripts["Environment Setup Scripts"]:::code
        Makefile["Makefile"]:::code
        CIWorkflows["GitHub Actions Workflows"]:::code
    end

    EnvScripts --> Makefile
    CIWorkflows --> Makefile
    Makefile --> CleaningScripts
    Makefile --> PythonPCells
    Makefile --> XschemSymbols
    Makefile --> NgspiceTests
    Makefile --> XyceTests
    Makefile --> PCellTests

    %% Legend omitted for brevity

    %% Click Events
    click PythonPCells "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/cells/klayout/pymacros"
    click PCellImpl "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/cells/klayout/pymacros/cells"
    click PCellTests "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/cells/klayout/pymacros/testing"
    click XschemSymbols "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/cells/xschem/symbols"
    click XschemTests "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/cells/xschem/tests"
    click RawExcel "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/models/180MCU_SPICE_DATA"
    click CleaningScripts "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/models/180MCU_SPICE_DATA_clean/scripts"
    click CleanData "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/models/180MCU_SPICE_DATA_clean/gf180mcu_data"
    click NgspiceNetlists "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/blob/main/models/ngspice/design.ngspice"
    click NgspiceTests "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/models/ngspice/testing"
    click XyceNetlists "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/blob/main/models/xyce/design.xyce"
    click XyceTests "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/models/xyce/testing"
    click DRCMacros "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/rules/klayout/macros"
    click TechFiles "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/tech/klayout"
    click EnvScripts "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/third_party/make-env"
    click Makefile "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/Makefile"
    click CIWorkflows "https://github.com/efabless/globalfoundries-pdk-libs-gf180mcu_fd_pr/tree/main/.github/workflows"

    %% Class Definitions
    classDef code fill:#D0E1F9,stroke:#0366D6,color:#0366D6
    classDef datastore fill:#D4F9D0,stroke:#28A745,color:#28A745
    classDef tool fill:#FFE4B5,stroke:#DA7B0D,color:#DA7B0D
```
