-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from chetanyagoyal/main
Canary checks for simulations in CI
- Loading branch information
Showing
14 changed files
with
416 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Table of Contents | ||
- [Description](#description) | ||
- [Directory Structure](#directory-structure) | ||
- [Workflow jobs](#workflow-jobs) | ||
- [Synchronous jobs](#1-cron-jobs) | ||
- [PR verification jobs](#2-pr-verification-jobs) | ||
- [Flow result checks](#flow-result-verification) | ||
# Description | ||
|
||
OpenFASoC makes use of the Github actions based CI workflow. Through the use of YAML workflow files and pythonic verification scripts (`parse_rpt.py`), the changes made in pull requests are verified. | ||
|
||
<b>Disclaimer: specific functionality information is present as docstrings in each file</b> | ||
|
||
# Directory Structure | ||
|
||
``` | ||
.github | ||
├── scripts | ||
│ ├── dependencies | ||
│ │ ├── get_tag.py | ||
│ │ └── tool_metadata.py | ||
│ ├── expected_drc_reports | ||
│ │ └── expected_ldo_drc.rpt | ||
│ ├── expected_sim_outputs | ||
│ │ ├── cryo-gen | ||
│ │ ├── ldo-gen | ||
│ │ └── temp-sense-gen | ||
│ │ ├── postPEX_sim_result | ||
│ │ └── prePEX_sim_result | ||
│ ├── Dockerfile | ||
│ ├── get_docker_config.py | ||
│ ├── gh.py | ||
│ ├── parse_rpt.py | ||
│ ├── tool_metadata.py | ||
│ ├── tool.py | ||
│ └── update_tools.py | ||
└── workflows | ||
├── cryo_gen.yml | ||
├── ldo_sky130hvl.yml | ||
├── tempSense_sky130hd.yml | ||
├── test_python_api.yml | ||
└── verify_latest_tools_version.yml | ||
``` | ||
# Workflow jobs | ||
The repo supports 2 kinds of workflow runs | ||
|
||
## 1. CRON jobs | ||
- `workflows/verify_latest_tools_version.yml` | ||
|
||
This job automatically runs at 1 A.M. UTC and is used to verify functionality with the latest version of the toolset that the flow uses. | ||
It makes use of the `workflows/verify_latest_tools_version.yml` file and builds a docker <i>alpha</i> image with the latest version of the toolset. | ||
|
||
Should the generator workflow runs (temp-sense, cryo-gen and ldo-gen) run to completion, the <i>alpha</i> image is tagged as <i>stable</i> and pushed to the dockerhub, which will thereafter be used for PR verification runs | ||
|
||
The toolset version info is also updated in the required places in the repository with an automated PR, issued by the same `.yml` file. | ||
- `workflows/test_python_api.yml` | ||
|
||
This job runs at 2 A.M. UTC. Using `pytest`, the common python API developed for the temperature sensor generator. | ||
|
||
Verilog generation and simulations are run for the temperature sensor generator for python versions `3.8`, `3.9`, and `3.10`. | ||
|
||
Successful completion of all jobs is required to guarantee that the tool is working properly. | ||
## 2. PR verification jobs | ||
These workflow jobs, which include - | ||
* `cryo_gen.yml` | ||
* `tempSense_sky130hd.yml` | ||
* `ldo_sky130hvl.yml` | ||
|
||
are run to verify the potential changes made to the repository via pull requests. | ||
|
||
These workflows run the verilog generation and openroad flows for the 3 generators and spice simulations are run specifically for the temperature sensor generator. | ||
|
||
# Flow Result Verification | ||
|
||
The generator flows run by the CI workflow jobs specified in the `.yml` files produce results which are verified by the `scripts/parse_rpt.py` file. | ||
|
||
The script checks - | ||
* DRC results | ||
* LVS results | ||
* OpenROAD flow results | ||
- existence of `.cdl, .sdc, .def, .gds, .v, .spice`, etc. files in the right directories | ||
- existence of optimum configuration search result `.csv` files for the temp-sense generator | ||
* Simulation results for temp-sense | ||
- if the generated frequency, power and error results are within an allowable range from the stored simulation results | ||
- if the number of failed simulations returned by the run is 0 | ||
- if the run result files (`.sp, .log and parameters.txt`) exist for all inverter-header configurations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Table of Contents | ||
- [Description](#description) | ||
- [File Tree](#file-tree) | ||
- [Verilog Generation](#verilog-generation) | ||
- [Simulation runs](#simulations) | ||
- [Flow result checks](#flow-result-checks) | ||
- [Simulation result checks](#simulation-result-checks) | ||
|
||
# Description | ||
This folder contains python script files that are common to all generators, used as config or result parse files for generator flows and simulations | ||
|
||
### File Tree | ||
``` | ||
generators | ||
└── common | ||
├── simulation | ||
│ ├── simulation_config.py | ||
│ ├── simulation_run.py | ||
│ ├── utils.py | ||
│ └── __init__.py | ||
├── __init__.py | ||
├── check_gen_files.py | ||
├── classify_sim_error.py | ||
├── get_ngspice_version.py | ||
└── verilog_generation.py | ||
``` | ||
### Verilog Generation | ||
The file `verilog_generation.py` is used to convert verilog files such that they use the mako templating library for simpler and more readable syntax. Specific function descriptions are present in as docstrings in the file. | ||
|
||
### Simulations | ||
The files found in the `simulation/` directory are used as pythonic script files to run simulations for each generator. These files mainly generate configurations and run files for the simulations, which are used by each of the generators. Specific function descriptions are found in the respective files | ||
|
||
### Flow result checks | ||
The file `check_gen_files.py` is used to check if simulations can be run correctly for a generator. Specifically, it is used in the `parse_rpt.py` file found in the `tools/` folder of each generator. This file runs at the end of each generator flow to check for successful completion. | ||
|
||
Only temp-sense-gen, cryo-gen and ldo-gen are currently supported. For these generators, this file checks if the necessary `work/` directory and the simulation generated files are present (such as `.sdc`, `.cdl`, `.gds`, `.def`, among others). | ||
|
||
The file also checks if the necessary optimum inverter-header configuration search results are present for the temp-sense-gen flow (in the form of the error optimisation `.csv` files) | ||
|
||
Check the docstrings in each file for specific function definitions. | ||
### Simulation Result Checks | ||
The files `classify_sim_error.py` and `get_ngspice_version.py` together, are used to check for errors in the simulation runs for each generator. These files use a dictionary of maximum and minimum allowable deviations of simulation results from an ideal set of result files present in `.github/scripts/expected_sim_outputs/*`. The dictionary of deviations, called "errors" is used for the same | ||
```python | ||
errors = { | ||
'frequency': { 'max': 1, 'min': 0.5 }, | ||
'power': { 'max': 1000, 'min': 1000 }, | ||
'error': { 'max': 100, 'min': 50 }, | ||
} | ||
``` | ||
If the deviation of the current run results (in percentage) is greater than the maximum allowable deviation for any of the results, the file returns an urgent "red" alert, which raises a ValueError in the `parse_rpt.py` file. | ||
|
||
If the deviations lie between the maximum and minimum allowable deviations, the script returns an "amber" alert, which raises a soft warning. | ||
|
||
If the deviations are all less than minimum allowable deviation, the script returns "green", which does not reflect anything in the `parse_rpt.py` file. | ||
|
||
If the current ngspice version does not match with the ngspice version stored at the time the templates were stored, the function `check_ngspice_version()` from `check_ngspice_version.py` returns 0, which leads to a soft warning raised in the `parse_rpt.py` file, to notify the maintainers about the same. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.