P4 Backend for FPGAs (HDL)

Hi all,

I’m new to the P4 ecosystem and have been exploring the available backends for the P4C compiler. However, I haven’t found anything suitable for developing HDL for FPGAs. During my research, I discovered Xilinx’s commercial IP called Vitis Networking P4, which addresses the lack of an HDL backend. This raises the question: Are there any open-source implementations of an HDL backend available? Not everyone has access to commercial IP solutions, so open-source alternatives would be valuable.

I could only find this one project ( Home · NetFPGA/P4-NetFPGA-public Wiki · GitHub ), so any help in this regard is appreciated.

Thanks.

Hi @panda , welcome to the community!

The p4c compiler does not currently include an HDL (Verilog or VHDL) backend. However, there is another backend developed as part of a PhD project: GitHub - p4fpga/p4fpga: P4-14/16 Bluespec Compiler , GitHub - benycze/PhD-Thesis: This is the public repository of my Ph.D. thesis. . However, that compiler is also quite old.

Hi @Dscano ,

Thanks for your quick response. I recently came across the p4fpga repository. As you mentioned, it’s old and no longer actively maintained, but it does include many important components that I can potentially reuse to develop my own HDL backend—since that currently seems like my only option.

I’m also curious about how practical it is to write Layer 4 and above (L4+) applications in P4. Is there any relevant research/examples in this area?

Thanks.

@panda If you are planning to go through that, I can suggest you join the P4 language working group (https://p4.org/working-groups/). Within this working group, you can find P4C experts and/or ask for guidance. Furthermore, if you would like to extend P4C with an HDL backend, you are more than welcome.

Here are some tutorial exercises to help you get to know P4: https://github.com/p4lang/tutorials/tree/master/exercises. Additionally, here you can find publications that involve P4, so you might find something related to application layers: Publications - P4 Language Consortium.

1 Like