blob: 3d059bb97845839bdb9a76e2160430292b558e59 [file] [log] [blame]
Carmelo Cascone770507f2017-09-14 20:58:04 +02001{
2 "program" : "main.p4",
3 "__meta__" : {
4 "version" : [2, 7],
5 "compiler" : "https://github.com/p4lang/p4c"
6 },
7 "header_types" : [
8 {
9 "name" : "scalars_0",
10 "id" : 0,
11 "fields" : [
12 ["tmp", 32, false],
13 ["tmp_0", 32, false]
14 ]
15 },
16 {
17 "name" : "ethernet_t",
18 "id" : 1,
19 "fields" : [
20 ["dst_addr", 48, false],
21 ["src_addr", 48, false],
22 ["ether_type", 16, false]
23 ]
24 },
25 {
26 "name" : "ipv4_t",
27 "id" : 2,
28 "fields" : [
29 ["version", 4, false],
30 ["ihl", 4, false],
31 ["diffserv", 8, false],
32 ["len", 16, false],
33 ["identification", 16, false],
34 ["flags", 3, false],
35 ["frag_offset", 13, false],
36 ["ttl", 8, false],
37 ["protocol", 8, false],
38 ["hdr_checksum", 16, false],
39 ["src_addr", 32, false],
40 ["dst_addr", 32, false]
41 ]
42 },
43 {
44 "name" : "packet_out_header_t",
45 "id" : 3,
46 "fields" : [
47 ["egress_port", 9, false],
48 ["_padding", 7, false]
49 ]
50 },
51 {
52 "name" : "packet_in_header_t",
53 "id" : 4,
54 "fields" : [
55 ["ingress_port", 9, false],
56 ["_padding_0", 7, false]
57 ]
58 },
59 {
60 "name" : "standard_metadata",
61 "id" : 5,
62 "fields" : [
63 ["ingress_port", 9, false],
64 ["egress_spec", 9, false],
65 ["egress_port", 9, false],
66 ["clone_spec", 32, false],
67 ["instance_type", 32, false],
68 ["drop", 1, false],
69 ["recirculate_port", 16, false],
70 ["packet_length", 32, false],
71 ["enq_timestamp", 32, false],
72 ["enq_qdepth", 19, false],
73 ["deq_timedelta", 32, false],
74 ["deq_qdepth", 19, false],
75 ["ingress_global_timestamp", 48, false],
76 ["lf_field_list", 32, false],
77 ["mcast_grp", 16, false],
78 ["resubmit_flag", 1, false],
79 ["egress_rid", 16, false],
80 ["_padding_1", 5, false]
81 ]
82 }
83 ],
84 "headers" : [
85 {
86 "name" : "scalars",
87 "id" : 0,
88 "header_type" : "scalars_0",
89 "metadata" : true,
90 "pi_omit" : true
91 },
92 {
93 "name" : "standard_metadata",
94 "id" : 1,
95 "header_type" : "standard_metadata",
96 "metadata" : true,
97 "pi_omit" : true
98 },
99 {
100 "name" : "ethernet",
101 "id" : 2,
102 "header_type" : "ethernet_t",
103 "metadata" : false,
104 "pi_omit" : true
105 },
106 {
107 "name" : "ipv4",
108 "id" : 3,
109 "header_type" : "ipv4_t",
110 "metadata" : false,
111 "pi_omit" : true
112 },
113 {
114 "name" : "packet_out",
115 "id" : 4,
116 "header_type" : "packet_out_header_t",
117 "metadata" : false,
118 "pi_omit" : true
119 },
120 {
121 "name" : "packet_in",
122 "id" : 5,
123 "header_type" : "packet_in_header_t",
124 "metadata" : false,
125 "pi_omit" : true
126 }
127 ],
128 "header_stacks" : [],
129 "header_union_types" : [],
130 "header_unions" : [],
131 "header_union_stacks" : [],
132 "field_lists" : [],
133 "errors" : [
134 ["NoError", 1],
135 ["PacketTooShort", 2],
136 ["NoMatch", 3],
137 ["StackOutOfBounds", 4],
138 ["HeaderTooShort", 5],
139 ["ParserTimeout", 6]
140 ],
141 "enums" : [],
142 "parsers" : [
143 {
144 "name" : "parser",
145 "id" : 0,
146 "init_state" : "start",
147 "parse_states" : [
148 {
149 "name" : "start",
150 "id" : 0,
151 "parser_ops" : [],
152 "transitions" : [
153 {
154 "value" : "0x00ff",
155 "mask" : null,
156 "next_state" : "parse_packet_out"
157 },
158 {
159 "value" : "default",
160 "mask" : null,
161 "next_state" : "parse_ethernet"
162 }
163 ],
164 "transition_key" : [
165 {
166 "type" : "field",
167 "value" : ["standard_metadata", "ingress_port"]
168 }
169 ]
170 },
171 {
172 "name" : "parse_packet_out",
173 "id" : 1,
174 "parser_ops" : [
175 {
176 "parameters" : [
177 {
178 "type" : "regular",
179 "value" : "packet_out"
180 }
181 ],
182 "op" : "extract"
183 }
184 ],
185 "transitions" : [
186 {
187 "value" : "default",
188 "mask" : null,
189 "next_state" : "parse_ethernet"
190 }
191 ],
192 "transition_key" : []
193 },
194 {
195 "name" : "parse_ethernet",
196 "id" : 2,
197 "parser_ops" : [
198 {
199 "parameters" : [
200 {
201 "type" : "regular",
202 "value" : "ethernet"
203 }
204 ],
205 "op" : "extract"
206 }
207 ],
208 "transitions" : [
209 {
210 "value" : "0x0800",
211 "mask" : null,
212 "next_state" : "parse_ipv4"
213 },
214 {
215 "value" : "default",
216 "mask" : null,
217 "next_state" : null
218 }
219 ],
220 "transition_key" : [
221 {
222 "type" : "field",
223 "value" : ["ethernet", "ether_type"]
224 }
225 ]
226 },
227 {
228 "name" : "parse_ipv4",
229 "id" : 3,
230 "parser_ops" : [
231 {
232 "parameters" : [
233 {
234 "type" : "regular",
235 "value" : "ipv4"
236 }
237 ],
238 "op" : "extract"
239 }
240 ],
241 "transitions" : [
242 {
243 "value" : "default",
244 "mask" : null,
245 "next_state" : null
246 }
247 ],
248 "transition_key" : []
249 }
250 ]
251 }
252 ],
253 "deparsers" : [
254 {
255 "name" : "deparser",
256 "id" : 0,
257 "source_info" : {
258 "filename" : "main.p4",
259 "line" : 264,
260 "column" : 8,
261 "source_fragment" : "DeparserImpl"
262 },
263 "order" : ["packet_in", "ethernet", "ipv4"]
264 }
265 ],
266 "meter_arrays" : [],
267 "counter_arrays" : [
268 {
269 "name" : "egr_port_counter",
270 "id" : 0,
271 "source_info" : {
272 "filename" : "main.p4",
273 "line" : 181,
274 "column" : 38,
275 "source_fragment" : "egr_port_counter"
276 },
277 "size" : 511,
278 "is_direct" : false
279 },
280 {
281 "name" : "igr_port_counter",
282 "id" : 1,
283 "source_info" : {
284 "filename" : "main.p4",
285 "line" : 182,
286 "column" : 38,
287 "source_fragment" : "igr_port_counter"
288 },
289 "size" : 511,
290 "is_direct" : false
291 }
292 ],
293 "register_arrays" : [],
294 "calculations" : [],
295 "learn_lists" : [],
296 "actions" : [
297 {
298 "name" : "NoAction",
299 "id" : 0,
300 "runtime_data" : [],
301 "primitives" : []
302 },
303 {
304 "name" : "send_to_cpu",
305 "id" : 1,
306 "runtime_data" : [],
307 "primitives" : [
308 {
309 "op" : "assign",
310 "parameters" : [
311 {
312 "type" : "field",
313 "value" : ["standard_metadata", "egress_spec"]
314 },
315 {
316 "type" : "hexstr",
317 "value" : "0x00ff"
318 }
319 ],
320 "source_info" : {
321 "filename" : "main.p4",
322 "line" : 24,
323 "column" : 24,
324 "source_fragment" : "255; ..."
325 }
326 },
327 {
328 "op" : "add_header",
329 "parameters" : [
330 {
331 "type" : "header",
332 "value" : "packet_in"
333 }
334 ],
335 "source_info" : {
336 "filename" : "main.p4",
337 "line" : 137,
338 "column" : 8,
339 "source_fragment" : "hdr.packet_in.setValid()"
340 }
341 },
342 {
343 "op" : "assign",
344 "parameters" : [
345 {
346 "type" : "field",
347 "value" : ["packet_in", "ingress_port"]
348 },
349 {
350 "type" : "field",
351 "value" : ["standard_metadata", "ingress_port"]
352 }
353 ],
354 "source_info" : {
355 "filename" : "main.p4",
356 "line" : 138,
357 "column" : 8,
358 "source_fragment" : "hdr.packet_in.ingress_port = standard_metadata.ingress_port"
359 }
360 }
361 ]
362 },
363 {
364 "name" : "set_egress_port",
365 "id" : 2,
366 "runtime_data" : [
367 {
368 "name" : "port",
369 "bitwidth" : 9
370 }
371 ],
372 "primitives" : [
373 {
374 "op" : "assign",
375 "parameters" : [
376 {
377 "type" : "field",
378 "value" : ["standard_metadata", "egress_spec"]
379 },
380 {
381 "type" : "runtime_data",
382 "value" : 0
383 }
384 ],
385 "source_info" : {
386 "filename" : "main.p4",
387 "line" : 142,
388 "column" : 8,
389 "source_fragment" : "standard_metadata.egress_spec = port"
390 }
391 }
392 ]
393 },
394 {
395 "name" : "_drop",
396 "id" : 3,
397 "runtime_data" : [],
398 "primitives" : [
399 {
400 "op" : "assign",
401 "parameters" : [
402 {
403 "type" : "field",
404 "value" : ["standard_metadata", "egress_spec"]
405 },
406 {
407 "type" : "hexstr",
408 "value" : "0x01ff"
409 }
410 ],
411 "source_info" : {
412 "filename" : "main.p4",
413 "line" : 25,
414 "column" : 25,
415 "source_fragment" : "511; ..."
416 }
417 }
418 ]
419 },
420 {
421 "name" : "_drop",
422 "id" : 4,
423 "runtime_data" : [],
424 "primitives" : [
425 {
426 "op" : "assign",
427 "parameters" : [
428 {
429 "type" : "field",
430 "value" : ["standard_metadata", "egress_spec"]
431 },
432 {
433 "type" : "hexstr",
434 "value" : "0x01ff"
435 }
436 ],
437 "source_info" : {
438 "filename" : "main.p4",
439 "line" : 25,
440 "column" : 25,
441 "source_fragment" : "511; ..."
442 }
443 }
444 ]
445 },
446 {
447 "name" : "act",
448 "id" : 5,
449 "runtime_data" : [],
450 "primitives" : [
451 {
452 "op" : "assign",
453 "parameters" : [
454 {
455 "type" : "field",
456 "value" : ["standard_metadata", "egress_spec"]
457 },
458 {
459 "type" : "field",
460 "value" : ["packet_out", "egress_port"]
461 }
462 ],
463 "source_info" : {
464 "filename" : "main.p4",
465 "line" : 195,
466 "column" : 12,
467 "source_fragment" : "standard_metadata.egress_spec = hdr.packet_out.egress_port"
468 }
469 },
470 {
471 "op" : "remove_header",
472 "parameters" : [
473 {
474 "type" : "header",
475 "value" : "packet_out"
476 }
477 ],
478 "source_info" : {
479 "filename" : "main.p4",
480 "line" : 196,
481 "column" : 12,
482 "source_fragment" : "hdr.packet_out.setInvalid()"
483 }
484 }
485 ]
486 },
487 {
488 "name" : "act_0",
489 "id" : 6,
490 "runtime_data" : [],
491 "primitives" : [
492 {
493 "op" : "assign",
494 "parameters" : [
495 {
496 "type" : "field",
497 "value" : ["scalars", "tmp"]
498 },
499 {
500 "type" : "expression",
501 "value" : {
502 "type" : "expression",
503 "value" : {
504 "op" : "&",
505 "left" : {
506 "type" : "field",
507 "value" : ["standard_metadata", "egress_spec"]
508 },
509 "right" : {
510 "type" : "hexstr",
511 "value" : "0xffffffff"
512 }
513 }
514 }
515 }
516 ]
517 },
518 {
519 "op" : "count",
520 "parameters" : [
521 {
522 "type" : "counter_array",
523 "value" : "egr_port_counter"
524 },
525 {
526 "type" : "field",
527 "value" : ["scalars", "tmp"]
528 }
529 ],
530 "source_info" : {
531 "filename" : "main.p4",
532 "line" : 218,
533 "column" : 12,
534 "source_fragment" : "egr_port_counter.count((bit<32>) standard_metadata.egress_spec)"
535 }
536 }
537 ]
538 },
539 {
540 "name" : "act_1",
541 "id" : 7,
542 "runtime_data" : [],
543 "primitives" : [
544 {
545 "op" : "assign",
546 "parameters" : [
547 {
548 "type" : "field",
549 "value" : ["scalars", "tmp_0"]
550 },
551 {
552 "type" : "expression",
553 "value" : {
554 "type" : "expression",
555 "value" : {
556 "op" : "&",
557 "left" : {
558 "type" : "field",
559 "value" : ["standard_metadata", "ingress_port"]
560 },
561 "right" : {
562 "type" : "hexstr",
563 "value" : "0xffffffff"
564 }
565 }
566 }
567 }
568 ]
569 },
570 {
571 "op" : "count",
572 "parameters" : [
573 {
574 "type" : "counter_array",
575 "value" : "igr_port_counter"
576 },
577 {
578 "type" : "field",
579 "value" : ["scalars", "tmp_0"]
580 }
581 ],
582 "source_info" : {
583 "filename" : "main.p4",
584 "line" : 221,
585 "column" : 12,
586 "source_fragment" : "igr_port_counter.count((bit<32>) standard_metadata.ingress_port)"
587 }
588 }
589 ]
590 }
591 ],
592 "pipelines" : [
593 {
594 "name" : "ingress",
595 "id" : 0,
596 "source_info" : {
597 "filename" : "main.p4",
598 "line" : 126,
599 "column" : 8,
600 "source_fragment" : "IngressImpl"
601 },
602 "init_table" : "node_2",
603 "tables" : [
604 {
605 "name" : "tbl_act",
606 "id" : 0,
607 "key" : [],
608 "match_type" : "exact",
609 "type" : "simple",
610 "max_size" : 1024,
611 "with_counters" : false,
612 "support_timeout" : false,
613 "direct_meters" : null,
614 "action_ids" : [5],
615 "actions" : ["act"],
616 "base_default_next" : "node_7",
617 "next_tables" : {
618 "act" : "node_7"
619 },
620 "default_entry" : {
621 "action_id" : 5,
622 "action_const" : true,
623 "action_data" : [],
624 "action_entry_const" : true
625 }
626 },
627 {
628 "name" : "table0",
629 "id" : 1,
630 "source_info" : {
631 "filename" : "main.p4",
632 "line" : 149,
633 "column" : 10,
634 "source_fragment" : "table0"
635 },
636 "key" : [
637 {
638 "match_type" : "ternary",
639 "target" : ["standard_metadata", "ingress_port"],
640 "mask" : null
641 },
642 {
643 "match_type" : "ternary",
644 "target" : ["ethernet", "dst_addr"],
645 "mask" : null
646 },
647 {
648 "match_type" : "ternary",
649 "target" : ["ethernet", "src_addr"],
650 "mask" : null
651 },
652 {
653 "match_type" : "ternary",
654 "target" : ["ethernet", "ether_type"],
655 "mask" : null
656 }
657 ],
658 "match_type" : "ternary",
659 "type" : "simple",
660 "max_size" : 1024,
661 "with_counters" : false,
662 "support_timeout" : false,
663 "direct_meters" : null,
664 "action_ids" : [2, 1, 3],
665 "actions" : ["set_egress_port", "send_to_cpu", "_drop"],
666 "base_default_next" : "node_7",
667 "next_tables" : {
668 "set_egress_port" : "node_5",
669 "send_to_cpu" : "node_7",
670 "_drop" : "node_7"
671 },
672 "default_entry" : {
673 "action_id" : 3,
674 "action_const" : false,
675 "action_data" : [],
676 "action_entry_const" : false
677 }
678 },
679 {
680 "name" : "ip_proto_filter_table",
681 "id" : 2,
682 "source_info" : {
683 "filename" : "main.p4",
684 "line" : 164,
685 "column" : 10,
686 "source_fragment" : "ip_proto_filter_table"
687 },
688 "key" : [
689 {
690 "match_type" : "ternary",
691 "target" : ["ipv4", "src_addr"],
692 "mask" : null
693 },
694 {
695 "match_type" : "exact",
696 "target" : ["ipv4", "protocol"],
697 "mask" : null
698 }
699 ],
700 "match_type" : "ternary",
701 "type" : "simple",
702 "max_size" : 1024,
703 "with_counters" : false,
704 "support_timeout" : false,
705 "direct_meters" : null,
706 "action_ids" : [4, 0],
707 "actions" : ["_drop", "NoAction"],
708 "base_default_next" : "node_7",
709 "next_tables" : {
710 "_drop" : "node_7",
711 "NoAction" : "node_7"
712 },
713 "default_entry" : {
714 "action_id" : 0,
715 "action_const" : false,
716 "action_data" : [],
717 "action_entry_const" : false
718 }
719 },
720 {
721 "name" : "tbl_act_0",
722 "id" : 3,
723 "key" : [],
724 "match_type" : "exact",
725 "type" : "simple",
726 "max_size" : 1024,
727 "with_counters" : false,
728 "support_timeout" : false,
729 "direct_meters" : null,
730 "action_ids" : [6],
731 "actions" : ["act_0"],
732 "base_default_next" : "node_9",
733 "next_tables" : {
734 "act_0" : "node_9"
735 },
736 "default_entry" : {
737 "action_id" : 6,
738 "action_const" : true,
739 "action_data" : [],
740 "action_entry_const" : true
741 }
742 },
743 {
744 "name" : "tbl_act_1",
745 "id" : 4,
746 "key" : [],
747 "match_type" : "exact",
748 "type" : "simple",
749 "max_size" : 1024,
750 "with_counters" : false,
751 "support_timeout" : false,
752 "direct_meters" : null,
753 "action_ids" : [7],
754 "actions" : ["act_1"],
755 "base_default_next" : null,
756 "next_tables" : {
757 "act_1" : null
758 },
759 "default_entry" : {
760 "action_id" : 7,
761 "action_const" : true,
762 "action_data" : [],
763 "action_entry_const" : true
764 }
765 }
766 ],
767 "action_profiles" : [],
768 "conditionals" : [
769 {
770 "name" : "node_2",
771 "id" : 0,
772 "source_info" : {
773 "filename" : "main.p4",
774 "line" : 188,
775 "column" : 12,
776 "source_fragment" : "standard_metadata.ingress_port == CPU_PORT"
777 },
778 "expression" : {
779 "type" : "expression",
780 "value" : {
781 "op" : "==",
782 "left" : {
783 "type" : "field",
784 "value" : ["standard_metadata", "ingress_port"]
785 },
786 "right" : {
787 "type" : "hexstr",
788 "value" : "0x00ff"
789 }
790 }
791 },
792 "true_next" : "tbl_act",
793 "false_next" : "table0"
794 },
795 {
796 "name" : "node_5",
797 "id" : 1,
798 "source_info" : {
799 "filename" : "main.p4",
800 "line" : 205,
801 "column" : 24,
802 "source_fragment" : "hdr.ipv4.isValid()"
803 },
804 "expression" : {
805 "type" : "expression",
806 "value" : {
807 "op" : "==",
808 "left" : {
809 "type" : "field",
810 "value" : ["ipv4", "$valid$"]
811 },
812 "right" : {
813 "type" : "hexstr",
814 "value" : "0x01"
815 }
816 }
817 },
818 "true_next" : "ip_proto_filter_table",
819 "false_next" : "node_7"
820 },
821 {
822 "name" : "node_7",
823 "id" : 2,
824 "source_info" : {
825 "filename" : "main.p4",
826 "line" : 217,
827 "column" : 12,
828 "source_fragment" : "standard_metadata.egress_spec < 511"
829 },
830 "expression" : {
831 "type" : "expression",
832 "value" : {
833 "op" : "<",
834 "left" : {
835 "type" : "field",
836 "value" : ["standard_metadata", "egress_spec"]
837 },
838 "right" : {
839 "type" : "hexstr",
840 "value" : "0x01ff"
841 }
842 }
843 },
844 "true_next" : "tbl_act_0",
845 "false_next" : "node_9"
846 },
847 {
848 "name" : "node_9",
849 "id" : 3,
850 "source_info" : {
851 "filename" : "main.p4",
852 "line" : 220,
853 "column" : 12,
854 "source_fragment" : "standard_metadata.ingress_port < 511"
855 },
856 "expression" : {
857 "type" : "expression",
858 "value" : {
859 "op" : "<",
860 "left" : {
861 "type" : "field",
862 "value" : ["standard_metadata", "ingress_port"]
863 },
864 "right" : {
865 "type" : "hexstr",
866 "value" : "0x01ff"
867 }
868 }
869 },
870 "false_next" : null,
871 "true_next" : "tbl_act_1"
872 }
873 ]
874 },
875 {
876 "name" : "egress",
877 "id" : 1,
878 "source_info" : {
879 "filename" : "main.p4",
880 "line" : 230,
881 "column" : 8,
882 "source_fragment" : "EgressImpl"
883 },
884 "init_table" : null,
885 "tables" : [],
886 "action_profiles" : [],
887 "conditionals" : []
888 }
889 ],
890 "checksums" : [],
891 "force_arith" : [],
892 "extern_instances" : [],
893 "field_aliases" : [
894 [
895 "queueing_metadata.enq_timestamp",
896 ["standard_metadata", "enq_timestamp"]
897 ],
898 [
899 "queueing_metadata.enq_qdepth",
900 ["standard_metadata", "enq_qdepth"]
901 ],
902 [
903 "queueing_metadata.deq_timedelta",
904 ["standard_metadata", "deq_timedelta"]
905 ],
906 [
907 "queueing_metadata.deq_qdepth",
908 ["standard_metadata", "deq_qdepth"]
909 ],
910 [
911 "intrinsic_metadata.ingress_global_timestamp",
912 ["standard_metadata", "ingress_global_timestamp"]
913 ],
914 [
915 "intrinsic_metadata.lf_field_list",
916 ["standard_metadata", "lf_field_list"]
917 ],
918 [
919 "intrinsic_metadata.mcast_grp",
920 ["standard_metadata", "mcast_grp"]
921 ],
922 [
923 "intrinsic_metadata.resubmit_flag",
924 ["standard_metadata", "resubmit_flag"]
925 ],
926 [
927 "intrinsic_metadata.egress_rid",
928 ["standard_metadata", "egress_rid"]
929 ]
930 ]
931}