[P4] P4-16 parse hibák
Leskó Dániel
ldani at elte.hu
Tue Oct 10 15:22:30 CEST 2017
Szia!
Oké, akkor csak a memóriám nem a régi :)
A modell a VSS, a gyári p4c-s kódok közül való, a t4p4s readme-ben is
ez szerepel, mint 16-os példa.
Dani
2017.10.10. 14:58 keltezéssel, Brunner Márton írta:
> Szia!
>
> A parse errorok az elején voltak korábban is: ezt az okozza, hogy a
> P4_14-es hlir nem képes feldolgozni a P4_16-os forrásfájlt. Ezek csak
> akkor fognak eltűnni, ha már egyáltalán nem támaszkodunk a P4_14-es
> hlir-ra és kivesszük azt a fordításból.
>
> A középen levő warning csak a P4 fájl egy esetleges hibáját jelzi.
>
> A végén levő AssertionError pedig az én művem, de az szándékos, mivel
> jelenleg csak a v1model architektúra támogatott. (Ha gondolod azt
> kiveheted a hlir16/hlir16.py fájlból, de ahhoz, hogy ténylegesen
> helyes működést kaphass, az általad használt architectúrának
> megfelelően is módosítani kéne egy kicsit az adatgyűjtést.)
>
> Milyen architektúrát használsz? Esetleg megpróbálhatom a hlir16-ot úgy
> módosítani, hogy legalább az adatgyűjtés megfelelő legyen hozzá és az
> AssertionError ne jöjjön elő.
>
> Marci
>
> On Tuesday, October 10, 2017 14:39 CEST, Leskó Dániel <ldani at elte.hu>
> wrote:
>> Sziasztok!
>>
>> Minth korábban már kvázi gond nélkül ment volna a 16-os fáljok hlir
>> építése, de én most újra ilyeneket kapok:
>>
>> Esetleg az új t4p4s.sh okozhatja vagy szimplán csak rosszul emlékszem? :D
>>
>> ldani at ldani-HP-EliteBook-840-G1:~/Asztal/p4-git/t4p4s$ ./t4p4s.sh v16
>> $P4C/testdata/p4_16_samples/vss-example.p4
>> -------------------- Compiling P4-16 -> C
>> WARNING: No error rule is defined for exclusive state 'pragma'
>> WARNING: Token 'PPHASH' defined, but not used
>> WARNING: There is 1 unused token
>> parse error in file /home/ldani/Asztal/p4-git/p4c/p4include/core.p4 at
>> line 23 : Syntax error while parsing at token error (ID)
>> illegal character '@' in file
>> /home/ldani/Asztal/p4-git/p4c/p4include/core.p4 at line 67
>> illegal character '"' in file
>> /home/ldani/Asztal/p4-git/p4c/p4include/core.p4 at line 67
>> illegal character '"' in file
>> /home/ldani/Asztal/p4-git/p4c/p4include/core.p4 at line 67
>> parse error in file /home/ldani/Asztal/p4-git/p4c/p4include/core.p4 at
>> line 73 : Syntax error while parsing at token match_kind (ID)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 26
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 33
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 34
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 41
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 42
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 43
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 73 : Invalid P4 declaration: 'match_kind' in not a valid p4
>> object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 51 : Invalid parser function declaration
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/very_simple_model.p4
>> at line 61 : Error in control function
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 71 : Error in control function
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 30 : Invalid header instance declaration
>> illegal character '@' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 35
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 32 : Invalid P4 declaration: 'EthernetAddress' in not a valid p4
>> object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 38 : Invalid header instance declaration
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 40 : Invalid P4 declaration: 'bit' in not a valid p4 object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 68 : Invalid parser function declaration
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 77 : Invalid P4 declaration: '}' in not a valid p4 object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 93 : Error in control function
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 102 : Syntax error while parsing at token . (PERIOD)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 102
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 102 : Invalid action statement in action body
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 104 : Invalid P4 declaration: 'IPv4Address' in not a valid p4 object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 112 : Syntax error while parsing at token ipv4_dest (ID)
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 112 : Invalid param list for action function (
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 113
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 113 : Syntax error while parsing at token ipv4_dest (ID)
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 113 : Invalid action statement in action body
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 114
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 114 : Invalid action statement in action body
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 115
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 115 : Invalid action statement in action body
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 124 : Syntax error while parsing at token key (ID)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 124
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 123 : Invalid body for table declaration ipv4_match
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 125
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 130
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 131
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 125 : Invalid P4 declaration: 'actions' in not a valid p4 object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 138 : Syntax error while parsing at token . (PERIOD)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 138
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 138 : Invalid action statement in action body
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 144 : Syntax error while parsing at token key (ID)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 144
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 143 : Invalid body for table declaration check_ttl
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 145
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 146
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 145 : Invalid P4 declaration: 'actions' in not a valid p4 object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 153 : Syntax error while parsing at token dmac (ID)
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 153 : Invalid param list for action function (
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 154 : Syntax error while parsing at token . (PERIOD)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 154
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 154 : Invalid action statement in action body
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 160 : Syntax error while parsing at token key (ID)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 160
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 159 : Invalid body for table declaration dmac
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 161
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 165
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 166
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 161 : Invalid P4 declaration: 'actions' in not a valid p4 object
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 173 : Syntax error while parsing at token smac (ID)
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 173 : Invalid param list for action function (
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 174 : Syntax error while parsing at token . (PERIOD)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 174
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 174 : Invalid action statement in action body
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 180 : Syntax error while parsing at token key (ID)
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 180
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 179 : Invalid body for table declaration smac
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 181
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 185
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 186
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 181 : Invalid P4 declaration: 'actions' in not a valid p4 object
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 215
>> illegal character '=' in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 217
>> parse error in file
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4 at
>> line 209 : Error in control function
>> 79 errors during parsing
>> Interrupting compilation
>> /home/ldani/Asztal/p4-git/p4c//testdata/p4_16_samples/vss-example.p4(160):
>> warning: nextHop may be uninitialized
>> key = { nextHop : exact; }
>> ^^^^^^^
>> Traceback (most recent call last):
>> File "src/compiler.py", line 290, in <module>
>> main()
>> File "src/compiler.py", line 265, in main
>> success = load_file(args['p4_file'])
>> File "src/compiler.py", line 238, in load_file
>> hlir16 = load_p4(args['p4_file'], args['p4v'], args['p4c_path'])
>> File "/home/ldani/Asztal/p4-git/t4p4s/src/hlir16/hlir16.py", line
>> 502, in load_p4
>> return load_p4_json_file(json_filename, p4_version or
>> MOST_RECENT_P4_VERSION)
>> File "/home/ldani/Asztal/p4-git/t4p4s/src/hlir16/hlir16.py", line
>> 117, in load_p4_json_file
>> set_additional_attrs(hlir16, nodes, p4_version)
>> File "/home/ldani/Asztal/p4-git/t4p4s/src/hlir16/hlir16.py", line
>> 283, in set_additional_attrs
>> assert(False) #An unsupported P4 architecture is used!
>> AssertionError
>> Error: P4 to C compilation failed (error code: 1)
>>
>> _______________________________________________
>> P4 mailing list
>> P4 at plc.inf.elte.hu
>> https://plc.inf.elte.hu/mailman/listinfo/p4
>
More information about the P4
mailing list