{"id":23397759,"url":"https://github.com/jack-mil/atpg-toolkit","last_synced_at":"2025-07-22T22:35:01.753Z","repository":{"id":263206234,"uuid":"880929883","full_name":"jack-mil/atpg-toolkit","owner":"jack-mil","description":"Digital logic circuit simulation, deductive fault simulation, and PODEM test pattern generation library","archived":false,"fork":false,"pushed_at":"2025-06-04T01:48:04.000Z","size":1988,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T09:06:14.213Z","etag":null,"topics":["design-for-test","digital-logic","digital-logic-simulator","fault-detection","podem","test-generation","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jack-mil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-30T16:03:58.000Z","updated_at":"2025-06-04T01:48:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef32bdea-6fc9-4536-9a98-8ab21f5f2632","html_url":"https://github.com/jack-mil/atpg-toolkit","commit_stats":null,"previous_names":["jack-mil/logic-test-generator","jack-mil/atpg-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jack-mil/atpg-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-mil%2Fatpg-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-mil%2Fatpg-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-mil%2Fatpg-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-mil%2Fatpg-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jack-mil","download_url":"https://codeload.github.com/jack-mil/atpg-toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jack-mil%2Fatpg-toolkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266586409,"owners_count":23952172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design-for-test","digital-logic","digital-logic-simulator","fault-detection","podem","test-generation","testing"],"created_at":"2024-12-22T08:36:06.385Z","updated_at":"2025-07-22T22:35:01.726Z","avatar_url":"https://github.com/jack-mil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automatic Test Pattern Generation toolkit\n\nProvides fault-free circuit simulation, deductive fault simulation, and PODEM test pattern generation for the single-stuck fault model in one extensible and self-contained Python library.\n\n**External Dependencies**: None! Only Python 3.13 required.\n\nImplements the 5-valued \"D-Calculus\" logic simulation (0,1,D,D̅,X).\n- 0 : Logic low\n- 1 : Logic high\n- X : net with unknown/no logic level\n- D : faulty net at 0 instead of 1\n- D̅ : faulty net at 1 instead of 0\n\n\n## Limitations\n- Only 2-input AND/OR/NAND/NOR and 1-input inverters \u0026 buffers are supported\n- No XOR gates\n- The `Circuit` class can be extended to support parsing netlists in other, more standard formats.\n\nThe groundwork is here, I would like to revisit and add these features one day™\n\n## Library Usage\n```py\nfrom atpg_toolkit import TestGenerator, FaultSimulation, Fault\nfrom atpg_toolkit.util import str_to_fault\n\nnetlist = [ 'NAND A B E',\n            'AND C E F',\n            'OR D E out2',\n            'NOR A E out1',\n            'INPUT A B C D -1',\n            'OUTPUT out1 out2 -1'   ]\n# netlist can be a file or a list of gates\n# net names can be letters/numbers/words\npodem = TestGenerator(netlist)\nfault = Fault('out1', stuck_at=1)\n# fault = Fault('E', '1')\n# fault = str_to_fault('E-sa-1')\n# fault = str_to_fault('E 1')\n\nfound_test = podem.generate_test(fault)\nprint(found_test)\n\nsim = FaultSimulation(netlist)\n\n# produces set of faults detected by a test\nfaults = sim.detect_faults(found_test)\nprint(*faults)\n```\nSee tests and the cli implementation for more examples\n\n## CLI Usage\nThe primary usage of ATPG Toolkit is as a library for other python scripts.\nHowever, a basic command-line utility is available for demonstration purposes, or to combine with output from other processes (see `scripts/` for examples).\n\nWhen installed as a package, you can execute `python -m atpg_toolkit` to see the CLI usage. A entry point is also installed, and available as `atpg-toolkit`.\n\nFor more convenience as a tool, the `./atpg-toolkit` script can act as an executable entry-point on systems with script Shebang support. No installation of the package is necessary (but recommended).\n\n```\n$ python -m atpg_toolkit faults --help\nusage: __main__.py [-h] [-v] {faults,f,generate,g,simulate,s} ...\n\nGenerate test patterns or simulate faults on digital logic circuits.\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --version         show program's version number and exit\n\nActions:\n  {faults,f,generate,g,simulate,s}\n    faults (f)          Find detected faults with a given net-list and test vector(s)      \n    generate (g)        Find a test vector that detects a given fault\n    simulate (s)        Perform fault-free simulation with a given net-list and test       \n                        vector(s)\n\nCopyright 2024, jack-mil. Source: https://github.com/jack-mil/atpg-toolkit\n```\n\nYou can install the package with a tool like uv or pipx to make the tool available at the user level.\n\n### Examples:\n```\n$ atpg_toolkit generate circuits/s349f_2.net 85-sa-1 10-sa-0 179-sa-1\n\nCircuit: circuits/s349f_2.net\nFault    | Test\n10-sa-0  | XXXXXXXXX1XXXXXXXXXXXXXX\n85-sa-1  | 01X01XXXXX1XXXX0XXXXXXXX\n179-sa-1 | UNDETECTABLE\n```\n```\n$ python -m atpg_toolkit faults circuits/s27.net 1110101\n\nCircuit: circuits/s27.net\nInput Vector: 1 1 1 0 1 0 1\n------ Detected Faults (8) ------\n   1 stuck at 0\n   3 stuck at 0\n   5 stuck at 0\n   7 stuck at 0\n   9 stuck at 1\n  11 stuck at 1\n  12 stuck at 0\n  13 stuck at 0\n```\n```\n$ python -m atpg_toolkit simulate circuits/s27.net -f scripts/data/s27-tests.txt\n\nCircuit: circuits/s27.net\nInputs  | Outputs\n1110101 | 1001\n0001010 | 0100\n1010101 | 1001\n0110111 | 0001\n1010001 | 1001\n```\n## Disclaimer\n\u003e *This project implements textbook concepts for a course on digital \n\u003e systems test generation. It is not recommended for any critical or \n\u003e serious test generation needs. The code serves as reference and a \n\u003e learning aid **only**. There is no guarantee of efficient operation\n\u003e or correct output.*\n\n## Reference\n\n\u003e Miron Abramovici, M. A. Breuer, and A. D. Friedman, *Digital Systems Testing and Testable Design*. Wiley-IEEE Press, 1994.\n\n\u003e P. Goel and B. C. Rosales, \"PODEM-X: An Automatic Test Generation System for VLSI Logic Structures,\" Proc. 18th Design Automation conf., pp. 260-268, June, 1981.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-mil%2Fatpg-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjack-mil%2Fatpg-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjack-mil%2Fatpg-toolkit/lists"}