PHV error on if condition

Hello,

I am having following error while compiling .p4 program on Tofino model:

error: : condition too complex, limit of 4 bytes + 12 bits of PHV input exceeded
if (a - b)>0){
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I have no clue of what’s causing this error, can anyone give some advice please?
Thanks in advance.

1 Like

For questions about Tofino and its P4 compiler and run time, if you are an academic member you should ask via a forum at the Intel Connectivity Research Program Advance Networking in the Intel® Connectivity Research Program

If you are a commercial Tofino user, you should ask via the support channels provided to you as a commercial user.

1 Like

it seems there is an error in your syntax, you are missing a parenthesis
maybe it should be:
if ( (a - b) > 0 ) {

}

1 Like