Various fixes to get a P4Runtime demo that works

Change-Id: Icab512fceeb6ec0faf1b402c1e325e055cdb2caf
diff --git a/apps/p4runtime-test/src/test/java/org/onosproject/p4runtime/test/P4RuntimeTest.java b/apps/p4runtime-test/src/test/java/org/onosproject/p4runtime/test/P4RuntimeTest.java
index e7447d9..6e9f4a2 100644
--- a/apps/p4runtime-test/src/test/java/org/onosproject/p4runtime/test/P4RuntimeTest.java
+++ b/apps/p4runtime-test/src/test/java/org/onosproject/p4runtime/test/P4RuntimeTest.java
@@ -16,6 +16,7 @@
 
 package org.onosproject.p4runtime.test;
 
+import com.google.common.collect.Lists;
 import io.grpc.ManagedChannelBuilder;
 import io.grpc.netty.NettyChannelBuilder;
 import org.junit.Before;
@@ -30,10 +31,19 @@
 import org.onosproject.net.pi.model.PiPipeconf;
 import org.onosproject.net.pi.model.PiPipeconfId;
 import org.onosproject.net.pi.model.PiPipelineInterpreter;
+import org.onosproject.net.pi.runtime.PiAction;
+import org.onosproject.net.pi.runtime.PiActionId;
+import org.onosproject.net.pi.runtime.PiActionParam;
+import org.onosproject.net.pi.runtime.PiActionParamId;
+import org.onosproject.net.pi.runtime.PiHeaderFieldId;
+import org.onosproject.net.pi.runtime.PiMatchKey;
 import org.onosproject.net.pi.runtime.PiPacketMetadata;
 import org.onosproject.net.pi.runtime.PiPacketMetadataId;
 import org.onosproject.net.pi.runtime.PiPacketOperation;
+import org.onosproject.net.pi.runtime.PiTableEntry;
 import org.onosproject.net.pi.runtime.PiTableId;
+import org.onosproject.net.pi.runtime.PiTernaryFieldMatch;
+import org.onosproject.p4runtime.api.P4RuntimeClient;
 import org.onosproject.p4runtime.ctl.P4RuntimeClientImpl;
 import org.onosproject.p4runtime.ctl.P4RuntimeControllerImpl;
 import p4.P4RuntimeGrpc;
@@ -42,7 +52,7 @@
 import java.net.URL;
 import java.util.concurrent.ExecutionException;
 
-import static org.onlab.util.ImmutableByteSequence.copyFrom;
+import static org.onlab.util.ImmutableByteSequence.*;
 import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.BMV2_JSON;
 import static org.onosproject.net.pi.model.PiPipeconf.ExtensionType.P4_INFO_TEXT;
 import static org.onosproject.net.pi.runtime.PiPacketOperation.Type.PACKET_OUT;
