Finding and Understanding Bugs in FPGA Synthesis Tools

All software ultimately relies on hardware functioning correctly. Hardware correctness is becoming increasingly important due to the growing use of custom accelerators using FPGAs to speed up applications on servers. Furthermore, the increasing complexity of hardware also leads to ever more reliance on automation, meaning that the correctness of synthesis tools is vital for the reliability of the hardware. This paper aims to improve the quality of FPGA synthesis tools by introducing a method to test them automatically using randomly generated, correct Verilog, and checking that the synthesised netlist is always equivalent to the original design. The main contributions of this work are twofold: firstly a method for generating random behavioural Verilog free of undefined values, and secondly a Verilog test case reducer used to locate the cause of the bug that was found. These are implemented in a tool called Verismith. This paper also provides a qualitative and quantitative analysis of the bugs found in Yosys, Vivado, XST and Quartus Prime. Every synthesis tool except Quartus Prime was found to introduce discrepancies between the netlist and the design. In addition to that, Vivado and a development version of Yosys were found to crash when given valid input. Using Verismith, eleven bugs were reported to tool vendors, of which six have already been fixed.

[1]  Miriam Leeser,et al.  A formally verified system for logic synthesis , 1991, [1991 Proceedings] IEEE International Conference on Computer Design: VLSI in Computers and Processors.

[2]  Tom Feist,et al.  Vivado Design Suite , 2012 .

[3]  Andreas Zeller,et al.  Simplifying and Isolating Failure-Inducing Input , 2002, IEEE Trans. Software Eng..

[4]  Rance Cleaveland,et al.  Implementing mathematics with the Nuprl proof development system , 1986 .

[5]  Adam Chlipala,et al.  Kami: a platform for high-level parametric hardware specification and its modular verification , 2017, Proc. ACM Program. Lang..

[6]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[7]  Zhendong Su,et al.  HDD: hierarchical delta debugging , 2006, ICSE.

[8]  Wouter Swierstra,et al.  Pi-Ware: Hardware Description and Verification in Agda , 2015, TYPES.

[9]  Clark W. Barrett,et al.  The SMT-LIB Standard Version 2.0 , 2010 .

[10]  Xuejun Yang,et al.  Test-case reduction for C compiler bugs , 2012, PLDI.

[11]  Gregg Baeckler,et al.  Verifying the correctness of FPGA logic synthesis algorithms , 2003, FPGA '03.

[12]  W. M. McKeeman,et al.  Differential Testing for Software , 1998, Digit. Tech. J..

[13]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[14]  Ramana Kumar,et al.  Verified compilation on a verified processor , 2019, PLDI.

[15]  Alastair F. Donaldson,et al.  Many-core compiler fuzzing , 2015, PLDI.

[16]  Xuejun Yang,et al.  Finding and understanding bugs in C compilers , 2011, PLDI '11.