基于P4C编译器后端的编译方法、系统及电子设备

By acquiring the API libraries of the P4C compiler front-end and middle-end, the IR nodes processed by the P4C middle-end are converted into JSON format data, parsed and generated into dedicated machine code firmware files, solving the problem of low performance of the P4 compiler back-end, and realizing efficient compilation and performance improvement of smart network cards.

CN122152325BActive Publication Date: 2026-07-17YIHUA TECHNOLOGY (BEIJING) CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YIHUA TECHNOLOGY (BEIJING) CO LTD
Filing Date
2026-05-09
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

The existing P4 compiler backend cannot efficiently compile general-purpose P4 programs into dedicated smart network card machine code, resulting in low performance efficiency of the P4 processor for hardware resources.

Method used

By acquiring the API libraries of the P4C compiler front-end and middle-end, the IR nodes processed by the P4C middle-end are converted into JSON format data, and the semantics of the P4 program are parsed to generate dedicated machine code firmware files for the Parser, the Matching Execution Unit (MAT), and the Deparser, thus realizing the IR downcompilation of the P4 program from IR to hardware machine code.

Benefits of technology

It enables the compilation of general-purpose P4 programs into dedicated machine code for smart network cards, improving the performance efficiency of the P4 processor in utilizing hardware resources and supporting in-depth optimization of network protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152325B_ABST
    Figure CN122152325B_ABST
Patent Text Reader

Abstract

本发明提供了一种基于P4C编译器后端的编译方法、系统及电子设备,涉及编译器领域,解决P4处理器针对硬件资源的性能有效度较低的技术问题。该方法包括:通过所述API库得到P4C中端处理后的IR节点;基于所述P4C中端处理后的IR节点将所述IR节点的语义描述数据转换为JSON格式数据,并将所述JSON格式数据作为P4运行时的输入;遍历所述JSON格式数据并分别解析所述JSON格式数据中描述的P4程序语义;基于所述P4程序语义分别生成解析器、匹配执行单元和逆解析器Deparser对应网卡硬件单元的专用机器码固件文件,得到P4程序IR到硬件机器码的IR下降编译结果。
Need to check novelty before this filing date? Find Prior Art