@@ -55,7 +65,17 @@
 public class P4RuntimeTest {
 
     private static final String GRPC_SERVER_ADDR = "192.168.56.102";
-    private static final int GRPC_SERVER_PORT = 55001;
+    private static final int GRPC_SERVER_PORT = 55044;
+
+    private static final String TABLE_0 = "table0";
+    private static final String SET_EGRESS_PORT = "set_egress_port";
+    private static final String PORT = "port";
+    private static final String ETHERNET = "ethernet";
+    private static final String DST_ADDR = "dstAddr";
+    private static final String SRC_ADDR = "srcAddr";
+    private static final String STANDARD_METADATA = "standard_metadata";
+    private static final String INGRESS_PORT = "ingress_port";
+    private static final String ETHER_TYPE = "etherType";
 
     private final URL p4InfoUrl = this.getClass().getResource("/bmv2/default.p4info");
     private final URL jsonUrl = this.getClass().getResource("/bmv2/default.json");
@@ -75,6 +95,37 @@
             .usePlaintext(true);
     private P4RuntimeClientImpl client;
 
+    private final ImmutableByteSequence ethAddr = fit(copyFrom(1), 48);
+    private final ImmutableByteSequence portValue = copyFrom((short) 1);
+    private final PiHeaderFieldId ethDstAddrFieldId = PiHeaderFieldId.of(ETHERNET, DST_ADDR);
+    private final PiHeaderFieldId ethSrcAddrFieldId = PiHeaderFieldId.of(ETHERNET, SRC_ADDR);
+    private final PiHeaderFieldId inPortFieldId = PiHeaderFieldId.of(STANDARD_METADATA, INGRESS_PORT);
+    private final PiHeaderFieldId ethTypeFieldId = PiHeaderFieldId.of(ETHERNET, ETHER_TYPE);
+    private final PiActionParamId portParamId = PiActionParamId.of(PORT);
+    private final PiActionId outActionId = PiActionId.of(SET_EGRESS_PORT);
+    private final PiTableId tableId = PiTableId.of(TABLE_0);
+
+    private final PiTableEntry piTableEntry = PiTableEntry
+            .builder()
+            .forTable(tableId)
+            .withMatchKey(PiMatchKey.builder()
+                                  .addFieldMatch(new PiTernaryFieldMatch(ethDstAddrFieldId, ethAddr, ofZeros(6)))
+                                  .addFieldMatch(new PiTernaryFieldMatch(ethSrcAddrFieldId, ethAddr, ofZeros(6)))
+                                  .addFieldMatch(new PiTernaryFieldMatch(inPortFieldId, portValue, ofZeros(2)))
+                                  .addFieldMatch(new PiTernaryFieldMatch(ethTypeFieldId, portValue, ofZeros(2)))
+                                  .build())
+            .withAction(PiAction
+                                .builder()
+                                .withId(outActionId)
+                                .withParameter(new PiActionParam(portParamId, portValue))
+                                .build())
+            .withPriority(1)
+            .withCookie(2)
+            .build();
+
+    public P4RuntimeTest() throws ImmutableByteSequence.ByteSequenceTrimException {
+    }
+
     @Before
     public void setUp() throws Exception {
         controller.grpcController = grpcController;
@@ -82,13 +133,18 @@
         grpcController.activate();
     }
 
-    private void createClientAndSetPipelineConfig(PiPipeconf pipeconf, PiPipeconf.ExtensionType extensionType)
+    private void createClient()
             throws ExecutionException, InterruptedException, PiPipelineInterpreter.PiInterpreterException,
             IllegalAccessException, InstantiationException {
 
         assert (controller.createClient(deviceId, 1, channelBuilder));
 
         client = (P4RuntimeClientImpl) controller.getClient(deviceId);
+    }
+
+    private void setPipelineConfig(PiPipeconf pipeconf, PiPipeconf.ExtensionType extensionType)
+            throws ExecutionException, InterruptedException, PiPipelineInterpreter.PiInterpreterException,
+            IllegalAccessException, InstantiationException {
 
         assert (client.setPipelineConfig(pipeconf, extensionType).get());
         assert (client.initStreamChannel().get());
@@ -100,7 +156,7 @@
 
         P4RuntimeOuterClass.ActionProfileMember profileMemberMsg = P4RuntimeOuterClass.ActionProfileMember.newBuilder()
                 .setActionProfileId(actionProfileId)
-                // .setMemberId(1)
+                .setMemberId(1)
                 .setAction(P4RuntimeOuterClass.Action.newBuilder()
                                    .setActionId(16793508)
                                    .build())
@@ -111,10 +167,10 @@
                 .setGroupId(1)
                 .setType(SELECT)
                 .addMembers(P4RuntimeOuterClass.ActionProfileGroup.Member.newBuilder()
-                                    .setMemberId(0)
+                                    .setMemberId(1)
                                     .setWeight(1)
                                     .build())
-                .setMaxSize(1)
+                .setMaxSize(3)
                 .build();
 
         P4RuntimeOuterClass.WriteRequest writeRequest = P4RuntimeOuterClass.WriteRequest.newBuilder()
@@ -122,13 +178,13 @@
                 .addUpdates(P4RuntimeOuterClass.Update.newBuilder()
                                     .setType(INSERT)
                                     .setEntity(P4RuntimeOuterClass.Entity.newBuilder()
-                                                       .setActionProfileMember(profileMemberMsg)
+                                                       .setActionProfileGroup(groupMsg)
                                                        .build())
                                     .build())
                 .addUpdates(P4RuntimeOuterClass.Update.newBuilder()
                                     .setType(INSERT)
                                     .setEntity(P4RuntimeOuterClass.Entity.newBuilder()
-                                                       .setActionProfileGroup(groupMsg)
+                                                       .setActionProfileMember(profileMemberMsg)
                                                        .build())
                                     .build())
                 .build();
@@ -136,44 +192,58 @@
         stub.write(writeRequest);
     }
 
-    private void testPacketIo() throws IllegalAccessException, InstantiationException, ExecutionException,
+    private void testPacketOut() throws IllegalAccessException, InstantiationException, ExecutionException,
             InterruptedException, ImmutableByteSequence.ByteSequenceTrimException {
 
-        // Emits a packet out trough the CPU_PORT (255), i.e. we should receive the same packet back.
         PiPacketOperation packetOperation = PiPacketOperation.builder()
-                .withData(ImmutableByteSequence.ofOnes(512))
+                .withData(fit(copyFrom(1), 48 + 48 + 16))
                 .withType(PACKET_OUT)
                 .withMetadata(PiPacketMetadata.builder()
                                       .withId(PiPacketMetadataId.of("egress_port"))
-                                      .withValue(copyFrom((short) 255))
+                                      .withValue(fit(copyFrom(255), 9))
                                       .build())
                 .build();
 
         assert (client.packetOut(packetOperation, bmv2DefaultPipeconf).get());
 
-        // Wait for packet in.
-        Thread.sleep(1000);
+        Thread.sleep(5000);
     }
 
     private void testDumpTable(String tableName, PiPipeconf pipeconf) throws ExecutionException, InterruptedException {
         assert (client.dumpTable(PiTableId.of(tableName), pipeconf).get().size() == 0);
     }
 
+    private void testAddEntry(PiPipeconf pipeconf) throws ExecutionException, InterruptedException {
+        assert (client.writeTableEntries(Lists.newArrayList(piTableEntry), P4RuntimeClient.WriteOperationType.INSERT,
+                                         pipeconf).get());
+    }
+
     @Test
     @Ignore
     public void testBmv2() throws Exception {
 
-        createClientAndSetPipelineConfig(bmv2DefaultPipeconf, BMV2_JSON);
-        testPacketIo();
-        testDumpTable("table0", bmv2DefaultPipeconf);
-        testActionProfile(285227860);
+        createClient();
+        setPipelineConfig(bmv2DefaultPipeconf, BMV2_JSON);
+        testPacketOut();
+
+        // testPacketOut();
+
+        // testActionProfile(285261835);
+    }
+
+    @Test
+    @Ignore
+    public void testBmv2AddEntry() throws Exception {
+        createClient();
+        testAddEntry(bmv2DefaultPipeconf);
+        testDumpTable(TABLE_0, bmv2DefaultPipeconf);
     }
 
     @Test
     @Ignore
     public void testTofino() throws Exception {
-
-        createClientAndSetPipelineConfig(bmv2DefaultPipeconf, null);
+        createClient();
+        setPipelineConfig(bmv2DefaultPipeconf, null);
     }
 
 // OLD STUFF
diff --git a/core/api/src/main/java/org/onosproject/net/pi/model/PiHeaderModel.java b/core/api/src/main/java/org/onosproject/net/pi/model/PiHeaderModel.java
index 28148c1..dc76020 100644
--- a/core/api/src/main/java/org/onosproject/net/pi/model/PiHeaderModel.java
+++ b/core/api/src/main/java/org/onosproject/net/pi/model/PiHeaderModel.java
@@ -23,6 +23,14 @@
  */
 @Beta
 public interface PiHeaderModel {
+
+    /**
+     * Returns the name of this header instance.
+     *
+     * @return a string value
+     */
+    String name();
+
     /**
      * Returns the type of this header instance.
      *
diff --git a/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslator.java b/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslator.java
index 17dce70..666018f 100644
--- a/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslator.java
+++ b/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslator.java
@@ -130,12 +130,13 @@
         PiTableEntry.Builder tableEntryBuilder = PiTableEntry.builder();
 
         // In BMv2 0 is the highest priority.
-        // FIXME: Check P4Runtime and agree on maximum priority in the TableEntry javadoc.
-        // int newPriority = Integer.MAX_VALUE - rule.priority();
+        // TODO: Move priority change to P4runtimeClient, in the table entry encode phase.
+        // Similarly, original priority should be re-established in the decode phase.
+        int newPriority = Integer.MAX_VALUE - rule.priority();
 
         tableEntryBuilder
                 .forTable(piTableId)
-                .withPriority(rule.priority())
+                .withPriority(newPriority)
                 .withMatchKey(PiMatchKey.builder()
                                       .addFieldMatches(fieldMatches)
                                       .build())
@@ -271,7 +272,7 @@
 
         for (PiTableMatchFieldModel fieldModel : tableModel.matchFields()) {
 
-            PiHeaderFieldId fieldId = PiHeaderFieldId.of(fieldModel.field().header().type().name(),
+            PiHeaderFieldId fieldId = PiHeaderFieldId.of(fieldModel.field().header().name(),
                                                          fieldModel.field().type().name(),
                                                          fieldModel.field().header().index());
 
diff --git a/core/net/src/main/java/org/onosproject/net/pi/impl/PiPipeconfManager.java b/core/net/src/main/java/org/onosproject/net/pi/impl/PiPipeconfManager.java
index 2b1b4bf..c73139f 100644
--- a/core/net/src/main/java/org/onosproject/net/pi/impl/PiPipeconfManager.java
+++ b/core/net/src/main/java/org/onosproject/net/pi/impl/PiPipeconfManager.java
@@ -202,14 +202,17 @@
                     driverAdminService.registerProvider(provider);
                 }
 
-                //Changing the configuration for the device to enforce the full driver with pipipeconf
+                // Changing the configuration for the device to enforce the full driver with pipipeconf
                 // and base behaviours
                 ObjectNode newCfg = (ObjectNode) basicDeviceConfig.node();
                 newCfg = newCfg.put(DRIVER, completeDriverName);
                 ObjectMapper mapper = new ObjectMapper();
                 JsonNode newCfgNode = mapper.convertValue(newCfg, JsonNode.class);
                 cfgService.applyConfig(deviceId, BasicDeviceConfig.class, newCfgNode);
-                //Completable future is needed for when this method will also apply the pipeline to the device.
+                // Completable future is needed for when this method will also apply the pipeline to the device.
+                // FIXME (maybe): the pipeline is currently applied by the general device provider. But we store here
+                // the association between device and pipeconf.
+                devicesToPipeconf.put(deviceId, pipeconfId);
                 operationResult.complete(true);
             }
         });
diff --git a/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java b/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java
index 592c71b..42bb2fd 100644
--- a/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java
+++ b/core/net/src/test/java/org/onosproject/net/pi/impl/MockInterpreter.java
@@ -48,15 +48,15 @@
 public class MockInterpreter extends AbstractHandlerBehaviour implements PiPipelineInterpreter {
 
     static final String TABLE0 = "table0";
-    static final String SEND_TO_CPU = "send_to_cpu_0";
+    static final String SEND_TO_CPU = "send_to_cpu";
     static final String PORT = "port";
-    static final String DROP = "_drop_0";
-    static final String SET_EGRESS_PORT = "set_egress_port_0";
+    static final String DROP = "drop";
+    static final String SET_EGRESS_PORT = "set_egress_port";
 
     static final PiHeaderFieldId IN_PORT_ID = PiHeaderFieldId.of("standard_metadata", "ingress_port");
-    static final PiHeaderFieldId ETH_DST_ID = PiHeaderFieldId.of("ethernet_t", "dstAddr");
-    static final PiHeaderFieldId ETH_SRC_ID = PiHeaderFieldId.of("ethernet_t", "srcAddr");
-    static final PiHeaderFieldId ETH_TYPE_ID = PiHeaderFieldId.of("ethernet_t", "etherType");
+    static final PiHeaderFieldId ETH_DST_ID = PiHeaderFieldId.of("ethernet", "dstAddr");
+    static final PiHeaderFieldId ETH_SRC_ID = PiHeaderFieldId.of("ethernet", "srcAddr");
+    static final PiHeaderFieldId ETH_TYPE_ID = PiHeaderFieldId.of("ethernet", "etherType");
 
     private static final ImmutableBiMap<Criterion.Type, PiHeaderFieldId> CRITERION_MAP = ImmutableBiMap.of(
             Criterion.Type.IN_PORT, IN_PORT_ID,
diff --git a/core/net/src/test/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorTest.java b/core/net/src/test/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorTest.java
index d865c8e..ab3cbb3 100644
--- a/core/net/src/test/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorTest.java
+++ b/core/net/src/test/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorTest.java
@@ -145,7 +145,7 @@
         assertThat("Incorrect ethType match param value",
                    ethTypeParam.value().asReadOnlyBuffer().getShort(), is(equalTo(ethType)));
         assertThat("Incorrect priority value",
-                   entry1.priority().get(), is(equalTo(rule1.priority())));
+                   entry1.priority().get(), is(equalTo(Integer.MAX_VALUE - rule1.priority())));
         assertThat("Incorrect timeout value",
                    entry1.timeout(), is(equalTo(expectedTimeout)));
 
diff --git a/core/net/src/test/resources/org/onosproject/net/pi/impl/default.json b/core/net/src/test/resources/org/onosproject/net/pi/impl/default.json
deleted file mode 100644
index f0bcc71..0000000
--- a/core/net/src/test/resources/org/onosproject/net/pi/impl/default.json
+++ /dev/null
@@ -1,777 +0,0 @@
-{
-  "program" : "default.p4",
-  "__meta__" : null,
-  "header_types" : [
-    {
-      "name" : "scalars",
-      "id" : 0,
-      "fields" : [
-        ["tmp", 32, false],
-        ["tmp_0", 32, false]
-      ]
-    },
-    {
-      "name" : "ethernet_t",
-      "id" : 1,
-      "fields" : [
-        ["dstAddr", 48, false],
-        ["srcAddr", 48, false],
-        ["etherType", 16, false]
-      ]
-    },
-    {
-      "name" : "ipv4_t",
-      "id" : 2,
-      "fields" : [
-        ["version", 4, false],
-        ["ihl", 4, false],
-        ["diffserv", 8, false],
-        ["totalLen", 16, false],
-        ["identification", 16, false],
-        ["flags", 3, false],
-        ["fragOffset", 13, false],
-        ["ttl", 8, false],
-        ["protocol", 8, false],
-        ["hdrChecksum", 16, false],
-        ["srcAddr", 32, false],
-        ["dstAddr", 32, false]
-      ]
-    },
-    {
-      "name" : "tcp_t",
-      "id" : 3,
-      "fields" : [
-        ["srcPort", 16, false],
-        ["dstPort", 16, false],
-        ["seqNo", 32, false],
-        ["ackNo", 32, false],
-        ["dataOffset", 4, false],
-        ["res", 3, false],
-        ["ecn", 3, false],
-        ["ctrl", 6, false],
-        ["window", 16, false],
-        ["checksum", 16, false],
-        ["urgentPtr", 16, false]
-      ]
-    },
-    {
-      "name" : "udp_t",
-      "id" : 4,
-      "fields" : [
-        ["srcPort", 16, false],
-        ["dstPort", 16, false],
-        ["length_", 16, false],
-        ["checksum", 16, false]
-      ]
-    },
-    {
-      "name" : "ecmp_metadata_t",
-      "id" : 5,
-      "fields" : [
-        ["groupId", 16, false],
-        ["selector", 16, false]
-      ]
-    },
-    {
-      "name" : "wcmp_meta_t",
-      "id" : 6,
-      "fields" : [
-        ["groupId", 16, false],
-        ["numBits", 8, false],
-        ["selector", 64, false]
-      ]
-    },
-    {
-      "name" : "intrinsic_metadata_t",
-      "id" : 7,
-      "fields" : [
-        ["ingress_global_timestamp", 32, false],
-        ["lf_field_list", 32, false],
-        ["mcast_grp", 16, false],
-        ["egress_rid", 16, false]
-      ]
-    },
-    {
-      "name" : "standard_metadata",
-      "id" : 8,
-      "fields" : [
-        ["ingress_port", 9, false],
-        ["egress_spec", 9, false],
-        ["egress_port", 9, false],
-        ["clone_spec", 32, false],
-        ["instance_type", 32, false],
-        ["drop", 1, false],
-        ["recirculate_port", 16, false],
-        ["packet_length", 32, false],
-        ["enq_timestamp", 32, false],
-        ["enq_qdepth", 19, false],
-        ["deq_timedelta", 32, false],
-        ["deq_qdepth", 19, false],
-        ["ingress_global_timestamp", 48, false],
-        ["lf_field_list", 32, false],
-        ["mcast_grp", 16, false],
-        ["resubmit_flag", 1, false],
-        ["egress_rid", 16, false],
-        ["_padding", 5, false]
-      ]
-    }
-  ],
-  "headers" : [
-    {
-      "name" : "scalars",
-      "id" : 0,
-      "header_type" : "scalars",
-      "metadata" : true,
-      "pi_omit" : true
-    },
-    {
-      "name" : "standard_metadata",
-      "id" : 1,
-      "header_type" : "standard_metadata",
-      "metadata" : true,
-      "pi_omit" : true
-    },
-    {
-      "name" : "ethernet",
-      "id" : 2,
-      "header_type" : "ethernet_t",
-      "metadata" : false,
-      "pi_omit" : true
-    },
-    {
-      "name" : "ipv4",
-      "id" : 3,
-      "header_type" : "ipv4_t",
-      "metadata" : false,
-      "pi_omit" : true
-    },
-    {
-      "name" : "tcp",
-      "id" : 4,
-      "header_type" : "tcp_t",
-      "metadata" : false,
-      "pi_omit" : true
-    },
-    {
-      "name" : "udp",
-      "id" : 5,
-      "header_type" : "udp_t",
-      "metadata" : false,
-      "pi_omit" : true
-    },
-    {
-      "name" : "ecmp_metadata",
-      "id" : 6,
-      "header_type" : "ecmp_metadata_t",
-      "metadata" : true,
-      "pi_omit" : true
-    },
-    {
-      "name" : "wcmp_meta",
-      "id" : 7,
-      "header_type" : "wcmp_meta_t",
-      "metadata" : true,
-      "pi_omit" : true
-    },
-    {
-      "name" : "intrinsic_metadata",
-      "id" : 8,
-      "header_type" : "intrinsic_metadata_t",
-      "metadata" : true,
-      "pi_omit" : true
-    }
-  ],
-  "header_stacks" : [],
-  "field_lists" : [],
-  "errors" : [
-    ["NoError", 0],
-    ["PacketTooShort", 1],
-    ["NoMatch", 2],
-    ["StackOutOfBounds", 3],
-    ["HeaderTooShort", 4],
-    ["ParserTimeout", 5]
-  ],
-  "enums" : [],
-  "parsers" : [
-    {
-      "name" : "parser",
-      "id" : 0,
-      "init_state" : "start",
-      "parse_states" : [
-        {
-          "name" : "parse_ethernet",
-          "id" : 0,
-          "parser_ops" : [
-            {
-              "parameters" : [
-                {
-                  "type" : "regular",
-                  "value" : "ethernet"
-                }
-              ],
-              "op" : "extract"
-            }
-          ],
-          "transitions" : [
-            {
-              "value" : "0x0800",
-              "mask" : null,
-              "next_state" : "parse_ipv4"
-            },
-            {
-              "value" : "default",
-              "mask" : null,
-              "next_state" : null
-            }
-          ],
-          "transition_key" : [
-            {
-              "type" : "field",
-              "value" : ["ethernet", "etherType"]
-            }
-          ]
-        },
-        {
-          "name" : "parse_ipv4",
-          "id" : 1,
-          "parser_ops" : [
-            {
-              "parameters" : [
-                {
-                  "type" : "regular",
-                  "value" : "ipv4"
-                }
-              ],
-              "op" : "extract"
-            }
-          ],
-          "transitions" : [
-            {
-              "value" : "0x000006",
-              "mask" : null,
-              "next_state" : "parse_tcp"
-            },
-            {
-              "value" : "0x000011",
-              "mask" : null,
-              "next_state" : "parse_udp"
-            },
-            {
-              "value" : "default",
-              "mask" : null,
-              "next_state" : null
-            }
-          ],
-          "transition_key" : [
-            {
-              "type" : "field",
-              "value" : ["ipv4", "fragOffset"]
-            },
-            {
-              "type" : "field",
-              "value" : ["ipv4", "protocol"]
-            }
-          ]
-        },
-        {
-          "name" : "parse_tcp",
-          "id" : 2,
-          "parser_ops" : [
-            {
-              "parameters" : [
-                {
-                  "type" : "regular",
-                  "value" : "tcp"
-                }
-              ],
-              "op" : "extract"
-            }
-          ],
-          "transitions" : [
-            {
-              "value" : "default",
-              "mask" : null,
-              "next_state" : null
-            }
-          ],
-          "transition_key" : []
-        },
-        {
-          "name" : "parse_udp",
-          "id" : 3,
-          "parser_ops" : [
-            {
-              "parameters" : [
-                {
-                  "type" : "regular",
-                  "value" : "udp"
-                }
-              ],
-              "op" : "extract"
-            }
-          ],
-          "transitions" : [
-            {
-              "value" : "default",
-              "mask" : null,
-              "next_state" : null
-            }
-          ],
-          "transition_key" : []
-        },
-        {
-          "name" : "start",
-          "id" : 4,
-          "parser_ops" : [],
-          "transitions" : [
-            {
-              "value" : "default",
-              "mask" : null,
-              "next_state" : "parse_ethernet"
-            }
-          ],
-          "transition_key" : []
-        }
-      ]
-    }
-  ],
-  "deparsers" : [
-    {
-      "name" : "deparser",
-      "id" : 0,
-      "source_info" : {
-        "filename" : "./include/parsers.p4",
-        "line" : 34,
-        "column" : 8,
-        "source_fragment" : "DeparserImpl"
-      },
-      "order" : ["ethernet", "ipv4", "udp", "tcp"]
-    }
-  ],
-  "meter_arrays" : [],
-  "counter_arrays" : [
-    {
-      "name" : "process_port_counters_0.egress_port_counter",
-      "id" : 0,
-      "source_info" : {
-        "filename" : "./include/port_counters.p4",
-        "line" : 5,
-        "column" : 41,
-        "source_fragment" : "egress_port_counter"
-      },
-      "size" : 254,
-      "is_direct" : false
-    },
-    {
-      "name" : "process_port_counters_0.ingress_port_counter",
-      "id" : 1,
-      "source_info" : {
-        "filename" : "./include/port_counters.p4",
-        "line" : 6,
-        "column" : 41,
-        "source_fragment" : "ingress_port_counter"
-      },
-      "size" : 254,
-      "is_direct" : false
-    }
-  ],
-  "register_arrays" : [],
-  "calculations" : [],
-  "learn_lists" : [],
-  "actions" : [
-    {
-      "name" : "NoAction",
-      "id" : 0,
-      "runtime_data" : [],
-      "primitives" : []
-    },
-    {
-      "name" : "NoAction",
-      "id" : 1,
-      "runtime_data" : [],
-      "primitives" : []
-    },
-    {
-      "name" : "set_egress_port_0",
-      "id" : 2,
-      "runtime_data" : [
-        {
-          "name" : "port",
-          "bitwidth" : 9
-        }
-      ],
-      "primitives" : [
-        {
-          "op" : "assign",
-          "parameters" : [
-            {
-              "type" : "field",
-              "value" : ["standard_metadata", "egress_spec"]
-            },
-            {
-              "type" : "runtime_data",
-              "value" : 0
-            }
-          ],
-          "source_info" : {
-            "filename" : "default.p4",
-            "line" : 22,
-            "column" : 8,
-            "source_fragment" : "standard_metadata.egress_spec = port"
-          }
-        }
-      ]
-    },
-    {
-      "name" : "send_to_cpu_0",
-      "id" : 3,
-      "runtime_data" : [],
-      "primitives" : [
-        {
-          "op" : "assign",
-          "parameters" : [
-            {
-              "type" : "field",
-              "value" : ["standard_metadata", "egress_spec"]
-            },
-            {
-              "type" : "hexstr",
-              "value" : "0x00ff"
-            }
-          ],
-          "source_info" : {
-            "filename" : "default.p4",
-            "line" : 26,
-            "column" : 8,
-            "source_fragment" : "standard_metadata.egress_spec = 9w255"
-          }
-        }
-      ]
-    },
-    {
-      "name" : "_drop_0",
-      "id" : 4,
-      "runtime_data" : [],
-      "primitives" : [
-        {
-          "op" : "assign",
-          "parameters" : [
-            {
-              "type" : "field",
-              "value" : ["standard_metadata", "egress_spec"]
-            },
-            {
-              "type" : "hexstr",
-              "value" : "0x01ff"
-            }
-          ],
-          "source_info" : {
-            "filename" : "default.p4",
-            "line" : 30,
-            "column" : 8,
-            "source_fragment" : "standard_metadata.egress_spec = 9w511"
-          }
-        }
-      ]
-    },
-    {
-      "name" : "process_port_counters_0.count_packet",
-      "id" : 5,
-      "runtime_data" : [],
-      "primitives" : [
-        {
-          "op" : "assign",
-          "parameters" : [
-            {
-              "type" : "field",
-              "value" : ["scalars", "tmp"]
-            },
-            {
-              "type" : "expression",
-              "value" : {
-                "type" : "expression",
-                "value" : {
-                  "op" : "&",
-                  "left" : {
-                    "type" : "expression",
-                    "value" : {
-                      "op" : "&",
-                      "left" : {
-                        "type" : "field",
-                        "value" : ["standard_metadata", "ingress_port"]
-                      },
-                      "right" : {
-                        "type" : "hexstr",
-                        "value" : "0xff"
-                      }
-                    }
-                  },
-                  "right" : {
-                    "type" : "hexstr",
-                    "value" : "0xffffffff"
-                  }
-                }
-              }
-            }
-          ]
-        },
-        {
-          "op" : "count",
-          "parameters" : [
-            {
-              "type" : "counter_array",
-              "value" : "process_port_counters_0.ingress_port_counter"
-            },
-            {
-              "type" : "field",
-              "value" : ["scalars", "tmp"]
-            }
-          ],
-          "source_info" : {
-            "filename" : "./include/port_counters.p4",
-            "line" : 8,
-            "column" : 8,
-            "source_fragment" : "ingress_port_counter.count((bit<32>)(bit<8>)standard_metadata.ingress_port)"
-          }
-        },
-        {
-          "op" : "assign",
-          "parameters" : [
-            {
-              "type" : "field",
-              "value" : ["scalars", "tmp_0"]
-            },
-            {
-              "type" : "expression",
-              "value" : {
-                "type" : "expression",
-                "value" : {
-                  "op" : "&",
-                  "left" : {
-                    "type" : "expression",
-                    "value" : {
-                      "op" : "&",
-                      "left" : {
-                        "type" : "field",
-                        "value" : ["standard_metadata", "egress_spec"]
-                      },
-                      "right" : {
-                        "type" : "hexstr",
-                        "value" : "0xff"
-                      }
-                    }
-                  },
-                  "right" : {
-                    "type" : "hexstr",
-                    "value" : "0xffffffff"
-                  }
-                }
-              }
-            }
-          ]
-        },
-        {
-          "op" : "count",
-          "parameters" : [
-            {
-              "type" : "counter_array",
-              "value" : "process_port_counters_0.egress_port_counter"
-            },
-            {
-              "type" : "field",
-              "value" : ["scalars", "tmp_0"]
-            }
-          ],
-          "source_info" : {
-            "filename" : "./include/port_counters.p4",
-            "line" : 9,
-            "column" : 8,
-            "source_fragment" : "egress_port_counter.count((bit<32>)(bit<8>)standard_metadata.egress_spec)"
-          }
-        }
-      ]
-    }
-  ],
-  "pipelines" : [
-    {
-      "name" : "ingress",
-      "id" : 0,
-      "source_info" : {
-        "filename" : "default.p4",
-        "line" : 9,
-        "column" : 8,
-        "source_fragment" : "ingress"
-      },
-      "init_table" : "table0",
-      "tables" : [
-        {
-          "name" : "table0",
-          "id" : 0,
-          "source_info" : {
-            "filename" : "default.p4",
-            "line" : 32,
-            "column" : 10,
-            "source_fragment" : "table0"
-          },
-          "key" : [
-            {
-              "match_type" : "ternary",
-              "target" : ["standard_metadata", "ingress_port"],
-              "mask" : null
-            },
-            {
-              "match_type" : "ternary",
-              "target" : ["ethernet", "dstAddr"],
-              "mask" : null
-            },
-            {
-              "match_type" : "ternary",
-              "target" : ["ethernet", "srcAddr"],
-              "mask" : null
-            },
-            {
-              "match_type" : "ternary",
-              "target" : ["ethernet", "etherType"],
-              "mask" : null
-            }
-          ],
-          "match_type" : "ternary",
-          "type" : "simple",
-          "max_size" : 1024,
-          "with_counters" : false,
-          "support_timeout" : false,
-          "direct_meters" : null,
-          "action_ids" : [2, 3, 4, 0],
-          "actions" : ["set_egress_port_0", "send_to_cpu_0", "_drop_0", "NoAction"],
-          "base_default_next" : "node_3",
-          "next_tables" : {
-            "set_egress_port_0" : "node_3",
-            "send_to_cpu_0" : "node_3",
-            "_drop_0" : "node_3",
-            "NoAction" : "node_3"
-          },
-          "default_entry" : {
-            "action_id" : 0,
-            "action_const" : false,
-            "action_data" : [],
-            "action_entry_const" : false
-          }
-        },
-        {
-          "name" : "process_port_counters_0.port_count_table",
-          "id" : 1,
-          "source_info" : {
-            "filename" : "./include/port_counters.p4",
-            "line" : 11,
-            "column" : 10,
-            "source_fragment" : "port_count_table"
-          },
-          "key" : [],
-          "match_type" : "exact",
-          "type" : "simple",
-          "max_size" : 1024,
-          "with_counters" : false,
-          "support_timeout" : false,
-          "direct_meters" : null,
-          "action_ids" : [5, 1],
-          "actions" : ["process_port_counters_0.count_packet", "NoAction"],
-          "base_default_next" : null,
-          "next_tables" : {
-            "process_port_counters_0.count_packet" : null,
-            "NoAction" : null
-          },
-          "default_entry" : {
-            "action_id" : 1,
-            "action_const" : false,
-            "action_data" : [],
-            "action_entry_const" : false
-          }
-        }
-      ],
-      "action_profiles" : [],
-      "conditionals" : [
-        {
-          "name" : "node_3",
-          "id" : 0,
-          "source_info" : {
-            "filename" : "./include/port_counters.p4",
-            "line" : 17,
-            "column" : 12,
-            "source_fragment" : "standard_metadata.egress_spec < 9w254"
-          },
-          "expression" : {
-            "type" : "expression",
-            "value" : {
-              "op" : "<",
-              "left" : {
-                "type" : "field",
-                "value" : ["standard_metadata", "egress_spec"]
-              },
-              "right" : {
-                "type" : "hexstr",
-                "value" : "0x00fe"
-              }
-            }
-          },
-          "false_next" : null,
-          "true_next" : "process_port_counters_0.port_count_table"
-        }
-      ]
-    },
-    {
-      "name" : "egress",
-      "id" : 1,
-      "source_info" : {
-        "filename" : "default.p4",
-        "line" : 54,
-        "column" : 8,
-        "source_fragment" : "egress"
-      },
-      "init_table" : null,
-      "tables" : [],
-      "action_profiles" : [],
-      "conditionals" : []
-    }
-  ],
-  "checksums" : [],
-  "force_arith" : [],
-  "extern_instances" : [],
-  "field_aliases" : [
-    [
-      "queueing_metadata.enq_timestamp",
-      ["standard_metadata", "enq_timestamp"]
-    ],
-    [
-      "queueing_metadata.enq_qdepth",
-      ["standard_metadata", "enq_qdepth"]
-    ],
-    [
-      "queueing_metadata.deq_timedelta",
-      ["standard_metadata", "deq_timedelta"]
-    ],
-    [
-      "queueing_metadata.deq_qdepth",
-      ["standard_metadata", "deq_qdepth"]
-    ],
-    [
-      "intrinsic_metadata.ingress_global_timestamp",
-      ["standard_metadata", "ingress_global_timestamp"]
-    ],
-    [
-      "intrinsic_metadata.lf_field_list",
-      ["standard_metadata", "lf_field_list"]
-    ],
-    [
-      "intrinsic_metadata.mcast_grp",
-      ["standard_metadata", "mcast_grp"]
-    ],
-    [
-      "intrinsic_metadata.resubmit_flag",
-      ["standard_metadata", "resubmit_flag"]
-    ],
-    [
-      "intrinsic_metadata.egress_rid",
-      ["standard_metadata", "egress_rid"]
-    ]
-  ]
-}
\ No newline at end of file
diff --git a/core/net/src/test/resources/org/onosproject/net/pi/impl/default.json b/core/net/src/test/resources/org/onosproject/net/pi/impl/default.json
new file mode 120000
index 0000000..0fc79b0
--- /dev/null
+++ b/core/net/src/test/resources/org/onosproject/net/pi/impl/default.json
@@ -0,0 +1 @@
+../../../../../../../../../../tools/test/p4src/p4-16/p4c-out/default.json
\ No newline at end of file
diff --git a/drivers/bmv2/BUCK b/drivers/bmv2/BUCK
index b7de8b4..15f6dcf 100644
--- a/drivers/bmv2/BUCK
+++ b/drivers/bmv2/BUCK
@@ -28,6 +28,7 @@
     included_bundles = BUNDLES,
     required_apps = [
         'org.onosproject.generaldeviceprovider',
-        'org.onosproject.protocols.p4runtime'
+        'org.onosproject.protocols.p4runtime',
+        'org.onosproject.p4runtime',
     ],
 )
diff --git a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java
index 31c351d3..31d4627 100644
--- a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java
+++ b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2DefaultInterpreter.java
@@ -60,17 +60,17 @@
  */
 public class Bmv2DefaultInterpreter extends AbstractHandlerBehaviour implements PiPipelineInterpreter {
     private static final String TABLE0 = "table0";
-    private static final String SEND_TO_CPU = "send_to_cpu_0";
+    private static final String SEND_TO_CPU = "send_to_cpu";
     private static final String PORT = "port";
-    private static final String DROP = "_drop_0";
-    private static final String SET_EGRESS_PORT = "set_egress_port_0";
+    private static final String DROP = "drop";
+    private static final String SET_EGRESS_PORT = "set_egress_port";
     private static final String EGRESS_PORT = "egress_port";
     private static final int PORT_NUMBER_BIT_WIDTH = 9;
 
     private static final PiHeaderFieldId IN_PORT_ID = PiHeaderFieldId.of("standard_metadata", "ingress_port");
-    private static final PiHeaderFieldId ETH_DST_ID = PiHeaderFieldId.of("ethernet_t", "dstAddr");
-    private static final PiHeaderFieldId ETH_SRC_ID = PiHeaderFieldId.of("ethernet_t", "srcAddr");
-    private static final PiHeaderFieldId ETH_TYPE_ID = PiHeaderFieldId.of("ethernet_t", "etherType");
+    private static final PiHeaderFieldId ETH_DST_ID = PiHeaderFieldId.of("ethernet", "dstAddr");
+    private static final PiHeaderFieldId ETH_SRC_ID = PiHeaderFieldId.of("ethernet", "srcAddr");
+    private static final PiHeaderFieldId ETH_TYPE_ID = PiHeaderFieldId.of("ethernet", "etherType");
 
     private static final ImmutableBiMap<Criterion.Type, PiHeaderFieldId> CRITERION_MAP =
             new ImmutableBiMap.Builder<Criterion.Type, PiHeaderFieldId>()
diff --git a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2FlowRuleProgrammable.java b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2FlowRuleProgrammable.java
index 50b8002..6c445f3 100644
--- a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2FlowRuleProgrammable.java
+++ b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2FlowRuleProgrammable.java
@@ -67,7 +67,7 @@
     private static final ConcurrentMap<Bmv2TableEntryReference, Lock> ENTRY_LOCKS = Maps.newConcurrentMap();
 
     // TODO: replace with distributed store.
-    // Can reuse old BMv2TableEntryService form ONOS 1.6
+    // Can reuse old BMv2TableEntryService from ONOS 1.6
     private static final ConcurrentMap<Bmv2TableEntryReference, Bmv2FlowRuleWrapper> ENTRY_STORE =
             Maps.newConcurrentMap();
 
diff --git a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2PacketProgrammable.java b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2PacketProgrammable.java
index c48eef3..3e0c887 100644
--- a/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2PacketProgrammable.java
+++ b/drivers/bmv2/src/main/java/org/onosproject/drivers/bmv2/Bmv2PacketProgrammable.java
@@ -65,7 +65,7 @@
         Device device = deviceService.getDevice(deviceId);
         final PiPipelineInterpreter interpreter = device.is(PiPipelineInterpreter.class)
                 ? device.as(PiPipelineInterpreter.class) : null;
-        if (device.is(PiPipelineInterpreter.class)) {
+        if (!device.is(PiPipelineInterpreter.class)) {
             log.warn("Device {} unable to instantiate interpreter of pipeconf {}", deviceId, pipeconf.id());
             return;
         }
@@ -73,6 +73,7 @@
         try {
             Collection<PiPacketOperation> operations = interpreter.mapOutboundPacket(packet);
             operations.forEach(piPacketOperation -> {
+                log.debug("Doing PiPacketOperation {}", piPacketOperation);
                 client.packetOut(piPacketOperation, pipeconf);
             });
         } catch (PiPipelineInterpreter.PiInterpreterException e) {
diff --git a/incubator/bmv2/model/src/main/java/org/onosproject/bmv2/model/Bmv2HeaderModel.java b/incubator/bmv2/model/src/main/java/org/onosproject/bmv2/model/Bmv2HeaderModel.java
index 6c838c4..5585413 100644
--- a/incubator/bmv2/model/src/main/java/org/onosproject/bmv2/model/Bmv2HeaderModel.java
+++ b/incubator/bmv2/model/src/main/java/org/onosproject/bmv2/model/Bmv2HeaderModel.java
@@ -60,6 +60,7 @@
      *
      * @return name of this model
      */
+    @Override
     public String name() {
         return name;
     }
diff --git a/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEvent.java b/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEvent.java
index 9ba3d58..08dc206 100644
--- a/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEvent.java
+++ b/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEvent.java
@@ -17,12 +17,26 @@
 package org.onosproject.p4runtime.api;
 
 import com.google.common.annotations.Beta;
-import org.onosproject.event.Event;
+import org.onosproject.event.AbstractEvent;
 
 /**
  * Representation of an event received from a P4Runtime device.
  */
 @Beta
-public interface P4RuntimeEvent extends Event<P4RuntimeEventListener.Type, P4RuntimeEventSubject> {
+public final class P4RuntimeEvent extends AbstractEvent<P4RuntimeEvent.Type, P4RuntimeEventSubject> {
 
+    /**
+     * Type of event.
+     */
+    public enum Type {
+        /**
+         * A packet-in.
+         */
+        PACKET_IN,
+        // TODO: add mastership, device as soon as we define those.
+    }
+
+    public P4RuntimeEvent(Type type, P4RuntimeEventSubject subject) {
+        super(type, subject);
+    }
 }
diff --git a/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEventListener.java b/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEventListener.java
index 0a63355..272986d 100644
--- a/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEventListener.java
+++ b/protocols/p4runtime/api/src/main/java/org/onosproject/p4runtime/api/P4RuntimeEventListener.java
@@ -25,14 +25,4 @@
 @Beta
 public interface P4RuntimeEventListener extends EventListener<P4RuntimeEvent> {
 
-    /**
-     * Type of event.
-     */
-    enum Type {
-        /**
-         * A packet-in.
-         */
-        PACKET_IN,
-        // TODO: add mastership, device as soon as we define those.
-    }
 }
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/DefaultPacketIn.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/DefaultPacketIn.java
new file mode 100644
index 0000000..2085505
--- /dev/null
+++ b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/DefaultPacketIn.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.p4runtime.ctl;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.pi.runtime.PiPacketOperation;
+import org.onosproject.p4runtime.api.P4RuntimePacketIn;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Default implementation of a packet-in in P4Runtime.
+ */
+final class DefaultPacketIn implements P4RuntimePacketIn {
+
+    private final DeviceId deviceId;
+    private final PiPacketOperation operation;
+
+    DefaultPacketIn(DeviceId deviceId, PiPacketOperation operation) {
+        this.deviceId = checkNotNull(deviceId);
+        this.operation = checkNotNull(operation);
+    }
+
+    @Override
+    public DeviceId deviceId() {
+        return deviceId;
+    }
+
+    @Override
+    public PiPacketOperation packetOperation() {
+        return operation;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        DefaultPacketIn that = (DefaultPacketIn) o;
+        return Objects.equal(deviceId, that.deviceId) &&
+                Objects.equal(operation, that.operation);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(deviceId, operation);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(this)
+                .add("deviceId", deviceId)
+                .add("operation", operation)
+                .toString();
+    }
+}
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/DefaultPacketInEvent.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/DefaultPacketInEvent.java
deleted file mode 100644
index e0be104..0000000
--- a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/DefaultPacketInEvent.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.p4runtime.ctl;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import org.onosproject.event.AbstractEvent;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.pi.runtime.PiPacketOperation;
-import org.onosproject.p4runtime.api.P4RuntimeEvent;
-import org.onosproject.p4runtime.api.P4RuntimeEventListener;
-import org.onosproject.p4runtime.api.P4RuntimeEventSubject;
-import org.onosproject.p4runtime.api.P4RuntimePacketIn;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Default implementation of a packet-in event.
- */
-final class DefaultPacketInEvent
-        extends AbstractEvent<P4RuntimeEventListener.Type, P4RuntimeEventSubject>
-        implements P4RuntimeEvent {
-
-    DefaultPacketInEvent(DeviceId deviceId, PiPacketOperation operation) {
-        super(P4RuntimeEventListener.Type.PACKET_IN, new DefaultPacketIn(deviceId, operation));
-    }
-
-    /**
-     * Default implementation of a packet-in in P4Runtime.
-     */
-    private static final class DefaultPacketIn implements P4RuntimePacketIn {
-
-        private final DeviceId deviceId;
-        private final PiPacketOperation operation;
-
-        private DefaultPacketIn(DeviceId deviceId, PiPacketOperation operation) {
-            this.deviceId = checkNotNull(deviceId);
-            this.operation = checkNotNull(operation);
-        }
-
-        @Override
-        public DeviceId deviceId() {
-            return deviceId;
-        }
-
-        @Override
-        public PiPacketOperation packetOperation() {
-            return operation;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) {
-                return true;
-            }
-            if (o == null || getClass() != o.getClass()) {
-                return false;
-            }
-            DefaultPacketIn that = (DefaultPacketIn) o;
-            return Objects.equal(deviceId, that.deviceId) &&
-                    Objects.equal(operation, that.operation);
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hashCode(deviceId, operation);
-        }
-
-        @Override
-        public String toString() {
-            return MoreObjects.toStringHelper(this)
-                    .add("deviceId", deviceId)
-                    .add("operation", operation)
-                    .toString();
-        }
-    }
-}
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeClientImpl.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeClientImpl.java
index d8a76d4..e805e91 100644
--- a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeClientImpl.java
+++ b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeClientImpl.java
@@ -44,7 +44,6 @@
 import p4.P4RuntimeOuterClass.StreamMessageRequest;
 import p4.P4RuntimeOuterClass.StreamMessageResponse;
 import p4.P4RuntimeOuterClass.TableEntry;
-import p4.P4RuntimeOuterClass.Uint128;
 import p4.P4RuntimeOuterClass.Update;
 import p4.P4RuntimeOuterClass.WriteRequest;
 import p4.config.P4InfoOuterClass.P4Info;
@@ -114,8 +113,8 @@
                 "onos/p4runtime-client-" + deviceId.toString(),
                 deviceId.toString() + "-%d"));
         this.contextExecutor = this.cancellableContext.fixedContextExecutor(executorService);
-        this.blockingStub = P4RuntimeGrpc.newBlockingStub(channel)
-                .withDeadlineAfter(DEADLINE_SECONDS, TimeUnit.SECONDS);
+        //TODO Investigate deadline or timeout in supplyInContext Method
+        this.blockingStub = P4RuntimeGrpc.newBlockingStub(channel);
         P4RuntimeGrpc.P4RuntimeStub asyncStub = P4RuntimeGrpc.newStub(channel);
         this.streamRequestObserver = asyncStub.streamChannel(new StreamChannelResponseObserver());
     }
@@ -127,14 +126,14 @@
      * Important: Tasks submitted in parallel by different threads are forced executed sequentially.
      * <p>
      */
-    private <U> CompletableFuture<U> supplyInContext(Supplier<U> supplier) {
+    private <U> CompletableFuture<U> supplyInContext(Supplier<U> supplier, String opDescription) {
         return CompletableFuture.supplyAsync(() -> {
             // TODO: explore a more relaxed locking strategy.
             writeLock.lock();
             try {
                 return supplier.get();
             } catch (Throwable ex) {
-                log.error("Exception in P4Runtime client of {}", deviceId, ex);
+                log.error("Exception in P4Runtime client of {}, executing {}", deviceId, opDescription, ex);
                 throw ex;
             } finally {
                 writeLock.unlock();
@@ -144,28 +143,29 @@
 
     @Override
     public CompletableFuture<Boolean> initStreamChannel() {
-        return supplyInContext(this::doInitStreamChannel);
+        return supplyInContext(this::doInitStreamChannel, "initStreamChannel");
     }
 
     @Override
     public CompletableFuture<Boolean> setPipelineConfig(PiPipeconf pipeconf, ExtensionType targetConfigExtType) {
-        return supplyInContext(() -> doSetPipelineConfig(pipeconf, targetConfigExtType));
+        return supplyInContext(() -> doSetPipelineConfig(pipeconf, targetConfigExtType), "setPipelineConfig");
     }
 
     @Override
     public CompletableFuture<Boolean> writeTableEntries(Collection<PiTableEntry> piTableEntries,
                                                         WriteOperationType opType, PiPipeconf pipeconf) {
-        return supplyInContext(() -> doWriteTableEntries(piTableEntries, opType, pipeconf));
+        return supplyInContext(() -> doWriteTableEntries(piTableEntries, opType, pipeconf),
+                               "writeTableEntries-" + opType.name());
     }
 
     @Override
     public CompletableFuture<Collection<PiTableEntry>> dumpTable(PiTableId piTableId, PiPipeconf pipeconf) {
-        return supplyInContext(() -> doDumpTable(piTableId, pipeconf));
+        return supplyInContext(() -> doDumpTable(piTableId, pipeconf), "dumpTable-" + piTableId);
     }
 
     @Override
     public CompletableFuture<Boolean> packetOut(PiPacketOperation packet, PiPipeconf pipeconf) {
-        return supplyInContext(() -> doPacketOut(packet, pipeconf));
+        return supplyInContext(() -> doPacketOut(packet, pipeconf), "packetOut");
     }
 
     /* Blocking method implementations below */
@@ -271,10 +271,11 @@
 
         writeRequestBuilder
                 .setDeviceId(p4DeviceId)
+                /* PI ignores this ElectionId, commenting out for now.
                 .setElectionId(Uint128.newBuilder()
                                        .setHigh(0)
                                        .setLow(ELECTION_ID)
-                                       .build())
+                                       .build()) */
                 .addAllUpdates(updateMsgs)
                 .build();
 
@@ -367,7 +368,9 @@
             return;
         }
         // Decode packet message and post event.
-        P4RuntimeEvent event = new DefaultPacketInEvent(deviceId, PacketIOCodec.decodePacketIn(packetInMsg, pipeconf));
+        PiPacketOperation packetOperation = PacketIOCodec.decodePacketIn(packetInMsg, pipeconf);
+        DefaultPacketIn packetInEventSubject = new DefaultPacketIn(deviceId, packetOperation);
+        P4RuntimeEvent event = new P4RuntimeEvent(P4RuntimeEvent.Type.PACKET_IN, packetInEventSubject);
         log.debug("Received packet in: {}", event);
         controller.postEvent(event);
     }
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeControllerImpl.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeControllerImpl.java
index d134a22..277af11 100644
--- a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeControllerImpl.java
+++ b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/P4RuntimeControllerImpl.java
@@ -67,6 +67,7 @@
 
     @Activate
     public void activate() {
+        eventDispatcher.addSink(P4RuntimeEvent.class, listenerRegistry);
         log.info("Started");
     }
 
@@ -74,6 +75,7 @@
     @Deactivate
     public void deactivate() {
         grpcController = null;
+        eventDispatcher.removeSink(P4RuntimeEvent.class);
         log.info("Stopped");
     }
 
diff --git a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/PacketIOCodec.java b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/PacketIOCodec.java
index 461cde0..a06fe7a 100644
--- a/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/PacketIOCodec.java
+++ b/protocols/p4runtime/ctl/src/main/java/org/onosproject/p4runtime/ctl/PacketIOCodec.java
@@ -25,6 +25,7 @@
 import org.slf4j.Logger;
 import p4.config.P4InfoOuterClass;
 
+import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
@@ -72,7 +73,7 @@
         //Get the P4browser
         P4InfoBrowser browser = PipeconfHelper.getP4InfoBrowser(pipeconf);
 
-        //Get the packet out packet metadata
+        //Get the packet out controller packet metadata
         P4InfoOuterClass.ControllerPacketMetadata controllerPacketMetadata =
                 browser.controllerPacketMetadatas().getByName(PACKET_OUT);
         PacketOut.Builder packetOutBuilder = PacketOut.newBuilder();
@@ -126,27 +127,38 @@
         //Get the P4browser
         P4InfoBrowser browser = PipeconfHelper.getP4InfoBrowser(pipeconf);
 
+        List<PiPacketMetadata> packetMetadatas;
+        try {
+            int controllerPacketMetadataId = browser.controllerPacketMetadatas().getByName(PACKET_IN)
+                                                .getPreamble().getId();
+            packetMetadatas = decodePacketMetadataIn(packetIn.getMetadataList(), browser,
+                                                                            controllerPacketMetadataId);
+        } catch (NotFoundException e) {
+            log.error("Unable to decode packet metadatas: {}", e.getMessage());
+            packetMetadatas = Collections.emptyList();
+        }
+
         //Transform the packetIn data
         ImmutableByteSequence data = copyFrom(packetIn.getPayload().asReadOnlyByteBuffer());
 
         //Build the PiPacketOperation with all the metadatas.
         return PiPacketOperation.builder()
                 .withType(PiPacketOperation.Type.PACKET_IN)
-                .withMetadatas(decodePacketMetadata(packetIn.getMetadataList(), browser))
+                .withMetadatas(packetMetadatas)
                 .withData(data)
                 .build();
     }
 
-    private static List<PiPacketMetadata> decodePacketMetadata(List<PacketMetadata> packetMetadatas,
-                                                               P4InfoBrowser browser) {
+    private static List<PiPacketMetadata> decodePacketMetadataIn(List<PacketMetadata> packetMetadatas,
+                                                               P4InfoBrowser browser, int controllerPacketMetadataId) {
         return packetMetadatas.stream().map(packetMetadata -> {
             try {
 
-                int controllerPacketMetadataId = packetMetadata.getMetadataId();
-                //convert id to name through p4Info
-                P4InfoOuterClass.ControllerPacketMetadata metadata =
-                        browser.controllerPacketMetadatas().getById(controllerPacketMetadataId);
-                PiPacketMetadataId metadataId = PiPacketMetadataId.of(metadata.getPreamble().getName());
+                int packetMetadataId = packetMetadata.getMetadataId();
+                String packetMetadataName = browser.packetMetadatas(controllerPacketMetadataId)
+                        .getById(packetMetadataId).getName();
+
+                PiPacketMetadataId metadataId = PiPacketMetadataId.of(packetMetadataName);
 
                 //Build each metadata.
                 return PiPacketMetadata.builder()
diff --git a/providers/p4runtime/packet/src/main/java/org/onosproject/provider/p4runtime/packet/impl/P4RuntimePacketProvider.java b/providers/p4runtime/packet/src/main/java/org/onosproject/provider/p4runtime/packet/impl/P4RuntimePacketProvider.java
index 1b7c280..8915172 100644
--- a/providers/p4runtime/packet/src/main/java/org/onosproject/provider/p4runtime/packet/impl/P4RuntimePacketProvider.java
+++ b/providers/p4runtime/packet/src/main/java/org/onosproject/provider/p4runtime/packet/impl/P4RuntimePacketProvider.java
@@ -134,7 +134,10 @@
                 treatment = outPacket().treatment();
             }
 
-            emit(new DefaultOutboundPacket(deviceId, treatment, rawData));
+            OutboundPacket outboundPacket = new DefaultOutboundPacket(deviceId, treatment, rawData);
+            log.debug("Processing outbound packet: {}", outboundPacket);
+
+            emit(outboundPacket);
         }
     }
 
@@ -143,7 +146,6 @@
      */
     private class InternalPacketListener implements P4RuntimeEventListener {
 
-
         @Override
         public void event(P4RuntimeEvent event) {
             P4RuntimePacketIn eventSubject = (P4RuntimePacketIn) event.subject();
@@ -157,6 +159,7 @@
                     //FIXME Wrapping of bytebuffer might be optimized with .asReadOnlyByteBuffer()
                     OutboundPacket outPkt = new DefaultOutboundPacket(eventSubject.deviceId(), null,
                             ByteBuffer.wrap(operation.data().asArray()));
+                    log.debug("Processing inbound packet: {}", inPkt.toString());
                     //Creating PacketContext
                     PacketContext pktCtx = new P4RuntimePacketContext(System.currentTimeMillis(), inPkt, outPkt, false);
                     //Sendign the ctx up for processing.
diff --git a/tools/dev/bin/onos-setup-p4-dev b/tools/dev/bin/onos-setup-p4-dev
index dd8dd3e..a10d0e2 100755
--- a/tools/dev/bin/onos-setup-p4-dev
+++ b/tools/dev/bin/onos-setup-p4-dev
@@ -148,7 +148,7 @@
     git submodule update --init --recursive
 
     ./autogen.sh
-    ./configure --with-proto --without-cli --without-internal-rpc
+    ./configure --with-proto 'CXXFLAGS=-O0 -ggdb'
     make -j${NUM_CORES}
     sudo make install
     sudo ldconfig
@@ -174,7 +174,7 @@
     sudo rm -rf $tmpdir
 
     ./autogen.sh
-    ./configure --enable-debugger --with-pi
+    ./configure --enable-debugger --with-pi 'CXXFLAGS=-O0 -ggdb'
     make -j${NUM_CORES}
     sudo make install
     sudo ldconfig
@@ -182,7 +182,7 @@
     # Simple_switch_grpc target
     cd targets/simple_switch_grpc
     ./autogen.sh
-    ./configure
+    ./configure 'CXXFLAGS=-O0 -ggdb'
     make -j${NUM_CORES}
     sudo make install
     sudo ldconfig
diff --git a/tools/dev/mininet/bmv2.py b/tools/dev/mininet/bmv2.py
index 60ad28c..5071c88 100644
--- a/tools/dev/mininet/bmv2.py
+++ b/tools/dev/mininet/bmv2.py
@@ -72,6 +72,21 @@
             warn("WARN: unable to get device IP address, won't do onos-netcfg")
             return
         onosDeviceId = "bmv2:%s" % self.deviceId
+        portData = {}
+        portId = 1
+        for intfName in self.intfNames():
+            if intfName == 'lo':
+                continue
+            portData[str(portId)] = {
+                "number": portId,
+                "name": intfName,
+                "enabled": True,
+                "removed": False,
+                "type": "copper",
+                "speed": 10000
+            }
+            portId += 1
+
         cfgData = {
             "devices": {
                 "device:%s" % onosDeviceId: {
@@ -88,7 +103,8 @@
                     },
                     "basic": {
                         "driver": "bmv2"
-                    }
+                    },
+                    "ports": portData
                 }
             }
         }
diff --git a/tools/test/p4src/p4-16/default.p4 b/tools/test/p4src/p4-16/default.p4
index 86ed4ee..c571331 100644
--- a/tools/test/p4src/p4-16/default.p4
+++ b/tools/test/p4src/p4-16/default.p4
@@ -31,11 +31,22 @@
 
 control ingress(inout headers_t hdr, inout metadata_t meta, inout standard_metadata_t standard_metadata) {
 
+    /*
+    FIXME:
+    It seems that with BMv2 it is not possible to use the same indirect table (like table0 with the
+    implementation attribute enabled), with table entries that use direct actions (e.g. send_to_cpu()).
+    A separate table for ECMP should be created.
+    */
+
     direct_counter(CounterType.packets) table0_counter;
-    action_selector(HashAlgorithm.crc16, 32w64, 32w16) ecmp_selector;
+    // action_selector(HashAlgorithm.crc16, 32w64, 32w16) ecmp_selector;
 
     table table0 {
-        support_timeout = true;
+        /*
+        Disabling timeout here as P4runtime doesn't allow setting timeouts.
+        This way the FlowRuleTranslator will produce instances of PiTableEntry without timeout.
+        */
+        support_timeout = false;
         key = {
             standard_metadata.ingress_port : ternary;
             hdr.ethernet.dstAddr           : ternary;
@@ -43,13 +54,13 @@
             hdr.ethernet.etherType         : ternary;
             // Not for matching.
             // Inputs to the hash function of the action selector.
-            hdr.ipv4.srcAddr               : selector;
+            /* hdr.ipv4.srcAddr               : selector;
             hdr.ipv4.dstAddr               : selector;
             hdr.ipv4.protocol              : selector;
             hdr.tcp.srcPort                : selector;
             hdr.tcp.dstPort                : selector;
             hdr.udp.srcPort                : selector;
-            hdr.udp.dstPort                : selector;
+            hdr.udp.dstPort                : selector; */
         }
         actions = {
             set_egress_port(standard_metadata);
@@ -57,7 +68,7 @@
             drop(standard_metadata);
         }
         counters = table0_counter;
-        implementation = ecmp_selector;
+        // implementation = ecmp_selector;
     }
 
     PacketIoIngressControl() packet_io_ingress_control;
diff --git a/tools/test/p4src/p4-16/include/packet_io.p4 b/tools/test/p4src/p4-16/include/packet_io.p4
index 49fe650..6186761 100644
--- a/tools/test/p4src/p4-16/include/packet_io.p4
+++ b/tools/test/p4src/p4-16/include/packet_io.p4
@@ -28,7 +28,7 @@
 control PacketIoEgressControl(inout headers_t hdr, inout standard_metadata_t standard_metadata) {
     apply {
         hdr.packet_out.setInvalid();
-        if (standard_metadata.egress_spec == CPU_PORT) {
+        if (standard_metadata.egress_port == CPU_PORT) {
             hdr.packet_in.setValid();
             hdr.packet_in.ingress_port = standard_metadata.ingress_port;
         }
diff --git a/tools/test/p4src/p4-16/p4c-out/default.json b/tools/test/p4src/p4-16/p4c-out/default.json
index 1d6dcbf..7a26032d 100644
--- a/tools/test/p4src/p4-16/p4c-out/default.json
+++ b/tools/test/p4src/p4-16/p4c-out/default.json
@@ -2486,7 +2486,7 @@
           ],
           "source_info" : {
             "filename" : "include/packet_io.p4",
-            "line" : 7,
+            "line" : 23,
             "column" : 12,
             "source_fragment" : "standard_metadata.egress_spec = hdr.packet_out.egress_port"
           }
@@ -2605,7 +2605,7 @@
           ],
           "source_info" : {
             "filename" : "include/packet_io.p4",
-            "line" : 16,
+            "line" : 32,
             "column" : 12,
             "source_fragment" : "hdr.packet_in.setValid()"
           }
@@ -2624,7 +2624,7 @@
           ],
           "source_info" : {
             "filename" : "include/packet_io.p4",
-            "line" : 17,
+            "line" : 33,
             "column" : 12,
             "source_fragment" : "hdr.packet_in.ingress_port = standard_metadata.ingress_port"
           }
@@ -2646,7 +2646,7 @@
           ],
           "source_info" : {
             "filename" : "include/packet_io.p4",
-            "line" : 14,
+            "line" : 30,
             "column" : 8,
             "source_fragment" : "hdr.packet_out.setInvalid()"
           }
@@ -2660,7 +2660,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "default.p4",
-        "line" : 16,
+        "line" : 32,
         "column" : 8,
         "source_fragment" : "ingress"
       },
@@ -2694,7 +2694,7 @@
           "id" : 1,
           "source_info" : {
             "filename" : "default.p4",
-            "line" : 21,
+            "line" : 44,
             "column" : 10,
             "source_fragment" : "table0"
           },
@@ -2721,8 +2721,7 @@
             }
           ],
           "match_type" : "ternary",
-          "type" : "indirect_ws",
-          "action_profile" : "ecmp_selector",
+          "type" : "simple",
           "max_size" : 1024,
           "support_timeout" : false,
           "direct_meters" : null,
@@ -2734,6 +2733,12 @@
             "send_to_cpu" : "node_6",
             "drop" : "node_6",
             "NoAction" : "node_6"
+          },
+          "default_entry" : {
+            "action_id" : 3,
+            "action_const" : false,
+            "action_data" : [],
+            "action_entry_const" : false
           }
         },
         {
@@ -2760,53 +2765,14 @@
           }
         }
       ],
