arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.03119cs.ARcs.PL
收藏

面向硬件反编译的寄存器聚合

Register Aggregation for Hardware Decompilation

Varun Rao, Zachary D. Sisco

AI总结:

本文提出寄存器聚合方法,通过识别公共使能引脚和函数依赖关系,将网表中被拆解的触发器重新聚合为寄存器和存储块,并在13个门级网表上验证了其有效性,成功恢复所有测试电路的存储元件,最多将2048个比特位压缩为单个存储块。

摘要:

硬件反编译是逻辑综合的逆过程,它将门级数字电子设计(即网表)转换回硬件描述语言(HDL)代码。现有技术能够反编译网表中面向数据的特征,例如循环和模块,但在时序逻辑方面存在困难。特别是,它们无法反编译存储元件,这是因为存储元件在网表中被拆解为单个比特位,并形成了反馈回路,从而带来困难。从网表中恢复多位寄存器和存储块将扩展硬件反编译的应用范围,尤其是在重定向技术(例如从 FPGA 到 ASIC)和处理器存储器反编译方面。我们设计了一种寄存器聚合方法,用于识别网表中数据触发器之间的关系,并将它们分组为寄存器和存储块,从而生成实例化这些存储元件的 HDL 代码。我们通过识别公共使能引脚来聚合触发器,并利用函数依赖关系推导出所生成寄存器的位序。该方法在存储块上的扩展方式类似,我们在第二个维度上重复该算法,并特别关注每个存储块的读端口、写端口和地址端口。我们在一个包含 13 个门级网表的数据集上评估了该技术,这些网表涵盖从二进制乘法器到 CPU 的电路,并将恢复出的寄存器和存储块的数量与宽度与原始源代码进行了比较。该技术成功地在所有测试电路中恢复了存储元件,甚至聚合出了超出源代码预期的结果。在 13 个电路中有 10 个电路,所有源代码存储元件均被完全覆盖,并且我们能够将多达 2048 个不相交的比特位压缩为单个存储块。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