Docs / Core Architecture Guide

Goal

This page gives developers the minimum architecture map needed to extend OpenTestability safely.

Current core packages

src/opentestability/core/
├── cop/            # Probability-based controllability/observability
├── scoap/          # Classical CC0/CC1/CO metrics
├── dag/            # DAG build/save helpers
├── reconvergence/  # basic/simple/advanced/dominator (default) + integration
└── testpoint/      # native Yosys-JSON TPI (insert_testpoints_yosys) + pluggable selection

Main extension points

  1. Add a gate model:
    • COP: core/cop/gate_logic.py
    • SCOAP: core/scoap/gate_logic.py
  2. Add or tune reconvergence behavior:
    • core/reconvergence/dominator.py: the default, auto-selected detector
    • core/reconvergence/basic.py
    • core/reconvergence/simple.py
    • core/reconvergence/advanced.py
  3. Extend TPI flow:
    • candidate selection: core/testpoint/heuristic_algorithm.py / greedy_algorithm.py / gradient_algorithm.py; subclass TPIAlgorithm and register it in core/testpoint/registry.py (or via the opentestability.tpi_algorithms entry-point group)
    • insertion + report: core/testpoint/main.py (insert_testpoints_yosys)
    • PDK cells / control-point style: core/testpoint/tech_config.py

Compatibility note

Public imports are intentionally re-exported in package __init__.py files where possible. Prefer package-level imports unless you are intentionally targeting a specific internal module.

Safe-change checklist

  1. Validate the Yosys JSON input path for format-sensitive edits.
  2. Keep file/path handling through existing utilities, not hardcoded directories.
  3. Preserve output schema compatibility for metrics consumed by TPI.
  4. Run unit and integration tests for touched modules.

Developer references

  1. API Overview
  2. Command Reference
  3. Reconvergence Integration