[P4-dev] Default switch case should not be reachable with new extern function primitive

Hamidreza Almasi halmas3 at uic.edu
Tue Feb 5 14:05:13 EST 2019


Thanks! const was the problem..

On Mon, Feb 4, 2019 at 2:37 PM Antonin Bas <antonin at barefootnetworks.com>
wrote:

> The parameters of your C++ action primitive implementation should be Data
> &, const Data &, const Data &
> My guess is that you forgot the const qualifiers.
>
> On Sat, Feb 2, 2019 at 5:34 PM Hamidreza Almasi <halmas3 at uic.edu> wrote:
>
>> I have defined an extern function as follows:
>> extern void int_div(out bit<32> result, in bit<32> op1, in bit<32> op2);
>>
>> and have implemented its functionality as a simple_switch primitive from
>> p4 tutorials suggested checkouts tags. I compile the p4 code with:
>>
>> p4c-bm2-ss --p4v 16 --p4runtime-file basic.p4info --p4runtime-format text
>> -o basic.json basic.p4
>>
>> and feed it to simple_switch_grpc but when I send a packet, the switch
>> fails noting:
>> Assertion 'Default switch case should not be reachable' failed, file
>> '../../include/bm/bm_sim/actions.h' line '282'.
>>
>> I have attached the p4 code, the switch log and the json file and would
>> appreciate your help on why this happens and what should the fix be.
>> _______________________________________________
>> P4-dev mailing list
>> P4-dev at lists.p4.org
>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>
>
>
> --
> Antonin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20190205/de4ee397/attachment.html>


More information about the P4-dev mailing list