-      "action_profiles" : [
-        {
-          "name" : "ecmp_selector",
-          "id" : 0,
-          "max_size" : 64,
-          "selector" : {
-            "algo" : "crc16",
-            "input" : [
-              {
-                "type" : "field",
-                "value" : ["ipv4", "srcAddr"]
-              },
-              {
-                "type" : "field",
-                "value" : ["ipv4", "dstAddr"]
-              },
-              {
-                "type" : "field",
-                "value" : ["ipv4", "protocol"]
-              },
-              {
-                "type" : "field",
-                "value" : ["tcp", "srcPort"]
-              },
-              {
-                "type" : "field",
-                "value" : ["tcp", "dstPort"]
-              },
-              {
-                "type" : "field",
-                "value" : ["udp", "srcPort"]
-              },
-              {
-                "type" : "field",
-                "value" : ["udp", "dstPort"]
-              }
-            ]
-          }
-        }
-      ],
+      "action_profiles" : [],
       "conditionals" : [
         {
           "name" : "node_2",
           "id" : 0,
           "source_info" : {
             "filename" : "include/packet_io.p4",
-            "line" : 6,
+            "line" : 22,
             "column" : 12,
             "source_fragment" : "hdr.packet_out.isValid()"
           },
@@ -2832,7 +2798,7 @@
           "id" : 1,
           "source_info" : {
             "filename" : "default.p4",
-            "line" : 52,
+            "line" : 79,
             "column" : 13,
             "source_fragment" : "hdr.packet_out.isValid()"
           },
@@ -2886,7 +2852,7 @@
       "id" : 1,
       "source_info" : {
         "filename" : "default.p4",
-        "line" : 60,
+        "line" : 87,
         "column" : 8,
         "source_fragment" : "egress"
       },
@@ -2946,9 +2912,9 @@
           "id" : 3,
           "source_info" : {
             "filename" : "include/packet_io.p4",
-            "line" : 15,
+            "line" : 31,
             "column" : 12,
-            "source_fragment" : "standard_metadata.egress_spec == CPU_PORT"
+            "source_fragment" : "standard_metadata.egress_port == CPU_PORT"
           },
           "expression" : {
             "type" : "expression",
@@ -2956,7 +2922,7 @@
               "op" : "==",
               "left" : {
                 "type" : "field",
-                "value" : ["standard_metadata", "egress_spec"]
+                "value" : ["standard_metadata", "egress_port"]
               },
               "right" : {
                 "type" : "hexstr",
diff --git a/tools/test/p4src/p4-16/p4c-out/default.p4info b/tools/test/p4src/p4-16/p4c-out/default.p4info
index f898190..bf37f15 100644
--- a/tools/test/p4src/p4-16/p4c-out/default.p4info
+++ b/tools/test/p4src/p4-16/p4c-out/default.p4info
@@ -41,10 +41,8 @@
     id: 16800567
     annotations: "@defaultonly()"
   }
-  implementation_id: 285227860
   direct_resource_ids: 301990488
   size: 1024
-  with_entry_timeout: true
 }
 actions {
   preamble {
@@ -79,16 +77,6 @@
     alias: "NoAction"
   }
 }
-action_profiles {
-  preamble {
-    id: 285227860
-    name: "ecmp_selector"
-    alias: "ecmp_selector"
-  }
-  table_ids: 33617813
-  with_selector: true
-  size: 64
-}
 counters {
   preamble {
     id: 302025528
diff --git a/tools/test/p4src/p4-16/p4c-out/ecmp.json b/tools/test/p4src/p4-16/p4c-out/ecmp.json
index a441844..c416184 100644
--- a/tools/test/p4src/p4-16/p4c-out/ecmp.json
+++ b/tools/test/p4src/p4-16/p4c-out/ecmp.json
@@ -419,7 +419,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "include/parsers.p4",
-        "line" : 64,
+        "line" : 48,
         "column" : 8,
         "source_fragment" : "DeparserImpl"
       },
@@ -445,7 +445,7 @@
       "id" : 2,
       "source_info" : {
         "filename" : "include/port_counters.p4",
-        "line" : 22,
+        "line" : 6,
         "column" : 38,
         "source_fragment" : "egress_port_counter"
       },
@@ -457,7 +457,7 @@
       "id" : 3,
       "source_info" : {
         "filename" : "include/port_counters.p4",
-        "line" : 23,
+        "line" : 7,
         "column" : 38,
         "source_fragment" : "ingress_port_counter"
       },
@@ -529,7 +529,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -548,7 +548,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -567,7 +567,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -586,7 +586,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -605,7 +605,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -624,7 +624,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -643,7 +643,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -662,7 +662,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -681,7 +681,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -700,7 +700,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -719,7 +719,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -738,7 +738,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -757,7 +757,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -776,7 +776,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -795,7 +795,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -814,7 +814,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -833,7 +833,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -852,7 +852,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 27,
+            "line" : 11,
             "column" : 4,
             "source_fragment" : "standard_metadata.egress_spec = port"
           }
@@ -871,7 +871,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -890,7 +890,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -909,7 +909,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -928,7 +928,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -947,7 +947,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -966,7 +966,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -985,7 +985,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1004,7 +1004,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1023,7 +1023,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1042,7 +1042,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1061,7 +1061,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1080,7 +1080,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1099,7 +1099,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1118,7 +1118,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1137,7 +1137,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1156,7 +1156,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1175,7 +1175,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1206,7 +1206,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1225,7 +1225,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1244,7 +1244,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1263,7 +1263,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1282,7 +1282,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1301,7 +1301,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1320,7 +1320,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1339,7 +1339,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1358,7 +1358,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1377,7 +1377,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1396,7 +1396,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1415,7 +1415,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1434,7 +1434,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1453,7 +1453,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1472,7 +1472,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1491,7 +1491,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1510,7 +1510,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1529,7 +1529,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 27,
+            "line" : 11,
             "column" : 4,
             "source_fragment" : "standard_metadata.egress_spec = port"
           }
@@ -1548,7 +1548,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1567,7 +1567,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1586,7 +1586,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1605,7 +1605,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1624,7 +1624,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1643,7 +1643,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1662,7 +1662,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1681,7 +1681,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1700,7 +1700,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1719,7 +1719,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1738,7 +1738,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1757,7 +1757,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1776,7 +1776,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1795,7 +1795,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1814,7 +1814,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1833,7 +1833,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1852,7 +1852,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1890,7 +1890,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1909,7 +1909,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1928,7 +1928,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1947,7 +1947,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1966,7 +1966,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1985,7 +1985,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2004,7 +2004,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2023,7 +2023,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2042,7 +2042,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2061,7 +2061,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2080,7 +2080,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2099,7 +2099,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2118,7 +2118,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2137,7 +2137,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2156,7 +2156,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2175,7 +2175,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2194,7 +2194,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2213,9 +2213,9 @@
           ],
           "source_info" : {
             "filename" : "include/defines.p4",
-            "line" : 28,
+            "line" : 12,
             "column" : 24,
-            "source_fragment" : "0x00FF; ..."
+            "source_fragment" : "255; ..."
           }
         },
         {
@@ -2232,7 +2232,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2251,7 +2251,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2270,7 +2270,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2289,7 +2289,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2308,7 +2308,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2327,7 +2327,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2346,7 +2346,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2365,7 +2365,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2384,7 +2384,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2403,7 +2403,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2422,7 +2422,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2441,7 +2441,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2460,7 +2460,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2479,7 +2479,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2498,7 +2498,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2517,7 +2517,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2536,7 +2536,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2562,7 +2562,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2581,7 +2581,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2600,7 +2600,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2619,7 +2619,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2638,7 +2638,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2657,7 +2657,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2676,7 +2676,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2695,7 +2695,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2714,7 +2714,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2733,7 +2733,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2752,7 +2752,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2771,7 +2771,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2790,7 +2790,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2809,7 +2809,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2828,7 +2828,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2847,7 +2847,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2866,7 +2866,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2885,7 +2885,7 @@
           ],
           "source_info" : {
             "filename" : "include/defines.p4",
-            "line" : 29,
+            "line" : 13,
             "column" : 25,
             "source_fragment" : "511; ..."
           }
