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/visualization/table_placement.html b/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/visualization/table_placement.html
index 21a44b4..9ea46b3 100644
--- a/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/visualization/table_placement.html
+++ b/tools/test/p4src/p4-14/p4c-out/tofino/ecmp/montara/visualization/table_placement.html
@@ -4,10 +4,13 @@
 
 <h2>Pipeline 0</h2>
 <svg viewBox="0 0 1280 800" preserveAspectRatio="xmlMidYMid meet">
-<rect x="0" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
-<rect x="13" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
-<rect x="26" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
-<rect x="39" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
+<rect x="0" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:aquamarine""><title>SRAM for table0__action__</title></rect>
+<rect x="0" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:blue""><title>TCAM for table0</title></rect>
+<rect x="13" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:blue""><title>TCAM for table0</title></rect>
+<rect x="26" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:blue""><title>TCAM for table0</title></rect>
+<rect x="13" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:blue""><title>SRAM for table0</title></rect>
+<rect x="26" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:blueviolet""><title>SRAM for table0_counter</title></rect>
+<rect x="39" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:blueviolet""><title>SRAM for table0_counter</title></rect>
 <rect x="52" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="65" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="78" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
@@ -84,9 +87,6 @@
 <rect x="65" y="143" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="78" y="143" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="91" y="143" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
-<rect x="0" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
-<rect x="13" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
-<rect x="26" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="39" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="52" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="65" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
@@ -110,14 +110,11 @@
 <rect x="91" y="195" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="0" y="26" width="104" height="182" style="stroke:black; stroke-width:2; fill:none""></rect>
 <text x="41" y="245" textLength="24" lengthAdjust="spacingAndGlyphs" textHeight="24" heightAdjust="spacingAndGlyphs" style="fill:black;">0</text>
-<rect x="117" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:blueviolet""><title>SRAM for table0__action__</title></rect>
-<rect x="117" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:yellow""><title>TCAM for table0</title></rect>
-<rect x="130" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:yellow""><title>TCAM for table0</title></rect>
-<rect x="143" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:yellow""><title>TCAM for table0</title></rect>
-<rect x="130" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:yellow""><title>SRAM for table0</title></rect>
-<rect x="143" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:burlywood""><title>SRAM for table0_counter</title></rect>
-<rect x="156" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:burlywood""><title>SRAM for table0_counter</title></rect>
-<rect x="169" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
+<rect x="117" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chartreuse""><title>SRAM for ecmp_group_table</title></rect>
+<rect x="130" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chartreuse""><title>SRAM for ecmp_group_table</title></rect>
+<rect x="143" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chartreuse""><title>SRAM for ecmp_group_table</title></rect>
+<rect x="156" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chocolate""><title>SRAM for ecmp_group_table_counter</title></rect>
+<rect x="169" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chocolate""><title>SRAM for ecmp_group_table_counter</title></rect>
 <rect x="182" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="195" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="208" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
@@ -193,6 +190,9 @@
 <rect x="182" y="143" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="195" y="143" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="208" y="143" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
+<rect x="117" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
+<rect x="130" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
+<rect x="143" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="156" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="169" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="182" y="169" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
@@ -216,11 +216,11 @@
 <rect x="208" y="195" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="117" y="26" width="104" height="182" style="stroke:black; stroke-width:2; fill:none""></rect>
 <text x="158" y="245" textLength="24" lengthAdjust="spacingAndGlyphs" textHeight="24" heightAdjust="spacingAndGlyphs" style="fill:black;">1</text>
-<rect x="234" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chartreuse""><title>SRAM for ecmp_group_table</title></rect>
-<rect x="247" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chartreuse""><title>SRAM for ecmp_group_table</title></rect>
-<rect x="260" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chartreuse""><title>SRAM for ecmp_group_table</title></rect>
-<rect x="273" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chocolate""><title>SRAM for ecmp_group_table_counter</title></rect>
-<rect x="286" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:chocolate""><title>SRAM for ecmp_group_table_counter</title></rect>
+<rect x="234" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:crimson""><title>SRAM for ingress_port_counter</title></rect>
+<rect x="247" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:crimson""><title>SRAM for ingress_port_counter</title></rect>
+<rect x="260" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:cyan""><title>SRAM for egress_port_counter</title></rect>
+<rect x="273" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:cyan""><title>SRAM for egress_port_counter</title></rect>
+<rect x="286" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="299" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="312" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="325" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
@@ -322,10 +322,10 @@
 <rect x="325" y="195" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>TCAM</title></rect>
 <rect x="234" y="26" width="104" height="182" style="stroke:black; stroke-width:2; fill:none""></rect>
 <text x="275" y="245" textLength="24" lengthAdjust="spacingAndGlyphs" textHeight="24" heightAdjust="spacingAndGlyphs" style="fill:black;">2</text>
