Giter Club home page Giter Club logo

p4dummy's Introduction

p4dummy

P4Dummy showcases how a compiler back end can be written for the official P4 compiler (P4C). P4Dummy shows how to integrate with P4C's visitor library, parser, and front end. It does nothing but apply a series of compiler passes and echo the final version of the program.

Requirements

P4Dummy is written as an extension to P4C. It has no other dependencies. P4C extensions are symlinked into the extensions folder of P4C and are automatically picked up once CMake is run. An example workflow could be:

cd p4c/
mkdir extensions
cd extensions
git clone https://github.com/fruffy/p4dummy
cd p4c/build
cmake ..
make

This assumes that P4C is setup correctly Instructions can be found here.

Afterwards, the p4dummy executable can be found in the p4c/buildfolder.

Usage

Executing P4Dummy will echo P4 programs in various stages of compilation (e.g., before/after the front or mid end):

./build/p4dummy example.p4

P4Dummy also has a mode where it does not require a particular input program and instead just echoes an internally defined program. You can toggle this mode with:

./build/p4dummy --use-fixed

TODO

  • Also build P4Dummy using Bazel

p4dummy's People

Contributors

fruffy avatar sanket-0510 avatar snapdgn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

p4dummy's Issues

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.