PPSFP (Parallel-Pattern Single-Fault Propagation) style fault simulators and other utility functions for use in various projects.
These fault simulators are meant to be correct (ensured by unit-tests) and reasonably fast.
Fault simulation has $O(n^3)$ complexity. Every *fault* is simulated with every *pattern* involving every combinational *gate* in the circuit. We measure performance in terms of `gates * faults * patterns / second`. How fast can we make it?
## Quick Start
This project has submodules. To ensure everything is up-to-date, run
- [uv](https://docs.astral.sh/uv/) for managing python environments.
- [nix](https://nixos.org) for managing non-python tools and benchmark designs. Follow [this guide](https://librelane.readthedocs.io/en/stable/installation/nix_installation/index.html) or [this guide](https://github.com/fossi-foundation/nix-eda/blob/main/docs/installation.md) to setup [nix-eda](https://github.com/fossi-foundation/nix-eda/tree/main) binary cache to avoid re-building EDA-related tools.
Smoke-test: `uv run pytest`
Run all unit-tests: `uv run pytest`
Run a naive, baseline fault simulation with 1024 random patterns: `uv run main.py tests/c6288.bench`
For running Jupyter Notebooks in the reproducible programming environment, install a kernelspec with this command:
Same on an 18k-gate circuit: `uv run main.py polito-itc99-b15-sky130`
`nix develop` makes [quaigh](https://github.com/coloquinte/quaigh) available, another simulator/atpg written in rust.
To run Jupyter Notebooks in the reproducible programming environment, install a kernelspec:
parser.add_argument('-t','--tlib',default='SKY130',help=f'techlib of circuit. default: SKY130, available: {sorted(techlib_by_name.keys())}.')
parser.add_argument('-p','--patterns',default=1024,help='Number of random patterns to simulate.')
parser.add_argument('--seed',type=int,default=42,help='Random seed for reproducibility (default: 42).')
parser.add_argument('circuit',help='gate-level verilog file or nix package to import. See"nix flake show github:s-holst/benchmark-circuits" for available packages.')
parser.add_argument('-t','--tlib',default='SKY130',help=f'Techlib for verilog circuit. Default: SKY130, available: {sorted(techlib_by_name.keys())}.')
parser.add_argument('-p','--patterns',default=1024,help='Number of random patterns to simulate. Default: 1024.')
parser.add_argument('--seed',type=int,default=42,help='Random seed for reproducibility. Default: 42.')
parser.add_argument('circuit',help='Gate-level verilog, bench, or nix package to import. See available packages:"nix flake show github:s-holst/benchmark-circuits".')