Warnings - 2022.2 English

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Version
2022.2 English
Revision

A warning is displayed by the model when it detects a read or write access to a header field that is invalid:

Detected read access of field in an invalid header udp. In P4 this behaviour is undefined. You should modify your P4 program to eliminate this access

When this message is displayed, the behavior is unexpected, possibly leading to the behavioral model and RTL reading/writing different values. An example of P4 code that might create such a warning is:

meta.ipv4_version = hdr.ipv4.version

To avoid the warning occurring with the above code, the code could be modified as:

if (hdr.ipv4.isValid()) {
  meta.ipv4_version = hdr.ipv4.version;
} 

Another example of P4 code that might create such a warning is:

hdr.ipv4.version = 4;
hdr.ipv4.setValid();

To avoid the warning occurring with the above code, the code could be modified as:

hdr.ipv4.setValid();
hdr.ipv4.version = 4;