{"title":"用于硬件解码的寄存器聚合","authors":"Varun Rao, Zachary D. Sisco","doi":"arxiv-2409.03119","DOIUrl":null,"url":null,"abstract":"Hardware decompilation reverses logic synthesis, converting a gate-level\ndigital electronic design, or netlist, back up to hardware description language\n(HDL) code. Existing techniques decompile data-oriented features in netlists,\nlike loops and modules, but struggle with sequential logic. In particular, they\ncannot decompile memory elements, which pose difficulty due to their\ndeconstruction into individual bits and the feedback loops they form in the\nnetlist. Recovering multi-bit registers and memory blocks from netlists would\nexpand the applications of hardware decompilation, notably towards retargeting\ntechnologies (e.g. FPGAs to ASICs) and decompiling processor memories. We\ndevise a method for register aggregation, to identify relationships between the\ndata flip-flops in a netlist and group them into registers and memory blocks,\nresulting in HDL code that instantiates these memory elements. We aggregate\nflip-flops by identifying common enable pins, and derive the bit-order of the\nresulting registers using functional dependencies. This scales similarly to\nmemory blocks, where we repeat the algorithm in the second dimension with\nspecial attention to the read, write, and address ports of each memory block.\nWe evaluate our technique over a dataset of 13 gate-level netlists, comprising\ncircuits from binary multipliers to CPUs, and we compare the quantity and\nwidths of recovered registers and memory blocks with the original source code.\nThe technique successfully recovers memory elements in all of the tested\ncircuits, even aggregating beyond the source code expectation. In 10 / 13\ncircuits, all source code memory elements are accounted for, and we are able to\ncompact up to 2048 disjoint bits into a single memory block.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"39 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Register Aggregation for Hardware Decompilation\",\"authors\":\"Varun Rao, Zachary D. Sisco\",\"doi\":\"arxiv-2409.03119\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Hardware decompilation reverses logic synthesis, converting a gate-level\\ndigital electronic design, or netlist, back up to hardware description language\\n(HDL) code. Existing techniques decompile data-oriented features in netlists,\\nlike loops and modules, but struggle with sequential logic. In particular, they\\ncannot decompile memory elements, which pose difficulty due to their\\ndeconstruction into individual bits and the feedback loops they form in the\\nnetlist. Recovering multi-bit registers and memory blocks from netlists would\\nexpand the applications of hardware decompilation, notably towards retargeting\\ntechnologies (e.g. FPGAs to ASICs) and decompiling processor memories. We\\ndevise a method for register aggregation, to identify relationships between the\\ndata flip-flops in a netlist and group them into registers and memory blocks,\\nresulting in HDL code that instantiates these memory elements. We aggregate\\nflip-flops by identifying common enable pins, and derive the bit-order of the\\nresulting registers using functional dependencies. This scales similarly to\\nmemory blocks, where we repeat the algorithm in the second dimension with\\nspecial attention to the read, write, and address ports of each memory block.\\nWe evaluate our technique over a dataset of 13 gate-level netlists, comprising\\ncircuits from binary multipliers to CPUs, and we compare the quantity and\\nwidths of recovered registers and memory blocks with the original source code.\\nThe technique successfully recovers memory elements in all of the tested\\ncircuits, even aggregating beyond the source code expectation. In 10 / 13\\ncircuits, all source code memory elements are accounted for, and we are able to\\ncompact up to 2048 disjoint bits into a single memory block.\",\"PeriodicalId\":501197,\"journal\":{\"name\":\"arXiv - CS - Programming Languages\",\"volume\":\"39 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-04\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Programming Languages\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2409.03119\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.03119","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Hardware decompilation reverses logic synthesis, converting a gate-level
digital electronic design, or netlist, back up to hardware description language
(HDL) code. Existing techniques decompile data-oriented features in netlists,
like loops and modules, but struggle with sequential logic. In particular, they
cannot decompile memory elements, which pose difficulty due to their
deconstruction into individual bits and the feedback loops they form in the
netlist. Recovering multi-bit registers and memory blocks from netlists would
expand the applications of hardware decompilation, notably towards retargeting
technologies (e.g. FPGAs to ASICs) and decompiling processor memories. We
devise a method for register aggregation, to identify relationships between the
data flip-flops in a netlist and group them into registers and memory blocks,
resulting in HDL code that instantiates these memory elements. We aggregate
flip-flops by identifying common enable pins, and derive the bit-order of the
resulting registers using functional dependencies. This scales similarly to
memory blocks, where we repeat the algorithm in the second dimension with
special attention to the read, write, and address ports of each memory block.
We evaluate our technique over a dataset of 13 gate-level netlists, comprising
circuits from binary multipliers to CPUs, and we compare the quantity and
widths of recovered registers and memory blocks with the original source code.
The technique successfully recovers memory elements in all of the tested
circuits, even aggregating beyond the source code expectation. In 10 / 13
circuits, all source code memory elements are accounted for, and we are able to
compact up to 2048 disjoint bits into a single memory block.