P4ELTE / t4p4s

Retargetable compiler for the P4 language
http://p4.elte.hu/
Apache License 2.0
119 stars 42 forks source link

AttributeError: Key 'size' not found in #2550@Type_Name #53

Open VogelIBR opened 1 year ago

VogelIBR commented 1 year ago

When trying to run psa-example-hello-world.p4 using ./t4p4s.sh :psa-example-hello-world model=psa dbg lineno verbose nicon my_ports my_allow I get the following error:

Parsing variant config file examples.cfg
Parsing file opts_dpdk.cfg
Parse port is 49677
P4 version is 16 (by the extension of ./examples/psa-example-hello-world.p4 )
Using CC=clang-14, LD=lld-14, PYTHON3=python3.10, DBG=gdb
Options: ^silent,cfgfiles,cflags=-D__TARGET_PSA__ -DT4P4S_DEBUG=on -DT4P4S_DEBUG_LINENO,choice=psa-example-hello-world@std,cmdopts=-p 0x3 --config "\"(0,0,0)\"",ealopts=-a 0000:41:00.0,example=psa-example-hello-world,executable=./build/last/build/psa-example-hello-world,include-hdrs=dpdk_nicon.h gen_model.h,include-srcs=hdep/'dpdk/dpdk_nicon.c' xtrn/'dpdk_model_psa.c' xtrn/'dpdkx_psa_checksum.c' xtrn/'dpdkx_psa_clone.c' xtrn/'dpdkx_psa_digest.c' xtrn/'dpdkx_psa_hash.c' xtrn/'dpdkx_psa_random.c' xtrn/'dpdkx_psa_smem.c' xtrn/'dpdkx_psa_digest.c',light=green,yellow,cyan,red,meson_opts,model=psa,p4opts=--p4incdir=examples/include --p4opt=__TARGET_PSA__ --p4opt=USE_PSA,source=./examples/psa-example-hello-world.p4,variant=std,vsn=16,c,dbg,lineno,my_allow,my_ports,nicon,p4,run,verbose,
Requesting root access...
Root access granted, starting...
[NO  CONTROLLER]
[COMPILE  P4-16] ./examples/psa-example-hello-world.p4 @std, debug mode, model psa
P4 compiler options : --p4incdir=examples/include --p4opt=__TARGET_PSA__ --p4opt=USE_PSA ./examples/psa-example-hello-world.p4 --p4v 16 -g ./build/last/srcgen -verbose 
HLIR (cached: stage hlir_add_attributes) build/last/cache/psa-example-hello-world.p4.hlir.attributed.cached
Error during the compilation of ? to ./build/last/srcgen/multi_actions.c
Traceback (Most recent call first):
AttributeError: Key 'size' not found in #2550@Type_Name
599  src/hlir16/p4node.py              __getattr__                         --> raise AttributeError(f"Key '{key}' not found in #{self.Node_ID}@{self.node_type}")                                                                                        
1090 src/utils/codegen.py              gen_fmt_Cast                        --> elif (dstt.node_type, srct.node_type, srct.size) == ('Type_Boolean', 'Type_Bits', 1) and not srct.isSigned: ## src/utils/codegen.sugar.py:952                             
1869 src/utils/codegen.py              gen_format_expr                     --> generated_code += case(e, format_as_value, expand_parameters, needs_variable, funname_override) ## src/utils/codegen.sugar.py:1673                                        
2046 src/utils/codegen.py              format_expr                         --> return gen_format_expr(e, format_as_value, expand_parameters, needs_variable, funname_override) ## src/utils/codegen.sugar.py:1840                                        
332  src/utils/codegen.py              gen_format_statement_fieldref_short --> generated_code += add_code(' uint{}_t {} = {};'.format(bitlen, varname, format_expr(src)), lineno = 268)                                                                  
360  src/utils/codegen.py              gen_format_statement_fieldref       --> generated_code += gen_format_statement_fieldref_short(dst, src, dst_width, dst_is_vw, dst_bytewidth, dst_name, dst_hdrname, dst_fldname) ## src/utils/codegen.sugar.py:293
532  src/utils/codegen.py              gen_format_statement                --> generated_code += gen_format_statement_fieldref(dst, src) ## src/utils/codegen.sugar.py:459                                                                               
2060 src/utils/codegen.py              format_statement                    --> ret = gen_format_statement(stmt, ctl) ## src/utils/codegen.sugar.py:1854                                                                                                  
114  build/last/gen/multi_actions.c.py <module>                            --> code = format_statement(stmt, ctl) ## src/hardware_indep/multi_actions.c.py:60                                                                                            
390  src/compiler.py                   generate_code                       --> exec(compile(code, module_name, 'exec'), localvars, localvars)                                                                                                            
418  src/compiler.py                   output_desugared_c                  --> code = generate_code(filepath, outpyfile, {'hlir': hlir})                                                                                                                 
442  src/compiler.py                   generate_desugared_c                --> is_multicompiled = output_desugared_c(filename, filepath, 0)                                                                                                              
549  src/compiler.py                   generate_files                      --> generate_desugared_c(filename, os.path.join(base, filename))                                                                                                              
560  src/compiler.py                   main                                --> generate_files()                                                                                                                                                          

What is size in this context? There is no size in the hello world file. Is it related to the register/ActionProfile/ActionSelector for the psa target?