p4lang / p4-hlir

Apache License 2.0
32 stars 40 forks source link

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

Closed shouxi closed 8 years ago

shouxi commented 8 years ago

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

antoninbas commented 8 years ago

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

shouxi commented 8 years ago

Cheers!

shahbhoomi commented 8 years ago

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

shouxi commented 8 years ago

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.