def METHOD_NAME(platform, p4info_path, p4info_out_path):
    """
    Translate to NP4 compatible p4info
    """
    p4info = p4info_pb2.P4Info()
    with open(p4info_path, 'r') as p4info_f:
        text_format.Merge(p4info_f.read(), p4info)
    # Spin through tables
    for table in p4info.tables:
         # Look for "standard_metadata" match fields
         for mf in table.match_fields:
            if platform == "np4":
                if mf.name.startswith("standard_metadata"):
                    mf.name = mf.name.replace("standard", "intrinsic");
                    mf.bitwidth = 8;
                elif mf.name == "vlan_tag.$valid$":
                    mf.name = "vlan_tag"
    if platform == "np4":
        # Spin through actions
        for action in p4info.actions:
            # Look for "port_num" param
            for p in action.params:
                if p.name == "port_num":
                    p.bitwidth = 8
    # Add the packet in controller packet metadata
    cpm = p4info.controller_packet_metadata.add()
    cpm.preamble.id = 67146229
    cpm.preamble.name = "packet_in"
    cpm.preamble.alias = "packet_in"
    metadata = cpm.metadata.add()
    metadata.id = 1
    metadata.name = "ingress_port"
    metadata.bitwidth = 9
    metadata = cpm.metadata.add()
    metadata.id = 2
    metadata.name = "_pad"
    metadata.bitwidth = 7
    # Add the packet out controller packet metadata
    cpm = p4info.controller_packet_metadata.add()
    cpm.preamble.id = 67121543
    cpm.preamble.name = "packet_out"
    cpm.preamble.alias = "packet_out"
    metadata = cpm.metadata.add()
    metadata.id = 1
    metadata.name = "egress_port"
    metadata.bitwidth = 9
    metadata = cpm.metadata.add()
    metadata.id = 2
    metadata.name = "_pad"
    metadata.bitwidth = 7
    # Write out new p4info
    with open(p4info_out_path, 'w') as f:
        f.write(text_format.MessageToString(p4info))
    print("P4Info successfully translated to {}".format(p4info_out_path))