Fixing packet_io and regenerating default.p4 for tofino

Change-Id: I5c2c6565f71a13b375a8ec8da864e9157b8e56ed
diff --git a/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/logs/mau.tp.log b/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/logs/mau.tp.log
index 6608591..61320e1 100644
--- a/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/logs/mau.tp.log
+++ b/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/logs/mau.tp.log
@@ -1,35 +1,48 @@
 +---------------------------------------------------------------------+
 |  Log file: mau.tp.log                                               |
 |  Compiler version: 5.1.0 (fca32d1)                                  |
-|  Created on: Thu Sep  7 14:49:38 2017                               |
+|  Created on: Fri Sep  8 08:26:04 2017                               |
 +---------------------------------------------------------------------+
 
 ----- Stage 0 ------
    _condition_0
-   ingress_pkt
------ Stage 1 ------
-   _condition_1
+   process_packet_out_table
    table0
------ Stage 2 ------
+----- Stage 1 ------
    ecmp_group_table
------ Stage 3 ------
+----- Stage 2 ------
    _condition_2
    ingress_port_count_table
    egress_port_count_table
 ----- Stage 0 ------
-   _condition_3
-   egress_pkt
+   _condition_0
+   process_packet_out_table
+   table0
+----- Stage 1 ------
+   ecmp_group_table
+----- Stage 2 ------
+   _condition_2
+   ingress_port_count_table
+   egress_port_count_table
+----- Stage 0 ------
+   _condition_0
+   process_packet_out_table
+   table0
+----- Stage 1 ------
+   ecmp_group_table
+----- Stage 2 ------
+   _condition_2
+   ingress_port_count_table
+   egress_port_count_table
 ------------------------------------------
  Running Table Placement 4
 ------------------------------------------
 Cannot use hash action for table ingress_port_count_table.
-Cannot use hash-action for table ingress_port_count_table with no key because the number of entries required by side-effect table ingress_port_counter is not a power of 2 -- 254.
+Cannot use hash-action for table ingress_port_count_table with no key because the number of entries required by side-effect table ingress_port_counter is not a power of 2 -- 510.
 Cannot use hash action for table egress_port_count_table.
-Cannot use hash-action for table egress_port_count_table with no key because the number of entries required by side-effect table egress_port_counter is not a power of 2 -- 254.
-Cannot use hash action for table ingress_pkt.
-Table ingress_pkt has no side effect tables.
-Cannot use hash action for table egress_pkt.
-Table egress_pkt has no side effect tables.
+Cannot use hash-action for table egress_port_count_table with no key because the number of entries required by side-effect table egress_port_counter is not a power of 2 -- 510.
+Cannot use hash action for table process_packet_out_table.
+Table process_packet_out_table has no side effect tables.
 User requested to not attempt to place action data parameters in the match overhead.
 Cannot use hash action for table table0.
 Cannot use hash-action for table table0 because it requires a ternary-style match for field ig_intr_md.ingress_port.
@@ -38,68 +51,70 @@
 ------------------------------------------
  Table Groups
 ------------------------------------------
-Table Grouping (ingress) with match table ingress_port_count_table (1024) [ingress_port_count_table__action__ (1024), ingress_port_counter (254)]
-Table Grouping (ingress) with match table egress_port_count_table (1024) [egress_port_count_table__action__ (1024), egress_port_counter (254)]
-Table Grouping (ingress) with match table ingress_pkt (1024) [ingress_pkt__action__ (1024)]
-Table Grouping (egress) with match table egress_pkt (1024) [egress_pkt__action__ (1024)]
+Table Grouping (ingress) with match table ingress_port_count_table (1024) [ingress_port_count_table__action__ (1024), ingress_port_counter (510)]
+Table Grouping (ingress) with match table egress_port_count_table (1024) [egress_port_count_table__action__ (1024), egress_port_counter (510)]
+Table Grouping (ingress) with match table process_packet_out_table (1024) [process_packet_out_table__action__ (1024)]
 Table Grouping (ingress) with match table table0 (512) [table0__action__ (512), table0_counter (512)]
 Table Grouping (ingress) with match table ecmp_group_table (1024) [ecmp_group_table__action__ (1024), ecmp_group_table_counter (1024)]
 Table Grouping (ingress) with condition table _condition_0 (0) []