@@ -2904,7 +2904,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2923,7 +2923,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2942,7 +2942,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2961,7 +2961,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2980,7 +2980,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2999,7 +2999,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3018,7 +3018,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3037,7 +3037,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3056,7 +3056,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3075,7 +3075,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3094,7 +3094,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3113,7 +3113,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3132,7 +3132,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3151,7 +3151,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3170,7 +3170,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3189,7 +3189,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3208,7 +3208,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3243,7 +3243,7 @@
           ],
           "source_info" : {
             "filename" : "ecmp.p4",
-            "line" : 48,
+            "line" : 32,
             "column" : 8,
             "source_fragment" : "meta.ecmp_metadata.group_id = group_id"
           }
@@ -3296,7 +3296,7 @@
           ],
           "source_info" : {
             "filename" : "ecmp.p4",
-            "line" : 49,
+            "line" : 33,
             "column" : 8,
             "source_fragment" : "hash(meta.ecmp_metadata.selector, HashAlgorithm.crc16, (bit<64>)0, ..."
           }
@@ -3374,7 +3374,7 @@
           ],
           "source_info" : {
             "filename" : "include/port_counters.p4",
-            "line" : 27,
+            "line" : 11,
             "column" : 12,
             "source_fragment" : "ingress_port_counter.count((bit<32>)standard_metadata.ingress_port)"
           }