-<rect x="351" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:crimson""><title>SRAM for ingress_port_counter</title></rect>
-<rect x="364" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:crimson""><title>SRAM for ingress_port_counter</title></rect>
-<rect x="377" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:cyan""><title>SRAM for egress_port_counter</title></rect>
-<rect x="390" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:cyan""><title>SRAM for egress_port_counter</title></rect>
+<rect x="351" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
+<rect x="364" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
+<rect x="377" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
+<rect x="390" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="403" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="416" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
 <rect x="429" y="26" width="13" height="13" style="stroke:black; stroke-width:1; fill:white""><title>SRAM</title></rect>
@@ -1277,23 +1277,22 @@
 <rect x="585" y="260" width="104" height="182" style="stroke:black; stroke-width:2; fill:none""></rect>
 <text x="626" y="479" textLength="24" lengthAdjust="spacingAndGlyphs" textHeight="24" heightAdjust="spacingAndGlyphs" style="fill:black;">11</text>
 <text x="834" y="89"   style="fill:black; font-weight:bold;">Legend</text>
-<text x="860" y="128"   style="fill:black; font-weight:bold;">Ingress Tables</text>
-<rect x="832" y="143" width="26" height="26" style="stroke:black; stroke-width:1; fill:chartreuse""><title>ecmp_group_table</title></rect>
-<text x="860" y="167"   style="fill:black;">ecmp_group_table</text>
-<rect x="832" y="182" width="26" height="26" style="stroke:black; stroke-width:1; fill:chocolate""><title>ecmp_group_table_counter</title></rect>
-<text x="860" y="206"   style="fill:black;">ecmp_group_table_counter</text>
-<rect x="832" y="221" width="26" height="26" style="stroke:black; stroke-width:1; fill:cyan""><title>egress_port_counter</title></rect>
-<text x="860" y="245"   style="fill:black;">egress_port_counter</text>
-<rect x="832" y="260" width="26" height="26" style="stroke:black; stroke-width:1; fill:crimson""><title>ingress_port_counter</title></rect>
-<text x="860" y="284"   style="fill:black;">ingress_port_counter</text>
-<rect x="832" y="299" width="26" height="26" style="stroke:black; stroke-width:1; fill:yellow""><title>table0</title></rect>
-<text x="860" y="323"   style="fill:black;">table0</text>
-<rect x="832" y="338" width="26" height="26" style="stroke:black; stroke-width:1; fill:blueviolet""><title>table0__action__</title></rect>
-<text x="860" y="362"   style="fill:black;">table0__action__</text>
-<rect x="832" y="377" width="26" height="26" style="stroke:black; stroke-width:1; fill:burlywood""><title>table0_counter</title></rect>
-<text x="860" y="401"   style="fill:black;">table0_counter</text>
-<rect x="806" y="39" width="390" height="403" style="stroke:black; stroke-width:1; fill:none""></rect>
-<rect x="819" y="52" width="364" height="377" style="stroke:black; stroke-width:1; fill:none""></rect>
+<rect x="832" y="104" width="26" height="26" style="stroke:black; stroke-width:1; fill:chartreuse""><title>ecmp_group_table</title></rect>
+<text x="860" y="128"   style="fill:black;">ecmp_group_table</text>
+<rect x="832" y="143" width="26" height="26" style="stroke:black; stroke-width:1; fill:chocolate""><title>ecmp_group_table_counter</title></rect>
+<text x="860" y="167"   style="fill:black;">ecmp_group_table_counter</text>
+<rect x="832" y="182" width="26" height="26" style="stroke:black; stroke-width:1; fill:cyan""><title>egress_port_counter</title></rect>
+<text x="860" y="206"   style="fill:black;">egress_port_counter</text>
+<rect x="832" y="221" width="26" height="26" style="stroke:black; stroke-width:1; fill:crimson""><title>ingress_port_counter</title></rect>
+<text x="860" y="245"   style="fill:black;">ingress_port_counter</text>
+<rect x="832" y="260" width="26" height="26" style="stroke:black; stroke-width:1; fill:blue""><title>table0</title></rect>
+<text x="860" y="284"   style="fill:black;">table0</text>
+<rect x="832" y="299" width="26" height="26" style="stroke:black; stroke-width:1; fill:aquamarine""><title>table0__action__</title></rect>
+<text x="860" y="323"   style="fill:black;">table0__action__</text>
+<rect x="832" y="338" width="26" height="26" style="stroke:black; stroke-width:1; fill:blueviolet""><title>table0_counter</title></rect>
+<text x="860" y="362"   style="fill:black;">table0_counter</text>
+<rect x="806" y="39" width="390" height="364" style="stroke:black; stroke-width:1; fill:none""></rect>
+<rect x="819" y="52" width="364" height="338" style="stroke:black; stroke-width:1; fill:none""></rect>
 <rect x="0" y="0" width="754" height="728" style="stroke:black; stroke-width:2; fill:none""></rect>
 </svg><br>
 <table border="1">
