{"id":13772993,"url":"https://github.com/Yu-Maryland/Gamora","last_synced_at":"2025-05-11T05:34:23.456Z","repository":{"id":156540642,"uuid":"626122059","full_name":"Yu-Maryland/Gamora","owner":"Yu-Maryland","description":"Gamora: Graph Learning based Symbolic Reasoning for Large-Scale Boolean Networks (DAC'23)","archived":false,"fork":false,"pushed_at":"2025-01-08T03:04:31.000Z","size":23415,"stargazers_count":50,"open_issues_count":4,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T12:02:28.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yu-Maryland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2023-04-10T21:01:07.000Z","updated_at":"2025-04-06T06:24:24.000Z","dependencies_parsed_at":"2024-11-17T08:43:57.261Z","dependency_job_id":null,"html_url":"https://github.com/Yu-Maryland/Gamora","commit_stats":null,"previous_names":["yu-maryland/gamora","yu-utah/gamora"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yu-Maryland%2FGamora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yu-Maryland%2FGamora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yu-Maryland%2FGamora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yu-Maryland%2FGamora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yu-Maryland","download_url":"https://codeload.github.com/Yu-Maryland/Gamora/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523690,"owners_count":21921815,"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","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":[],"created_at":"2024-08-03T17:01:10.028Z","updated_at":"2025-05-11T05:34:20.165Z","avatar_url":"https://github.com/Yu-Maryland.png","language":"C","funding_links":[],"categories":["Circuit Compilers"],"sub_categories":[],"readme":"# Gamora: Graph Learning based Symbolic Reasoning for Large-Scale Boolean Networks (DAC'23) \n\n\u003ccenter\u003e\n\u003cfigure\u003e\n  \u003cimg src=\"./images/gamora.jpg\" style=\"width:90%\" style=\"text-align:center;\"\u003e\n\u003c/figure\u003e\n\u003c/center\u003e\n\n## Paper\n\nhttps://arxiv.org/pdf/2303.08256.pdf\n\n```bash\n@article{wu2023gamora,\n  title={Gamora: Graph Learning based Symbolic Reasoning for Large-Scale Boolean Networks},\n  author={Wu, Nan and Li, Yingjie and Hao, Cong and Dai, Steve and Yu, Cunxi and Xie, Yuan},\n  journal={Design Automation Conference (DAC'23)},\n  year={2023}\n}\n```\n\n\n## A more generic framework for Boolean/RTL Graph Learning -- [V2PYG](https://yu-maryland.github.io/Verilog-to-PyG/) \n\nWe are developing a more generic V2PYG framework to provide versatile capabilities for converting RTL designs into foundational graph representations, while also facilitating RTL-equivalent argumentation. [https://ycunxi.github.io/Verilog-to-PyG](https://yu-maryland.github.io/Verilog-to-PyG/)\n\n## Installation\n\n### Prereq: \n1) Python packages: torch and torch_geometric \n\t\n\n2) Package: readline (follow ABC installation requirement)\n\t\n\tsudo apt-get install libreadline6 libreadline6-dev (Ubuntu)\n\n\tsudo yum install readline-devel (CentOS, RedHat)\n\n### Installation\ncompile ABC customized for graph learning\n\t\n\tcd abc;make clean;make -j4\n\n\n\n## Pre-processed Dataset - CSA (techmapped) and Booth Multipliers\n\nCheck at Huggingface: https://huggingface.co/datasets/yucx0626/Gamora-CSA-Multiplier/tree/main\n\n## Implementation\n\n#### 1) Data generator \n\n\n```python\ndataset_prep/dataset_generator.py\nclass ABCGenDataset\n```\n\n- gentype =0 CSA-array Multiplier generation and labeling\n- gentype =1 CPA Adder generation and labeling\n- gentype =2 Read a design and generate dataset\n- gentype =3 Generate Booth-encoded multiplier (tbd)\n\n**Note: ABC is required (../abc) (make sure to create a link symbol of abc binary\nin this folder)**\n\n```bash\nln -s ../abc/abc .\n```\n\n\n***ABC implementation for data generation.***\n\n```c\n// abc/src/proof/acec/acecXor.c\nclass Gia_EdgelistMultiLabel()\n```\n\n\n\n#### 2) Train-Test Demo - training on 8-bit CSA and predicting on 32-bit CSA\n\n* Dataset generation\n    ```python\n    python ABC_dataset_generation.py --bits 8\n    # generate an 8-bit CSA multiplier\n    ```\n    ```python\n    python ABC_dataset_generation.py --bits 32\n    # generate a 32-bit CSA multiplier\n    ```\n\n* Training and inference\n    ```python\n    python gnn_multitask.py --bits 8 --bits_test 32\n    # training with mult8, and testing with mult32\n    ```\n\n* Inference with pre-trained model\n    ```python\n    python gnn_multitask_inference.py --model_path SAGE_mult8 --bits_test 32 --design_copies 1\n    # load the pre-trained model \"SAGE_mult8\", and test with mult32\n    ```\n\n*Training INPUT*: 8-bit CSA-Mult\n\n*Testing INPUT*: 32-bit CSA-Mult\n\n\n```bash\n# training\nHighest Train: 99.45\nHighest Valid: 100.00\n  Final Train: 98.90\n   Final Test: 99.12\n\n# testing\nmult32\nHighest Train: 0.00 ± nan\nHighest Valid: 0.00 ± nan\n  Final Train: 0.00 ± nan\n   Final Test: 99.95 ± nan\n```\n\n\n\n#### New commands for ABC\n\n```bash\n\tabc 01\u003e edgelist -h\n\tusage: edgelist : Generate pre-dataset for graph learning (MPNN,GraphSAGE, dense graph matrix)\n\t-F : Edgelist file name (*.el)\n\t-c : Class map for corresponding edgelist (Only for GraphSAGE; must has -F -c -f all enabled)\n \t-f : Features of nodes (Only for GraphSAGE; must has -F -c -f all enabled)\n \t-L : Switch to logic netlist without labels (such as AIG and LUT-netlist)\n \tExample 1 (GraphSAGE dataset)\n \t\t read your.aig; edgelist -F test.el -c test-class-map.json -f test-feats.csv \n \tExample 2 (Generate dataset for LUT-mapping netlist; unsupervised)\n \t\t  read your.blif; strash; if -K 6; edgelist -L -F lut-test.el \n \tExample 3 (Generate dataset for abstraction; supervised for FA/HA extraction  - GraphSAGE)\n \t\t  read your.blif; strash; \u0026get; \u0026edgelist -F test.el -c test-class_map.json -f test-feats.csv\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYu-Maryland%2FGamora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYu-Maryland%2FGamora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYu-Maryland%2FGamora/lists"}