-Table Grouping (ingress) with condition table _condition_1 (0) []
 Table Grouping (ingress) with condition table _condition_2 (0) []
-Table Grouping (egress) with condition table _condition_3 (0) []
-Phase 0 possible?  False   Cannot implement ingress_pkt in phase 0 resources because table does not have the correct condition
+Phase 0 possible?  False   Cannot implement table0 in phase 0 resources because table uses side effect tables.
 ------------------------------------
   Starting placement pass 0
 ------------------------------------
 
 Nodes could place:
   _condition_0 (2)
->> choose Table Grouping (ingress) with match table ingress_pkt (1024) [ingress_pkt__action__ (1024)]
-Earliest stage can place: 0
-Placing table: ingress_pkt__action__ with 1024 entries
-Table ingress_pkt__action__ with 0 entries is directly referenced
-Match Table ingress_pkt has a total of 1 entries in stage 0
-  Direct mapped table ingress_pkt__action__ has 0 entries
->> set ingress_pkt (9) to placed
->> set _condition_0 (2) to placed
-
-Nodes could place:
-  _condition_1 (3)
 >> choose Table Grouping (ingress) with match table table0 (512) [table0__action__ (512), table0_counter (512)]
-Earliest stage can place: 1
+Earliest stage can place: 0
 Placing table: table0__action__ with 512 entries
 Placing table: table0_counter with 512 entries
 Table table0__action__ with 8192 entries is directly referenced
 Table table0_counter with 4096 entries is directly referenced
-Match Table table0 has a total of 512 entries in stage 1
+Match Table table0 has a total of 512 entries in stage 0
   Direct mapped table table0__action__ has 8192 entries
   Direct mapped table table0_counter has 4096 entries
 >> set table0 (7) to placed
->> set _condition_1 (3) to placed
+>> set _condition_0 (2) to placed
+
+Nodes could place:
+  process_packet_out_table (3)
+  ecmp_group_table (8)
+process_packet_out_table and _condition_0 not mutually exclusive
+  >> earliest stage can place Table Grouping (ingress) with match table process_packet_out_table (1024) [process_packet_out_table__action__ (1024)] is 0
+  >> earliest stage can place Table Grouping (ingress) with match table ecmp_group_table (1024) [ecmp_group_table__action__ (1024), ecmp_group_table_counter (1024)] is 1
+process_packet_out_table and _condition_0 not mutually exclusive
+>> choose Table Grouping (ingress) with match table process_packet_out_table (1024) [process_packet_out_table__action__ (1024)]
+Earliest stage can place: 0
+process_packet_out_table and _condition_0 not mutually exclusive
+Placing table: process_packet_out_table__action__ with 1024 entries
+Table process_packet_out_table__action__ with 0 entries is directly referenced
+Match Table process_packet_out_table has a total of 1 entries in stage 0
+  Direct mapped table process_packet_out_table__action__ has 0 entries
+>> set process_packet_out_table (3) to placed
 
 Nodes could place:
   ecmp_group_table (8)
 >> choose Table Grouping (ingress) with match table ecmp_group_table (1024) [ecmp_group_table__action__ (1024), ecmp_group_table_counter (1024)]
-Earliest stage can place: 2
+Earliest stage can place: 1
 Placing table: ecmp_group_table__action__ with 1024 entries
 Placing table: ecmp_group_table_counter with 1024 entries
 Table ecmp_group_table__action__ with 0 entries is directly referenced
 Table ecmp_group_table_counter with 4096 entries is directly referenced
-Match Table ecmp_group_table has a total of 3072 entries in stage 2
+Match Table ecmp_group_table has a total of 3072 entries in stage 1
   Direct mapped table ecmp_group_table__action__ has 0 entries
   Direct mapped table ecmp_group_table_counter has 4096 entries
 >> set ecmp_group_table (8) to placed
 
 Nodes could place:
   _condition_2 (4)
->> choose Table Grouping (ingress) with match table ingress_port_count_table (1024) [ingress_port_count_table__action__ (1024), ingress_port_counter (254)]
-Earliest stage can place: 3
+>> choose Table Grouping (ingress) with match table ingress_port_count_table (1024) [ingress_port_count_table__action__ (1024), ingress_port_counter (510)]
+Earliest stage can place: 2
 Placing table: ingress_port_count_table__action__ with 1024 entries
