Skip to content
Generates the JSON configuration for the behavioral-model (bmv2), as well as the C/C++ PD code
Python C++ P4 C Thrift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
p4c_bm changed VERSION number to 1.12.0 for release Jul 24, 2018
tests
.editorconfig Initial commit Aug 7, 2015
.gitignore Fix install hook in setup.py (#75) Dec 16, 2016
.gitmodules removed pdfixed and pd_mk Apr 28, 2016
.travis.yml
AUTHORS.rst Initial commit Aug 7, 2015
CONTRIBUTING.rst Initial commit Aug 7, 2015
HISTORY.rst updated HISTORY.rst for first release Sep 10, 2015
LICENSE
MANIFEST.in
README.rst added some information to README and removed pkgdatadir CLI option wh… Apr 29, 2016
p4c-bmv2.in
requirements.txt Don't use pip editable mode when installing deps (#67) Oct 6, 2016
requirements_v1_1.txt Don't use pip editable mode when installing deps (#67) Oct 6, 2016
setup.cfg Initial commit Aug 7, 2015
setup.py Use root correctly in the setup.py install hook (#78) Jan 12, 2017
tox.ini added a v1.1 test P4 program and updated README Feb 24, 2016

README.rst

p4c-bm

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

Generates the JSON configuration for the behavioral-model (bmv2).

Important: the PD has been moved out of this repository and split between the bmv2 repository (for fixed part of the PD) and the new p4-build repository (build infrastructure for the auto-generated / program-dependent part of the PD).

Usage

  • To install p4c-bm on your machine:
    • sudo pip install -r requirements.txt
    • sudo pip install -r requirements_v1_1.txt if you are interested in compiling P4 v1.1 programs
    • 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
    • --p4-v1.1 if your input program is a P4 v1.1 program
  • To install in a non-default location, you can use:
    • python setup.py build install --prefix <your_path> [--single-version-externally-managed] --record install_files.txt
    • cat install_files.txt | xargs rm -rf if you need to uninstall later on
You can’t perform that action at this time.