TY - GEN
T1 - Switch Code Generation Using Program Synthesis
AU - Gao, Xiangyu
AU - Kim, Taegyun
AU - Wong, Michael D.
AU - Raghunathan, Divya
AU - Varma, Aatish Kishan
AU - Kannan, Pravein Govindan
AU - Sivaraman, Anirudh
AU - Narayana, Srinivas
AU - Gupta, Aarti
N1 - Publisher Copyright:
© 2020 ACM.
PY - 2020/7/30
Y1 - 2020/7/30
N2 - Writing packet-processing programs for programmable switch pipelines is challenging because of their all-or-nothing nature: a program either runs at line rate if it can fit within pipeline resources, or does not run at all. It is the compiler's responsibility to fit programs into pipeline resources. However, switch compilers, which use rewrite rules to generate switch machine code, often reject programs because the rules fail to transform programs into a form that can be mapped to a pipeline's limited resources-even if a mapping actually exists. This paper presents a compiler, Chipmunk, which formulates code generation as a program synthesis problem. Chipmunk uses a program synthesis engine, SKETCH, to transform high-level programs down to switch machine code. However, naively formulating code generation as program synthesis can lead to long compile times. Hence, we develop a new domain-specific synthesis technique, slicing, which reduces compile times by 1-387x and 51x on average. Using a switch hardware simulator, we show that Chipmunk compiles many programs that a previous rule-based compiler, Domino, rejects. Chipmunk also produces machine code with fewer pipeline stages than Domino. A Chipmunk backend for the Tofino programmable switch shows that program synthesis can produce machine code for high-speed switches.
AB - Writing packet-processing programs for programmable switch pipelines is challenging because of their all-or-nothing nature: a program either runs at line rate if it can fit within pipeline resources, or does not run at all. It is the compiler's responsibility to fit programs into pipeline resources. However, switch compilers, which use rewrite rules to generate switch machine code, often reject programs because the rules fail to transform programs into a form that can be mapped to a pipeline's limited resources-even if a mapping actually exists. This paper presents a compiler, Chipmunk, which formulates code generation as a program synthesis problem. Chipmunk uses a program synthesis engine, SKETCH, to transform high-level programs down to switch machine code. However, naively formulating code generation as program synthesis can lead to long compile times. Hence, we develop a new domain-specific synthesis technique, slicing, which reduces compile times by 1-387x and 51x on average. Using a switch hardware simulator, we show that Chipmunk compiles many programs that a previous rule-based compiler, Domino, rejects. Chipmunk also produces machine code with fewer pipeline stages than Domino. A Chipmunk backend for the Tofino programmable switch shows that program synthesis can produce machine code for high-speed switches.
KW - Programmable switches
KW - code generation
KW - packet processing pipelines
KW - program synthesis
KW - slicing
UR - http://www.scopus.com/inward/record.url?scp=85094869271&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85094869271&partnerID=8YFLogxK
U2 - 10.1145/3387514.3405852
DO - 10.1145/3387514.3405852
M3 - Conference contribution
AN - SCOPUS:85094869271
T3 - SIGCOMM 2020 - Proceedings of the 2020 Annual Conference of the ACM Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication
SP - 44
EP - 61
BT - SIGCOMM 2020 - Proceedings of the 2020 Annual Conference of the ACM Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication
PB - Association for Computing Machinery
T2 - 2020 Annual Conference of the ACM Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication, SIGCOMM 2020
Y2 - 10 August 2020 through 14 August 2020
ER -