[P4-discuss] how to debug the p4 <v1model.p4>

Antonin Bas antonin at barefootnetworks.com
Fri Oct 13 11:08:14 EDT 2017


verify() is implemented in bmv2, but as per the P4_16 spec, verify
statements are only available in the parser
the bmv2 logs will give you a lot of information about which parse states
were visited, which tables were applied...
you can also look into the bmv2 debugger, which lets you set breakpoints &
watchpoints, and lets you inspect the value of any P4 field.
  - here is how to use it:
https://github.com/p4lang/behavioral-model#using-the-debugger
  - here is the full documentation:
https://github.com/p4lang/behavioral-model/blob/master/docs/p4dbg_user_guide.md

On Thu, Oct 12, 2017 at 10:22 AM, Nate Foster <jnfoster at cs.cornell.edu>
wrote:

> A standard trick is to introduce a table "debug" whose keys are the
> headers/metatdata you want to track. The Bmv2 logs will show those values
> at the program point where the table was applied.
>
> -N
>
> On Thu, Oct 12, 2017 at 1:19 PM, Phanindra Palagummi <
> phanindra.palagummi at gmail.com> wrote:
>
>> Hello,
>>
>> I am research student in IIT Madras, interested doing some research work
>> in P4. With current P4 capabilities I want to know how to debug the P4
>> program for V1model switch.
>>
>> I suppose "error class" and verify() is not present for v1model, if so,
>> are there any ways to debug the P4 program for v1model. (i.e, how to know
>> my packet is parsed successfully, what header values it is picking etc?).
>> Please help me on this.
>>
>> Thank you,
>> Phani
>>
>> _______________________________________________
>> P4-discuss mailing list
>> P4-discuss at lists.p4.org
>> http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org
>>
>
>
> _______________________________________________
> P4-discuss mailing list
> P4-discuss at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org
>



-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-discuss_lists.p4.org/attachments/20171013/23d7c15e/attachment-0002.html>


More information about the P4-discuss mailing list