@@ -3419,7 +3419,7 @@
           ],
           "source_info" : {
             "filename" : "include/port_counters.p4",
-            "line" : 28,
+            "line" : 12,
             "column" : 12,
             "source_fragment" : "egress_port_counter.count((bit<32>)standard_metadata.egress_spec)"
           }
@@ -3496,7 +3496,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "ecmp.p4",
-        "line" : 42,
+        "line" : 26,
         "column" : 8,
         "source_fragment" : "ingress"
       },
@@ -3530,7 +3530,7 @@
           "id" : 1,
           "source_info" : {
             "filename" : "ecmp.p4",
-            "line" : 66,
+            "line" : 50,
             "column" : 10,
             "source_fragment" : "table0"
           },
@@ -3583,7 +3583,7 @@
           "id" : 2,
           "source_info" : {
             "filename" : "ecmp.p4",
-            "line" : 55,
+            "line" : 39,
             "column" : 10,
             "source_fragment" : "ecmp_group_table"
           },
@@ -3675,7 +3675,7 @@
           "id" : 1,
           "source_info" : {
             "filename" : "ecmp.p4",
-            "line" : 88,
+            "line" : 72,
             "column" : 13,
             "source_fragment" : "hdr.packet_out.isValid()"
           },
@@ -3701,7 +3701,7 @@
           "id" : 2,
           "source_info" : {
             "filename" : "include/port_counters.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 12,
             "source_fragment" : "standard_metadata.egress_spec < 254"
           },
