[P4-dev] Query regarding P4 bmv2 code versions and specs

Hardik Soni hardik.soni at inria.fr
Tue Aug 1 06:29:49 EDT 2017

Hello All, 

I need some information on versions of specs, p4c code and bmv2 code. 


There is a spec ( Version 1.0.3) of P416 dated November 2, 2016. 
That BNF is not of P416 compiler, am I right? 
A recent, May 2017, spec has different grammar. 

I have BMV2 clone with following last commit. 

commit 41c1f2ed487ff086a1d582069e8bc68cab8ffdb0 
Author: Antonin Bas <antonin at barefootnetworks.com> 
Date: Fri Jul 7 11:49:00 2017 -0700 

Fix installation for simple_switch_grpc (#409) 
Fixed error: "Recursive variable 'includep4bmdir' references itself" 



I have p4c compiler clone with following last commit. 


commit ae458b34014e23f095accac80088757a07612a7a 
Author: Calin Cascaval <cascaval at barefootnetworks.com> 
Date: Tue Jul 11 21:02:41 2017 -0700 

proper path to include directory 


If any one can confirm the exact commands to compile for bmv2(simple_switch target) and run on it, it will be great.(for the above commit versions) 

Though, I used python script in mininet folder. 

And the most important question 


I could run simple_router json file(probably precompile from P414 ) on bmv2 simple_router target. 

It could run safely. 

So, is there any big change in execution of json files of P414 and p416? 

Being more precise, my code heavily depends on 

P4Objects::init_objects(std::istream *is, LookupStructureFactory *lookup_factory, int device_id, size_t cxt_id, 

std::shared_ptr<TransportIface> notifications_transport, const std::set<header_field_pair> 

&required_fields, const ForceArith &arith_objects) { 

/* All the data structures(maps and vectors etc) being initialized here */ 


Is there any difference in filling up the data-structures for P4-14 and p4-16 jsons? 

Best Regards, 
Hardik Soni 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170801/b481d18f/attachment-0002.html>

More information about the P4-dev mailing list