# aucohl/fault architecture

> Architecture diagram of the GitHub repository aucohl/fault, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aucohl/fault
- Repository: https://github.com/aucohl/fault

## Overview

Fault is a command-line design-for-test toolchain for hardware netlists. Users invoke its CLI to generate ATPG patterns, cut designs, synthesize, assemble outputs, generate TAP/JTAG logic, or stitch scan chains. The README documents this broader capability set; sampled entry-point and source-index evidence supports the dispatch and several implementation links. The graph preserves distinct design parsing, scan construction, synthesis, and simulation/test-vector responsibilities. Some command internals were not sampled, so undocumented links are omitted.

Main entry points: [`Sources/Fault/Entries/main.swift`](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/main.swift) (Fault CLI), [`Sources/Fault/Entries/chain.swift`](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/chain.swift) (Scan stitching), [`Sources/Fault/Simulation.swift`](https://github.com/aucohl/fault/blob/main/Sources/Fault/Simulation.swift) (Simulation), [`Sources/Fault/Entries/atpg.swift`](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/atpg.swift) (ATPG)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_fault_cli["Fault CLI<br/>[main.swift]"]
  node_atpg["ATPG<br/>[atpg.swift]"]
  node_cut["Design cutting<br/>[cut.swift]"]
  node_chain["Scan stitching<br/>[chain.swift]"]
  node_tap["TAP generation<br/>[tap.swift]"]
  node_synth_cmd["Synthesis command<br/>[synth.swift]"]
  node_assemble["Assembly command<br/>[asm.swift]"]
end

subgraph group_design["Design and scan"]
  node_netlist["Netlist model<br/>[Module.swift]"]
  node_scan_cells["Boundary scan cells"]
  node_scan_config["Scan configuration"]
  node_jtag_logic["JTAG logic<br/>[JTAGStrings.swift]"]
end

subgraph group_testing["Test generation"]
  node_simulation["Simulation<br/>[Simulation.swift]"]
  node_vectors["Test vectors<br/>[TestVector.swift]"]
  node_vector_gen["Vector generators<br/>[TVGenerator.swift]"]
  node_compaction["Vector compaction<br/>[Compaction.swift]"]
end

subgraph group_support["Synthesis and support"]
  node_synthesis["Synthesis scripts<br/>[Synthesis.swift]"]
  node_thread_pool["Thread pool<br/>[thpool.c]"]
  node_thread_api["Thread pool API<br/>[thpool.h]"]
end

node_user(("Engineer"))

node_user -->|"invokes"| node_fault_cli
node_fault_cli -->|"dispatches"| node_atpg
node_fault_cli -->|"dispatches"| node_cut
node_fault_cli -->|"dispatches"| node_synth_cmd
node_fault_cli -->|"dispatches"| node_assemble
node_fault_cli -->|"dispatches"| node_tap
node_fault_cli -->|"dispatches"| node_chain
node_atpg -->|"uses"| node_netlist
node_atpg -->|"uses"| node_vectors
node_cut -->|"parses"| node_netlist
node_cut -->|"reads"| node_scan_config
node_chain -->|"parses"| node_netlist
node_chain -->|"creates"| node_scan_cells
node_chain -->|"reads"| node_scan_config
node_chain -->|"uses"| node_synthesis
node_tap -->|"uses"| node_synthesis
node_synth_cmd -->|"generates scripts"| node_synthesis
node_tap -.->|"uses"| node_jtag_logic
node_simulation -->|"uses"| node_vectors
node_simulation -->|"uses"| node_vector_gen
node_simulation -.->|"uses"| node_compaction
node_vector_gen -->|"produces"| node_vectors
node_thread_pool -->|"implements"| node_thread_api

click node_fault_cli "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/main.swift"
click node_atpg "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/atpg.swift"
click node_cut "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/cut.swift"
click node_chain "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/chain.swift"
click node_tap "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/tap.swift"
click node_synth_cmd "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/synth.swift"
click node_assemble "https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/asm.swift"
click node_netlist "https://github.com/aucohl/fault/blob/main/Sources/Fault/Module.swift"
click node_scan_cells "https://github.com/aucohl/fault/blob/main/Sources/Fault/BoundaryScanRegister.swift"
click node_scan_config "https://github.com/aucohl/fault/blob/main/Sources/Fault/SCLConfiguration.swift"
click node_jtag_logic "https://github.com/aucohl/fault/blob/main/Sources/Fault/JTAGStrings.swift"
click node_simulation "https://github.com/aucohl/fault/blob/main/Sources/Fault/Simulation.swift"
click node_vectors "https://github.com/aucohl/fault/blob/main/Sources/Fault/TestVector.swift"
click node_vector_gen "https://github.com/aucohl/fault/blob/main/Sources/Fault/TVGenerator.swift"
click node_compaction "https://github.com/aucohl/fault/blob/main/Sources/Fault/Compaction.swift"
click node_synthesis "https://github.com/aucohl/fault/blob/main/Sources/Fault/Synthesis.swift"
click node_thread_pool "https://github.com/aucohl/fault/blob/main/Sources/CThreadPool/thpool.c"
click node_thread_api "https://github.com/aucohl/fault/blob/main/Sources/CThreadPool/include/thpool.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fault_cli,node_atpg,node_cut,node_chain,node_tap,node_synth_cmd,node_assemble toneBlue
class node_netlist,node_scan_cells,node_scan_config,node_jtag_logic toneAmber
class node_simulation,node_vectors,node_vector_gen,node_compaction toneMint
class node_synthesis,node_thread_pool,node_thread_api toneRose
class node_user toneIndigo
```

## Components

### CLI commands

- [Fault CLI](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/main.swift): `Sources/Fault/Entries/main.swift`
- [ATPG](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/atpg.swift): `Sources/Fault/Entries/atpg.swift`
- [Design cutting](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/cut.swift): `Sources/Fault/Entries/cut.swift`
- [Scan stitching](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/chain.swift): `Sources/Fault/Entries/chain.swift`
- [TAP generation](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/tap.swift): `Sources/Fault/Entries/tap.swift`
- [Synthesis command](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/synth.swift): `Sources/Fault/Entries/synth.swift`
- [Assembly command](https://github.com/aucohl/fault/blob/main/Sources/Fault/Entries/asm.swift): `Sources/Fault/Entries/asm.swift`

### Design and scan

- [Netlist model](https://github.com/aucohl/fault/blob/main/Sources/Fault/Module.swift): `Sources/Fault/Module.swift`
- [Boundary scan cells](https://github.com/aucohl/fault/blob/main/Sources/Fault/BoundaryScanRegister.swift): `Sources/Fault/BoundaryScanRegister.swift`
- [Scan configuration](https://github.com/aucohl/fault/blob/main/Sources/Fault/SCLConfiguration.swift): `Sources/Fault/SCLConfiguration.swift`
- [JTAG logic](https://github.com/aucohl/fault/blob/main/Sources/Fault/JTAGStrings.swift): `Sources/Fault/JTAGStrings.swift`

### Test generation

- [Simulation](https://github.com/aucohl/fault/blob/main/Sources/Fault/Simulation.swift): `Sources/Fault/Simulation.swift`
- [Test vectors](https://github.com/aucohl/fault/blob/main/Sources/Fault/TestVector.swift): `Sources/Fault/TestVector.swift`
- [Vector generators](https://github.com/aucohl/fault/blob/main/Sources/Fault/TVGenerator.swift): `Sources/Fault/TVGenerator.swift`
- [Vector compaction](https://github.com/aucohl/fault/blob/main/Sources/Fault/Compaction.swift): `Sources/Fault/Compaction.swift`

### Synthesis and support

- [Synthesis scripts](https://github.com/aucohl/fault/blob/main/Sources/Fault/Synthesis.swift): `Sources/Fault/Synthesis.swift`
- [Thread pool](https://github.com/aucohl/fault/blob/main/Sources/CThreadPool/thpool.c): `Sources/CThreadPool/thpool.c`
- [Thread pool API](https://github.com/aucohl/fault/blob/main/Sources/CThreadPool/include/thpool.h): `Sources/CThreadPool/include/thpool.h`

### Other components

- **Engineer**

## Connections

- Engineer → Fault CLI: invokes (evidence: `Readme.md`)
- Fault CLI → ATPG: dispatches (evidence: `Sources/Fault/Entries/main.swift`)
- Fault CLI → Design cutting: dispatches (evidence: `Sources/Fault/Entries/main.swift`)
- Fault CLI → Synthesis command: dispatches (evidence: `Sources/Fault/Entries/main.swift`)
- Fault CLI → Assembly command: dispatches (evidence: `Sources/Fault/Entries/main.swift`)
- Fault CLI → TAP generation: dispatches (evidence: `Sources/Fault/Entries/main.swift`)
- Fault CLI → Scan stitching: dispatches (evidence: `Sources/Fault/Entries/main.swift`)
- ATPG → Netlist model: uses (evidence: `Sources/Fault/Entries/atpg.swift`)
- ATPG → Test vectors: uses (evidence: `Sources/Fault/Entries/atpg.swift`)
- Design cutting → Netlist model: parses (evidence: `Sources/Fault/Entries/cut.swift`)
- Design cutting → Scan configuration: reads (evidence: `Sources/Fault/Entries/cut.swift`)
- Scan stitching → Netlist model: parses (evidence: `Sources/Fault/Entries/chain.swift`)
- Scan stitching → Boundary scan cells: creates (evidence: `Sources/Fault/Entries/chain.swift`)
- Scan stitching → Scan configuration: reads (evidence: `Sources/Fault/Entries/chain.swift`)
- Scan stitching → Synthesis scripts: uses (evidence: `Sources/Fault/Entries/chain.swift`)
- TAP generation → Synthesis scripts: uses (evidence: `Sources/Fault/Entries/tap.swift`)
- Synthesis command → Synthesis scripts: generates scripts (evidence: `Sources/Fault/Entries/synth.swift`)
- TAP generation → JTAG logic: uses
- Simulation → Test vectors: uses (evidence: `Sources/Fault/Simulation.swift`)
- Simulation → Vector generators: uses (evidence: `Sources/Fault/Simulation.swift`)
- Simulation → Vector compaction: uses
- Vector generators → Test vectors: produces (evidence: `Sources/Fault/TVGenerator.swift`)
- Thread pool → Thread pool API: implements (evidence: `Sources/CThreadPool/thpool.c`)