@@ -3729,7 +3729,7 @@
       "id" : 1,
       "source_info" : {
         "filename" : "ecmp.p4",
-        "line" : 99,
+        "line" : 83,
         "column" : 8,
         "source_fragment" : "egress"
       },
@@ -3791,7 +3791,7 @@
             "filename" : "include/packet_io.p4",
             "line" : 31,
             "column" : 12,
-            "source_fragment" : "standard_metadata.egress_spec == CPU_PORT"
+            "source_fragment" : "standard_metadata.egress_port == CPU_PORT"
           },
           "expression" : {
             "type" : "expression",
@@ -3799,7 +3799,7 @@
               "op" : "==",
               "left" : {
                 "type" : "field",
-                "value" : ["standard_metadata", "egress_spec"]
+                "value" : ["standard_metadata", "egress_port"]
               },
               "right" : {
                 "type" : "hexstr",
diff --git a/tools/test/p4src/p4-16/p4c-out/empty.json b/tools/test/p4src/p4-16/p4c-out/empty.json
index 8da30fa..d308780 100644
--- a/tools/test/p4src/p4-16/p4c-out/empty.json
+++ b/tools/test/p4src/p4-16/p4c-out/empty.json
@@ -107,7 +107,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "empty.p4",
-        "line" : 60,
+        "line" : 44,
         "column" : 8,
         "source_fragment" : "DeparserImpl"
       },
@@ -145,7 +145,7 @@
           ],
           "source_info" : {
             "filename" : "empty.p4",
-            "line" : 39,
+            "line" : 23,
             "column" : 8,
             "source_fragment" : "meta.dummy_metadata.dummyField = 8w1"
           }
