p4lang/p4-hlir

p4-hlir v1.1 reports ``Semantic error'' when checking the semantic of field_list.

Closed this issue · 4 comments

The tutorial of copy_to_cpu is a showcase. (See copy_to_cpu.p4.txt for the v1.1-compatible p4 code). p4c_bm would report:

Semantic error: : In file ***: invalid entry of type 'metadata standard_metadata_t' in field list
1 errors during semantic checking
Interrupting compilation
Error while building HLIR

Hi Shouxi,
Thanks for reporting this, it was fixed in 07cb759

Cheers!

Hi I am getting this same error while compiling my program. I am very new and so just trying to figure out the reason. Can you please tell me what does this error mean. Can you please tell me what causes this error? I tried searching but this is the only link which shows my exact error.

hlir

Hi @shahbhoomi, as is reported

Semantic error: P4 program does not define a start parse state

It seems that your P4 program has not specified the start function for parsing.
According to the P4 spec (see 17.1 Programming Conventions, v1.1),

Parsing begins with the parser state function named start.

you definitely should add it. Refer to this as an example.