Open mc36 opened 4 years ago
hi sorry for the spam... found out that header stack (a list with [x] in the header) is not supported by the compiler but i used it for the mpls headers.... for now, i've removed it from my code, but now, having a different error from the compiler:
root@df34ca928050:~/t4p4s# ./t4p4s.sh ./router.p4
[COMPILE P4-16] ./router.p4 @std
Exception: 'name'
Traceback (most recent call last):
File "src/compiler.py", line 315, in generate_code
exec(code, localvars, localvars)
File "
Error: P4 to C compilation failed (error code: 1) root@df34ca928050:~/t4p4s#
thanks, cs
just a last message regading the things, here is how you can reproduce this:
mc36@ubi16:~$ sudo docker run -i -t t4p4s /bin/bash root@90017edd5b73:~# wget freerouter.nop.hu/rtr.zip root@90017edd5b73:~# mv misc/p4lang/* t4p4s/ root@90017edd5b73:~# cd t4p4s root@90017edd5b73:~/t4p4s# ./t4p4s.sh ./router.p4 root@90017edd5b73:~/t4p4s# ./t4p4s.sh ./router.p4
Hi!
I've tried to compile your code and it failed for me as well, but with a different error. One of my colleagues who works on the compiler will have an answer to that issue soon.
The steps I did: 1, added the following line to examples.cfg: router @nic @l2 2, ./t4p4s.sh examples/router.p4
`Exception: 'is_metadata'
Traceback (most recent call last):
File "src/compiler.py", line 315, in generate_code
exec(code, localvars, localvars)
File "
Error: P4 to C compilation failed (error code: 1)`
hi, done a test not in the container but on the host and got the same error as you, so waiting for your findings! thanks in advance, cs
mc36@ubi16:~/t4p4s$ ./t4p4s.sh examples/router.p4
[COMPILE P4-16] examples/router.p4 @std
Exception: 'name'
Traceback (most recent call last):
File "src/compiler.py", line 315, in generate_code
exec(code, localvars, localvars)
File "
Error: P4 to C compilation failed (error code: 1) mc36@ubi16:~/t4p4s$
hi,
i'm maintaining a p4 router that fails to compile with p4elte but compiles with p4lang/p4c and with some platform specific modifications with barefoot/tofino. can you give me some advise on how to compile it with p4elte?
the sources can be found at http://sources.nop.hu/misc/p4lang/
here is the compiler output:
root@e586c8f1dda9:~/t4p4s# ./t4p4s.sh ./router.p4 [COMPILE P4-16] ./router.p4 @std Error during the compilation of None Traceback (most recent call last): File "src/compiler.py", line 471, in
main()
File "src/compiler.py", line 466, in main
print_with_backtrace(sys.exc_info(), current_compilation['from'] if current_compilation else "(no compiled file)")
File "src/compiler.py", line 452, in main
hlir = load_from_p4(args, cache_dir_name)
File "/root/t4p4s/src/compiler_load_p4.py", line 244, in load_from_p4
hlir = load_hlir(filename, cache_dir_name)
File "/root/t4p4s/src/compiler_load_p4.py", line 163, in load_hlir
return continue_stages(stages, stage_idx, data)
File "/root/t4p4s/src/compiler_load_p4.py", line 132, in continue_stages
new_data = loader(None, data)
File "/root/t4p4s/src/compiler_load_p4.py", line 167, in
return ([], lambda file, data: pickle.load(file) if file is not None else no_cache_loader(data) if data is not None else None)
File "/root/t4p4s/src/compiler_load_p4.py", line 204, in
'loaders': [cache_loader(lambda hlir: set_additional_attrs(hlir, args['p4v']))],
File "/root/t4p4s/src/hlir16/hlir16_attrs.py", line 883, in set_additional_attrs
attrfun(hlir16)
File "/root/t4p4s/src/hlir16/hlir16_attrs.py", line 516, in attrs_controls_tables
set_table_key_attrs(hlir16, table)
File "/root/t4p4s/src/hlir16/hlir16_attrs.py", line 423, in set_table_key_attrs
k.id = 'fieldinstance' + k.headername + '' + k.field_name
File "/root/t4p4s/src/hlir16/p4node.py", line 239, in getattr
return self.dict[key]
KeyError: 'header_name'
Error: P4 to C compilation failed (error code: 1) root@e586c8f1dda9:~/t4p4s#
thanks, csaba