GithubHelp home page GithubHelp logo

tobiaskappe / petr4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from verified-network-toolchain/petr4

0.0 1.0 0.0 21.58 MB

Petr4: Formal Semantics for P4

License: Apache License 2.0

Makefile 0.18% OCaml 76.07% HTML 0.73% P4 10.23% Shell 0.12% CSS 12.31% Python 0.36%

petr4's Introduction

Welcome to Petr4

The Petr4 project is developing the formal semantics of the P4 Language backed by an independent reference implementation.

Getting Started

Installing Petr4

  1. Install OPAM 2 following the official OPAM installation instructions. Make sure opam --version reports version 2 or later.

  2. Install external dependencies:

    sudo apt-get install m4 libgmp-dev
    

Installing from OPAM

  1. Install petr4 from the opam repository. This will take a while the first time because it installs OPAM dependencies.
    opam install petr4
    

Installing from source

  1. Check the installed version of OCaml:

    ocamlc -v
    

    If the version is less than 4.09.0, upgrade:

    opam switch 4.09.0
    
  2. Install p4pp from source.

  3. Use OPAM to install dependencies.

    opam install . --deps-only
    
  4. Build binaries using the supplied Makefile

    make
    
  5. Install binaries in local OPAM directory

    make install
    
  6. [Optional] Run tests

    make test
    

Running Petr4

Currently petr4 is merely a P4 front-end. By default, it will parse a source program to an abstract syntax tree and print it out, either as P4 or encoded into JSON.

Run petr4 -help to see the list of currently-supported options.

Web user interface

petr4 uses js_of_ocaml to provide a web interface. To compile to javascript, run make web. Then open index.html in html_build in a browser.

Contributing

Petr4 is an open-source project. We encourage contributions! Please file issues on Github.

Credits

See the list of contributors.

License

Petr4 is released under the Apache2 License.

petr4's People

Contributors

hackedy avatar stp59 avatar jnfoster avatar amandashoe avatar rudynicolop avatar alexchang8 avatar alaiasolkobreslin avatar liujed avatar nigusu-allehu avatar xclerc avatar

Watchers

James Cloos 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.