@@ -159,7 +159,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "empty.p4",
-        "line" : 37,
+        "line" : 21,
         "column" : 8,
         "source_fragment" : "ingress"
       },
@@ -170,7 +170,7 @@
           "id" : 0,
           "source_info" : {
             "filename" : "empty.p4",
-            "line" : 41,
+            "line" : 25,
             "column" : 10,
             "source_fragment" : "table0"
           },
@@ -210,7 +210,7 @@
       "id" : 1,
       "source_info" : {
         "filename" : "empty.p4",
-        "line" : 54,
+        "line" : 38,
         "column" : 8,
         "source_fragment" : "egress"
       },
diff --git a/tools/test/p4src/p4-16/p4c-out/wcmp.json b/tools/test/p4src/p4-16/p4c-out/wcmp.json
index eeb1bcc..6e57c49 100644
--- a/tools/test/p4src/p4-16/p4c-out/wcmp.json
+++ b/tools/test/p4src/p4-16/p4c-out/wcmp.json
@@ -419,7 +419,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "include/parsers.p4",
-        "line" : 64,
+        "line" : 48,
         "column" : 8,
         "source_fragment" : "DeparserImpl"
       },
@@ -445,7 +445,7 @@
       "id" : 2,
       "source_info" : {
         "filename" : "include/port_counters.p4",
-        "line" : 22,
+        "line" : 6,
         "column" : 38,
         "source_fragment" : "egress_port_counter"
       },
