How chys1203/fan_atpg works
Project type and purpose
• This is a command-line, open-source tool for Automatic Test Pattern Generation (ATPG) and Fault Simulation on benchmark circuits (FAN_ATPG).
• It implements Fujiwara-Shimono’s fan-out-oriented ATPG algorithm plus fault collapsing, parallel fault simulation, static/dynamic compression, and pattern conversion (STIL, ASCII, .pat).
File structure
• Top-level build:
• Makefile, common.mk, info.mk, rule.mk, copyHeader.sh → drive compilation and header copying.
• Binaries & libraries:
• bin/opt/ → compiled executables (“fan”)
• lib/opt/ → compiled libraries (.a, .so)
• Headers & sources:
• / ← collection of all public headers
• pkg/ → 4 main packages:
– common/ → CLI support, command parsing, console utilities
– core/ → ATPG algorithm, fault simulator, decision trees, logic, patterns
– interface/ → parsers and builders for netlist, pattern files (LEX/YACC), SDF, STIL, techlib, Verilog
– fan/ → “main” entry point, CLI commands mapping to core
• Data & assets:
• mod_netlist/, netlist/ → benchmark Verilog netlists
• techlib/ → cell libraries (Nangate)
• pat/ → generated test patterns (.pat, .stil)
• rpt/ → reports (per-circuit ATPG/fault-sim results)
• script/ → bash scripts to orchestrate runs
• utility/ → Python scripts for STIL↔.pat conversion
Core components and interactions
• User invokes “fan” executable via script or CLI
→ common: parse flags, scripts (.script)
→ interface: read benchmark netlist + techlib + prior pattern files
→ core: perform fault collapsing, ATPG loops, fault simulation, test compression
→ interface: serialize output patterns in requested formats (ASCII, STIL, .pat)
→ core/util: generate coverage reports → rpt/
→ filesystem: store patterns in pat/, reports in rpt/
Architectural patterns & design principles
• Modular layering:
• CLI layer (common + fan)
• Parser/IO layer (interface)
• Algorithmic engine (core)
• Utilities & conversion (utility)
• Separation of concerns: parsing vs. algorithm vs. user-facing entry point.
• Use of build automation (Makefiles at root and per-pkg) for reproducible binaries & libraries.
• Data-driven workflows: scripts drive the sequence of reads (netlist) → compute (core) → writes (pat/rpt).