IHP-SG13G2 DRC Testing ====================== Explains how to test SG13G2 DRC rule decks. # Table of contents - [IHP-SG13G2 DRC Testing](#ihp-sg13g2-drc-testing) - [Table of contents](#table-of-contents) - [Folder Structure](#folder-structure) - [**Prerequisites**](#prerequisites) - [Installation](#installation) - [**Usage Guide**](#usage-guide) - [πŸ§ͺ Golden Results (For Developers Only)](#-golden-results-for-developers-only) - [πŸ” Regression Testing](#-regression-testing) - [DRC Regression Outputs](#drc-regression-outputs) - [πŸ“ Folder Structure of regression run results](#-folder-structure-of-regression-run-results) - [🧾 Output Regression Log](#-output-regression-log) - [πŸ“‹ Sample Regression Output](#-sample-regression-output) - [πŸ“Š Explanation of Result Columns](#-explanation-of-result-columns) - [βœ… Summary Insights](#-summary-insights) - [Cells Regression Testing](#cells-regression-testing) - [DRC Cells Regression Outputs](#drc-cells-regression-outputs) - [πŸ“ Folder Structure of regression run results](#-folder-structure-of-regression-run-results-1) - [🧾 Output Cells Regression Log](#-output-cells-regression-log) ## Folder Structure ```text πŸ“ testing ┣ πŸ“œREADME.md This file to document the regression. ┣ πŸ“œrun_regression.py Main regression script used for DRC testing. ┣ πŸ“testcases All testcases used in regression. ``` ## **Prerequisites** You need the following set of tools installed to be able to run SG13G2 DRC regression: - Python 3.9+ - KLayout: see the version pinned in [`versions.txt`](../../../../../../versions.txt) at the repository root (single source of truth shared by the runtime checks, CI workflows, and the pip pin in `requirements.txt`). We have tested this using the following setup: - Python 3.9.18 - KLayout 0.30.5 ## Installation To install the required Python packages, execute the following command: ```bash pip install -r ../../../../../requirements.txt ``` ## **Usage Guide** ### πŸ§ͺ Golden Results (For Developers Only) > **Note:** This section is intended for *developers*. If you are an end user, you can safely ignore it. Golden unit tests are generated for all implemented and verified DRC rules and are stored in the [Golden Unit](./testcases/unit_golden/) directory. These serve as the reference ("golden") results to validate the correctness of the DRC implementation. To regenerate golden results based on the current rule implementation, use the following script: ```bash gen_golden.py (--help | -h) gen_golden.py [--table_name=] [--run_dir=] [--mp=] [--keep] Options: -h, --help show this help message and exit --table_name TABLE_NAME Target rule table name to generate golden results for. --run_dir RUN_DIR Directory to store output. If not specified, a timestamped folder will be created. --mp MP The number of cores used in the run. [default: 1] --keep Keep output logs and intermediate files after processing. ``` **Example:** ```bash python3 gen_golden.py --table_name=activ --run_dir=testcases/unit_golden ``` --- ### πŸ” Regression Testing Use the regression script to validate current rule outputs against the golden references. ```bash run_regression.py (--help | -h) run_regression.py [--run_dir=] [--table_name=] [--mp=] Options: -h, --help show this help message and exit --run_dir RUN_DIR Run directory to save all the results. If not provided, a timestamped directory will be created. --table_name TABLE_NAME Target specific rule table to run. --mp MP The number of parts to split the rule deck for parallel execution. [default: 1] ``` **Example:** ```bash python3 run_regression.py --table_name=activ --run_dir=activ_regression ``` ## DRC Regression Outputs You could find the regression run results at your run directory if you previously specified it through `--run_name=`. Default path of run directory is `unit_tests__