@@ -1322,19 +1321,7 @@
 <td align="center">0</td>
 </tr>
 <tr>
-<td align="center">_condition_3</td>
-<td align="center">0</td>
-<td align="center">1</td>
-<td align="center">1</td>
-<td align="center">1</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-</tr>
-<tr>
-<td align="center">ingress_pkt__action__</td>
+<td align="center">process_packet_out_table__action__</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1346,56 +1333,20 @@
 <td align="center">0</td>
 </tr>
 <tr>
-<td align="center">ingress_pkt</td>
+<td align="center">process_packet_out_table</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">1</td>
-</tr>
-<tr>
-<td align="center">egress_pkt__action__</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-</tr>
-<tr>
-<td align="center">egress_pkt</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">0</td>
-<td align="center">1</td>
-</tr>
-<tr>
-<td align="center">_condition_1</td>
-<td align="center">1</td>
-<td align="center">1</td>
-<td align="center">1</td>
 <td align="center">1</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
-<td align="center">0</td>
+<td align="center">1</td>
 </tr>
 <tr>
 <td align="center">table0__action__</td>
-<td align="center">1</td>
+<td align="center">0</td>
 <td align="center">12</td>
 <td align="center">1</td>
 <td align="center">0</td>
@@ -1407,7 +1358,7 @@
 </tr>
 <tr>
 <td align="center">table0</td>
-<td align="center">1</td>
+<td align="center">0</td>
 <td align="center">16</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1419,7 +1370,7 @@
 </tr>
 <tr>
 <td align="center">table0_counter</td>
-<td align="center">1</td>
+<td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1431,7 +1382,7 @@
 </tr>
 <tr>
 <td align="center">ecmp_group_table__action__</td>
-<td align="center">2</td>
+<td align="center">1</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1443,7 +1394,7 @@
 </tr>
 <tr>
 <td align="center">ecmp_group_table</td>
-<td align="center">2</td>
+<td align="center">1</td>
 <td align="center">4</td>
 <td align="center">30</td>
 <td align="center">0</td>
@@ -1455,7 +1406,7 @@
 </tr>
 <tr>
 <td align="center">ecmp_group_table_counter</td>
-<td align="center">2</td>
+<td align="center">1</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1467,7 +1418,7 @@
 </tr>
 <tr>
 <td align="center">_condition_2</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">2</td>
 <td align="center">9</td>
 <td align="center">1</td>
@@ -1479,7 +1430,7 @@
 </tr>
 <tr>
 <td align="center">ingress_port_count_table__action__</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1491,7 +1442,7 @@
 </tr>
 <tr>
 <td align="center">ingress_port_count_table</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1503,7 +1454,7 @@
 </tr>
 <tr>
 <td align="center">egress_port_count_table__action__</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1515,7 +1466,7 @@
 </tr>
 <tr>
 <td align="center">egress_port_count_table</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">1</td>
@@ -1527,7 +1478,7 @@
 </tr>
 <tr>
 <td align="center">ingress_port_counter</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1539,7 +1490,7 @@
 </tr>
 <tr>
 <td align="center">egress_port_counter</td>
-<td align="center">3</td>
+<td align="center">2</td>
 <td align="center">0</td>
 <td align="center">0</td>
 <td align="center">0</td>
@@ -1550,7 +1501,7 @@
 <td align="center">0</td>
 </tr>
 </table>
-<br><i>Created on Thu Sep  7 14:49:56 2017</i>
+<br><i>Created on Fri Sep  8 08:26:21 2017</i>
 <br><i>Compiler version: 5.1.0 (fca32d1)</i>
 </body>
 </html>
\ No newline at end of file