GithubHelp home page GithubHelp logo

p416compilerbackend's Introduction

P416CompilerBackend

Language features not supported yet

In Parser

-- header stack, union 
-- variable length header 

In Match-action stages

-- Indirect Counter and meter (direct meter and counters are supported. Indirect counter and meters are not supported yet. However, indirect meter and counters can be replaced in P4 code using SRAM based stateful memory). 
-- Custom externs are not supported. However they can be supported easily. I will add how to support them as soon as possible. 

How to run this compiler backend

See the next section for installing the software that P416Compiler depends upon.

You need to provide the hardware resources at first. Example hardware resources are given in following folder

-- P416CompilerBackend/Resources/HardwareConfigs/
For details of this JSON format you can look at my paper. 

Compiler your P4 program using P4C compiler (of course for P4 16 version)

Save the intermediate representation in a json file.

Now get the path for the hardwar resource and the intermediate representation JSON file.

Go to following python file

-- P416CompilerBackend/src/main.py

In line 15 of the code provide the path for these two JSON file. Then simply run the main.py file. you will get the mapping if the compiler backend can map the P4 program. Otherwise it will show you not possible.

NOTE: Besides this there are few P4 16 language features are well supported yet. In most of the cases the compiler backend will give you descriptive message. If you need to support new language features or new externs, look at the code. I will try to make a detailed documentation on this as soon as possible.

If you are interested in extending the compiler backend kindly let me know, I will try to help you as far as I can.

Install steps

On a supported Linux distribution and version, which currently includes:

  • Ubuntu 20.04, 22.04
  • Fedora 36, 37, 38

run this script to install software that P416Compiler depends upon:

cd P416CompilerBackend
./src/install.sh

If you are using this repository, please consider citing my paper

@INPROCEEDINGS{10061720, author={Robin, Debobroto Das and Khan, Javed I.}, booktitle={2022 IEEE/ACM 15th International Conference on Utility and Cloud Computing (UCC)}, title={Open Source Compiling for V1Model RMT Switch: Making Data Center Networking Innovation Accessible}, year={2022}, volume={}, number={}, pages={133-138}, doi={10.1109/UCC56403.2022.00024}}

Details of this compiler backend can be found in the following technical report in arxiv

@misc{robin2022opensource, title={An Open-Source P416 Compiler Backend for Reconfigurable Match-Action Table Switches}, author={Debobroto Das Robin and Javed I. Khan}, year={2022}, eprint={2208.12892}, archivePrefix={arXiv}, primaryClass={cs.NI} }

Code explanation

You need to read our technical report mentioned in the arxiv citation. Then it is easier to understand the flow of the code. A brief overview of the code is given in https://github.com/drobinkent/P416CompilerBackend/blob/main/Doccumentation.md

p416compilerbackend's People

Contributors

drobinkent avatar jafingerhut avatar

Stargazers

Ian Tang avatar George Karlos avatar CHEN Xiang avatar Jonas_Chen avatar  avatar Aaron A. Glenn avatar Jack avatar

Watchers

Jonas_Chen avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.