-Placing table: ingress_port_counter with 254 entries
+Placing table: ingress_port_counter with 510 entries
 Table ingress_port_count_table__action__ with 0 entries is directly referenced
 Table ingress_port_counter with 4096 entries is indirectly referenced
-Match Table ingress_port_count_table has a total of 1 entries in stage 3
+Match Table ingress_port_count_table has a total of 1 entries in stage 2
   Direct mapped table ingress_port_count_table__action__ has 0 entries
 >> set ingress_port_count_table (5) to placed
 >> set _condition_2 (4) to placed
@@ -108,43 +123,27 @@
   egress_port_count_table (6)
 egress_port_count_table and _condition_2 not mutually exclusive
 egress_port_count_table and ingress_port_count_table not mutually exclusive
->> choose Table Grouping (ingress) with match table egress_port_count_table (1024) [egress_port_count_table__action__ (1024), egress_port_counter (254)]
-Earliest stage can place: 3
+>> choose Table Grouping (ingress) with match table egress_port_count_table (1024) [egress_port_count_table__action__ (1024), egress_port_counter (510)]
+Earliest stage can place: 2
 egress_port_count_table and _condition_2 not mutually exclusive
 egress_port_count_table and ingress_port_count_table not mutually exclusive
 Placing table: egress_port_count_table__action__ with 1024 entries
-Placing table: egress_port_counter with 254 entries
+Placing table: egress_port_counter with 510 entries
 Table egress_port_count_table__action__ with 0 entries is directly referenced
 Table egress_port_counter with 4096 entries is indirectly referenced
-Match Table egress_port_count_table has a total of 1 entries in stage 3
+Match Table egress_port_count_table has a total of 1 entries in stage 2
   Direct mapped table egress_port_count_table__action__ has 0 entries
 >> set egress_port_count_table (6) to placed
-------------------------------------
-  Starting placement pass 1
-------------------------------------
-
-Nodes could place:
-  _condition_3 (2)
->> choose Table Grouping (egress) with match table egress_pkt (1024) [egress_pkt__action__ (1024)]
-Earliest stage can place: 0
-Placing table: egress_pkt__action__ with 1024 entries
-Table egress_pkt__action__ with 0 entries is directly referenced
-Match Table egress_pkt has a total of 1 entries in stage 0
-  Direct mapped table egress_pkt__action__ has 0 entries
->> set egress_pkt (3) to placed
->> set _condition_3 (2) to placed
 
 ------------------------------------------
  Logical Table IDs
 ------------------------------------------
 Logical Table IDs in stage 0 are:
-  0  :  ingress_pkt
-  1  :  egress_pkt
-Logical Table IDs in stage 1 are:
   0  :  table0
-Logical Table IDs in stage 2 are:
+  1  :  process_packet_out_table
+Logical Table IDs in stage 1 are:
   0  :  ecmp_group_table
-Logical Table IDs in stage 3 are:
+Logical Table IDs in stage 2 are:
   0  :  ingress_port_count_table
   1  :  egress_port_count_table
 
@@ -154,10 +153,8 @@
    count_ingress -> egress_port_count_table
 action mapping for egress_port_count_table
    count_egress -> --END_OF_PIPELINE--
-action mapping for ingress_pkt
-   _packet_out -> _condition_1
-action mapping for egress_pkt
-   add_packet_in_hdr -> --END_OF_PIPELINE--
+action mapping for process_packet_out_table
+   _process_packet_out -> _condition_2
 action mapping for table0
    set_egress_port -> _condition_2
    ecmp_group -> ecmp_group_table
@@ -166,14 +163,8 @@
 action mapping for ecmp_group_table
    set_egress_port -> _condition_2
 true/false mapping for _condition_0
-   False -> _condition_1
-   True -> ingress_pkt
-true/false mapping for _condition_1
-   False -> _condition_2
+   False -> process_packet_out_table
    True -> table0
 true/false mapping for _condition_2
    False -> --END_OF_PIPELINE--
    True -> ingress_port_count_table
-true/false mapping for _condition_3
-   False -> --END_OF_PIPELINE--
-   True -> egress_pkt