Skip to content

ngspice CI flow checks - #107

Open
Nimok15 wants to merge 2 commits into
ReaLLMASIC:mainfrom
Nimok15:restore-sim-harness
Open

ngspice CI flow checks#107
Nimok15 wants to merge 2 commits into
ReaLLMASIC:mainfrom
Nimok15:restore-sim-harness

Conversation

@Nimok15

@Nimok15 Nimok15 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The CI currently verifies cells structurally, i.e., DRC + LVS. This PR adds a functional layer: ngspice testbenches that simulate each block and check measured behaviour against expected values within a ±10% tolerance.

  1. ngspice testbenches — Use the extracted netlist from DRC artifacts, apply stimulus and bias, and measure the figures of merit.

  2. JSON test specs — one JSON per cell declaring the expected value and the pass band (default ±10%).

  3. Results table — the runner parses ngspice output, compares measured vs expected, and renders a pass/fail row per metric

PDK compatibility is only verified for sky130

@msaligane msaligane changed the title ngspice CI flow ngspice CI flow checks Aug 21, 2026
@msaligane

Copy link
Copy Markdown
Member

@LuighiV Can you please review.

Comment thread .github/workflows/sim.yml
# Both PDKs ship ngspice model libs: sky130 at
# sky130A/libs.tech/ngspice/sky130.lib.spice, gf180 under the ciel
# versioned path. run_cell_sim.py resolves the right one per --pdk.
pdk: [sky130]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, enable for gf180. Models are not the same as sky130

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resistance value depends on the techology, as the RDS might differ for each device. Maybe is better defining threshold values for resistances like lower than certain value (10k) for Ron and higher than certain threshold (1M) when it is off.

Comment thread tests/sim/run_cell_sim.py
)
if libs:
cand = libs[0]
return cand, corner

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For gf180 is not enough just declaring the design model file, you need to declare for all the devices.

Example:

.include $::180MCU_MODELS/design.ngspice
.lib $::180MCU_MODELS/sm141064.ngspice typical
.lib $::180MCU_MODELS/sm141064.ngspice cap_mim
.lib $::180MCU_MODELS/sm141064.ngspice res_typical
.lib $::180MCU_MODELS/sm141064.ngspice moscap_typical
.lib $::180MCU_MODELS/sm141064.ngspice mimcap_typical

Also the typical is not a section of design.ngspice so placing it after the declaration of design.ngspice is incorrect.

@LuighiV

LuighiV commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Hi Prof. @msaligane @Nimok15

I've reviewed the PR. In general I think it looks good and follows the pattern used for LVS. However, need to fix for gf180 as it has a different model structure requirement to simulate it. Currently, cannot simulate gf180 and consequently cannot pass using that pdk.

Thanks,
Luighi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants