p4c icon indicating copy to clipboard operation
p4c copied to clipboard

Support non-field LHS in parser on BMv2

Open qobilidop opened this issue 1 year ago • 11 comments

Fixes #4194.

qobilidop avatar Oct 16 '23 08:10 qobilidop

@fruffy The failures seem to be P4Testgen related. Do you have an idea what might be the issue?

qobilidop avatar Oct 16 '23 22:10 qobilidop

This looks like a problem with the parserUnroll pass. P4Testgen uses it. That pass is unfortunately quite complex and I do not know it very well. This might be difficult to debug. You could add these failures to Xfails.

@VolodymyrPeschanenko Could you take a look if you have time? Maybe it is an easy fix.

fruffy avatar Oct 16 '23 22:10 fruffy

These are SIGSEGV, should be easy to diagnose and fix.

mihaibudiu avatar Oct 16 '23 22:10 mihaibudiu

These are SIGSEGV, should be easy to diagnose and fix.

Well the crash happens at here because it is trying to clone the constant of an uninitialized SymbolicInteger. Why that integer is uninitialized I am not sure.

fruffy avatar Oct 16 '23 22:10 fruffy

A SymbolicInteger does not have to have a constant value (otherwise it would be just a constant). If the constant value is nullptr then this function should probably just return, similar to the test two lines above.

mihaibudiu avatar Oct 16 '23 22:10 mihaibudiu

This looks like a problem with the parserUnroll pass. P4Testgen uses it. That pass is unfortunately quite complex and I do not know it very well. This might be difficult to debug. You could add these failures to Xfails.

@VolodymyrPeschanenko Could you take a look if you have time? Maybe it is an easy fix.

I'll see on it tomorrow.

The failing DPDK PTF test dpdk-ptf/testdata/p4_16_samples/pna-dpdk-add_on_miss0.p4 seems irrelevant to this PR.

qobilidop avatar Oct 17 '23 20:10 qobilidop

The failure is caused by instability in infrap4d. You can ignore it as this run is not required for merging.

fruffy avatar Oct 17 '23 20:10 fruffy

The encountered bug is covered in #4200.

fruffy avatar Oct 20 '23 12:10 fruffy

Is this ready to be merged?

fruffy avatar Oct 23 '23 12:10 fruffy

@antoninbas Could you help review the bmv2 backend changes? I guess you might have the most context here. Thanks!

qobilidop avatar Nov 06 '23 16:11 qobilidop