论文标题
通过开关硬件仿真测试可编程开关的编译器
Testing Compilers for Programmable Switches Through Switch Hardware Simulation
论文作者
论文摘要
可编程开关已成为固定功能转发设备的功能强大且灵活的替代方案。但是,由于网络交换机的独特硬件约束,针对这些设备的编译器的设计和实现非常容易发生。尽管编译器在软件开发中发挥了重要作用,但仍缺乏用于测试可编程网络设备的编译器的工具。我们提出Druzhba,这是一种可编程开关模拟器,用于测试针对可编程数据包处理基板的编译器。我们表明,我们可以对开关可编程硬件的低级行为进行建模。我们进一步展示了编译器开发人员如何将我们的机器模型以Druzhba为目标作为编译器后端。生成的机器代码程序被馈入Druzhba,并使用基于模糊的方法进行了测试,该方法允许编译器开发人员测试其编译器的正确性。使用基于程序合成的编译器作为案例研究,我们演示了Druzhba如何成功地测试编译器生成的机器代码为我们的模拟开关管道指令集。
Programmable switches have emerged as powerful and flexible alternatives to fixed-function forwarding devices. But because of the unique hardware constraints of network switches, the design and implementation of compilers targeting these devices is tedious and error prone. Despite the important role that compilers play in software development, there is a dearth of tools for testing compilers for programmable network devices. We present Druzhba, a programmable switch simulator used for testing compilers targeting programmable packet-processing substrates. We show that we can model the low-level behavior of a switch's programmable hardware. We further show how our machine model can be used by compiler developers to target Druzhba as a compiler backend. Generated machine code programs are fed into Druzhba and tested using a fuzzing-based approach that allows compiler developers to test the correctness of their compilers. Using a program-synthesis-based compiler as a case study, we demonstrate how Druzhba has been successful in testing compiler-generated machine code for our simulated switch pipeline instruction set.