Git Product home page Git Product logo

p4c-bm's Introduction

p4c-bm

https://travis-ci.org/p4lang/p4c-bm.svg?branch=develop

Generates the JSON configuration for the behavioral-model (bmv2), as well as the PD (Protocol Dependent) library C/C++ files, if needed.

Usage

  • To install p4c-bm on your machine:

    • sudo pip install -r requirements.txt
    • sudo python setup.py install
  • Using p4c-bm

    • Try p4c-bmv2 -h
    • --json to generate a JSON representation of the P4 program
    • --pd to generate the PD C++ code
  • Compiling the PD

    You can copy the generated C++ PD file to your project directory (and compile them with your app).

    You can also use the pd_mk directory to compile the PD code:

    • cd pd_mk/
    • ./configure --includedir=<target_dir_for_headers> --libdir=<target_dir_for_libraries>
    • make 'P4_PATH=<path_to_p4_program>' 'P4_PREFIX=<prefix_for_apis>'
    • make install

    You will find the PD headers (fixed and generated) in target_dir_for_headers and the libraries (libpdfixed and libpd) in target_dir_for_libraries.

    If your main project also uses autotools, you may be able to integrate pd_mk directly in your infrastructure with AC_CONFIG_SUBDIRS

p4c-bm's People

Contributors

antoninbas avatar

Watchers

 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.