@@ -457,7 +457,7 @@
       "id" : 3,
       "source_info" : {
         "filename" : "include/port_counters.p4",
-        "line" : 23,
+        "line" : 7,
         "column" : 38,
         "source_fragment" : "ingress_port_counter"
       },
@@ -529,7 +529,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -548,7 +548,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -567,7 +567,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -586,7 +586,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -605,7 +605,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -624,7 +624,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -643,7 +643,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -662,7 +662,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -681,7 +681,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -700,7 +700,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -719,7 +719,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -738,7 +738,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -757,7 +757,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -776,7 +776,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -795,7 +795,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -814,7 +814,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -833,7 +833,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -852,7 +852,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 27,
+            "line" : 11,
             "column" : 4,
             "source_fragment" : "standard_metadata.egress_spec = port"
           }
@@ -871,7 +871,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -890,7 +890,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -909,7 +909,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -928,7 +928,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -947,7 +947,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -966,7 +966,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -985,7 +985,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1004,7 +1004,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1023,7 +1023,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1042,7 +1042,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1061,7 +1061,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1080,7 +1080,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1099,7 +1099,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1118,7 +1118,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1137,7 +1137,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1156,7 +1156,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1175,7 +1175,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1206,7 +1206,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1225,7 +1225,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1244,7 +1244,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1263,7 +1263,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1282,7 +1282,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1301,7 +1301,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1320,7 +1320,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1339,7 +1339,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1358,7 +1358,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1377,7 +1377,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1396,7 +1396,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1415,7 +1415,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1434,7 +1434,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1453,7 +1453,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1472,7 +1472,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1491,7 +1491,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1510,7 +1510,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1529,7 +1529,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 27,
+            "line" : 11,
             "column" : 4,
             "source_fragment" : "standard_metadata.egress_spec = port"
           }
@@ -1548,7 +1548,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1567,7 +1567,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1586,7 +1586,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1605,7 +1605,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1624,7 +1624,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1643,7 +1643,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1662,7 +1662,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1681,7 +1681,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1700,7 +1700,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1719,7 +1719,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1738,7 +1738,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1757,7 +1757,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1776,7 +1776,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1795,7 +1795,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1814,7 +1814,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1833,7 +1833,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1852,7 +1852,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 49,
             "source_fragment" : "standard_metadata, port_t port) { ..."
           }
@@ -1878,7 +1878,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1897,7 +1897,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1916,7 +1916,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1935,7 +1935,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1954,7 +1954,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1973,7 +1973,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -1992,7 +1992,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2011,7 +2011,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2030,7 +2030,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2049,7 +2049,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2068,7 +2068,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2087,7 +2087,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2106,7 +2106,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2125,7 +2125,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2144,7 +2144,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2163,7 +2163,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2182,7 +2182,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2201,9 +2201,9 @@
           ],
           "source_info" : {
             "filename" : "include/defines.p4",
-            "line" : 28,
+            "line" : 12,
             "column" : 24,
-            "source_fragment" : "0x00FF; ..."
+            "source_fragment" : "255; ..."
           }
         },
         {
@@ -2220,7 +2220,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2239,7 +2239,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2258,7 +2258,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2277,7 +2277,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2296,7 +2296,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2315,7 +2315,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2334,7 +2334,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2353,7 +2353,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2372,7 +2372,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2391,7 +2391,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2410,7 +2410,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2429,7 +2429,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2448,7 +2448,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2467,7 +2467,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2486,7 +2486,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2505,7 +2505,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2524,7 +2524,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 22,
+            "line" : 6,
             "column" : 45,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2550,7 +2550,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2569,7 +2569,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2588,7 +2588,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2607,7 +2607,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2626,7 +2626,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2645,7 +2645,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2664,7 +2664,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2683,7 +2683,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2702,7 +2702,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2721,7 +2721,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2740,7 +2740,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2759,7 +2759,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2778,7 +2778,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2797,7 +2797,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2816,7 +2816,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2835,7 +2835,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2854,7 +2854,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2873,7 +2873,7 @@
           ],
           "source_info" : {
             "filename" : "include/defines.p4",
-            "line" : 29,
+            "line" : 13,
             "column" : 25,
             "source_fragment" : "511; ..."
           }
@@ -2892,7 +2892,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2911,7 +2911,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2930,7 +2930,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2949,7 +2949,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2968,7 +2968,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -2987,7 +2987,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3006,7 +3006,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3025,7 +3025,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3044,7 +3044,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3063,7 +3063,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3082,7 +3082,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3101,7 +3101,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3120,7 +3120,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3139,7 +3139,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3158,7 +3158,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3177,7 +3177,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3196,7 +3196,7 @@
           ],
           "source_info" : {
             "filename" : "include/actions.p4",
-            "line" : 30,
+            "line" : 14,
             "column" : 38,
             "source_fragment" : "standard_metadata) { ..."
           }
@@ -3239,7 +3239,7 @@
           ],
           "source_info" : {
             "filename" : "wcmp.p4",
-            "line" : 50,
+            "line" : 34,
             "column" : 8,
             "source_fragment" : "meta.wcmp_metadata.group_id = group_id"
           }
@@ -3266,7 +3266,7 @@
           ],
           "source_info" : {
             "filename" : "wcmp.p4",
-            "line" : 51,
+            "line" : 35,
             "column" : 8,
             "source_fragment" : "hash(meta.wcmp_metadata.numBits, HashAlgorithm.crc16, (bit<64>)2, ..."
           }
@@ -3375,7 +3375,7 @@
           ],
           "source_info" : {
             "filename" : "wcmp.p4",
-            "line" : 58,
+            "line" : 42,
             "column" : 8,
             "source_fragment" : "meta.wcmp_metadata.selector = ((ONE << meta.wcmp_metadata.numBits) - ONE) << (64 - meta.wcmp_metadata.numBits)"
           }
@@ -3453,7 +3453,7 @@
           ],
           "source_info" : {
             "filename" : "include/port_counters.p4",
-            "line" : 27,
+            "line" : 11,
             "column" : 12,
             "source_fragment" : "ingress_port_counter.count((bit<32>)standard_metadata.ingress_port)"
           }
@@ -3498,7 +3498,7 @@
           ],
           "source_info" : {
             "filename" : "include/port_counters.p4",
-            "line" : 28,
+            "line" : 12,
             "column" : 12,
             "source_fragment" : "egress_port_counter.count((bit<32>)standard_metadata.egress_spec)"
           }
@@ -3575,7 +3575,7 @@
       "id" : 0,
       "source_info" : {
         "filename" : "wcmp.p4",
-        "line" : 44,
+        "line" : 28,
         "column" : 8,
         "source_fragment" : "ingress"
       },
@@ -3609,7 +3609,7 @@
           "id" : 1,
           "source_info" : {
             "filename" : "wcmp.p4",
-            "line" : 61,
+            "line" : 45,
             "column" : 10,
             "source_fragment" : "table0"
           },
@@ -3685,7 +3685,7 @@
           "id" : 3,
           "source_info" : {
             "filename" : "wcmp.p4",
-            "line" : 78,
+            "line" : 62,
             "column" : 10,
             "source_fragment" : "wcmp_group_table"
           },
@@ -3777,7 +3777,7 @@
           "id" : 1,
           "source_info" : {
             "filename" : "wcmp.p4",
-            "line" : 94,
+            "line" : 78,
             "column" : 13,
             "source_fragment" : "hdr.packet_out.isValid()"
           },
@@ -3803,7 +3803,7 @@
           "id" : 2,
           "source_info" : {
             "filename" : "include/port_counters.p4",
-            "line" : 26,
+            "line" : 10,
             "column" : 12,
             "source_fragment" : "standard_metadata.egress_spec < 254"
           },
@@ -3831,7 +3831,7 @@
       "id" : 1,
       "source_info" : {
         "filename" : "wcmp.p4",
-        "line" : 106,
+        "line" : 90,
         "column" : 8,
         "source_fragment" : "egress"
       },
@@ -3893,7 +3893,7 @@
             "filename" : "include/packet_io.p4",
             "line" : 31,
             "column" : 12,
-            "source_fragment" : "standard_metadata.egress_spec == CPU_PORT"
+            "source_fragment" : "standard_metadata.egress_port == CPU_PORT"
           },
           "expression" : {
             "type" : "expression",
@@ -3901,7 +3901,7 @@
               "op" : "==",
               "left" : {
                 "type" : "field",
-                "value" : ["standard_metadata", "egress_spec"]
+                "value" : ["standard_metadata", "egress_port"]
               },
               "right" : {
                 "type" : "hexstr",