Adding tofino port tool to repo to have unique location and source of truth

Change-Id: I8ad0cd951b805f1ccc627afee2c4487d46b4b7e1
diff --git a/tools/test/tofino-port-auto-setup-tool/37-port-config.txt b/tools/test/tofino-port-auto-setup-tool/37-port-config.txt
new file mode 100644
index 0000000..694fcde
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/37-port-config.txt
@@ -0,0 +1,3 @@
+1/0 BF_SPEED_100G BF_FEC_TYP_NONE
+2/0 BF_SPEED_100G BF_FEC_TYP_NONE
+3/0 BF_SPEED_40G BF_FEC_TYP_NONE
diff --git a/tools/test/tofino-port-auto-setup-tool/38-port-config.txt b/tools/test/tofino-port-auto-setup-tool/38-port-config.txt
new file mode 100644
index 0000000..694fcde
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/38-port-config.txt
@@ -0,0 +1,3 @@
+1/0 BF_SPEED_100G BF_FEC_TYP_NONE
+2/0 BF_SPEED_100G BF_FEC_TYP_NONE
+3/0 BF_SPEED_40G BF_FEC_TYP_NONE
diff --git a/tools/test/tofino-port-auto-setup-tool/39-port-config.txt b/tools/test/tofino-port-auto-setup-tool/39-port-config.txt
new file mode 100644
index 0000000..d1df068
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/39-port-config.txt
@@ -0,0 +1,2 @@
+1/0 BF_SPEED_100G BF_FEC_TYP_NONE
+2/0 BF_SPEED_100G BF_FEC_TYP_NONE
diff --git a/tools/test/tofino-port-auto-setup-tool/40-port-config.txt b/tools/test/tofino-port-auto-setup-tool/40-port-config.txt
new file mode 100644
index 0000000..d1df068
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/40-port-config.txt
@@ -0,0 +1,2 @@
+1/0 BF_SPEED_100G BF_FEC_TYP_NONE
+2/0 BF_SPEED_100G BF_FEC_TYP_NONE
diff --git a/tools/test/tofino-port-auto-setup-tool/README.md b/tools/test/tofino-port-auto-setup-tool/README.md
new file mode 100644
index 0000000..5c75b42
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/README.md
@@ -0,0 +1,65 @@
+Tofino auto setup script
+====
+
+## Infra
+```
+.
+├── 37-port-config.txt  # port configs
+├── 38-port-config.txt
+├── 39-port-config.txt
+├── 40-port-config.txt
+├── README              # this file
+├── pm.py               # port manager main program
+├── ports-32x.txt       # ports information dump from switches
+├── ports-65x.txt
+├── ports.json          # ports/channels to device port mapping file
+├── push-all-port-configs.sh  # demo script
+└── thrift              # thrift folder
+    ├── gen-py          # generated from pltfm_pm_rpc.thrift wtih thrift compiler
+    │   ├── __init__.py
+    │   └── pltfm_pm_rpc
+    │       ├── __init__.py
+    │       ├── constants.py
+    │       ├── pltfm_pm_rpc-remote
+    │       ├── pltfm_pm_rpc.py
+    │       ├── ttypes.py
+    └── pltfm_pm_rpc.thrift  # thrift definition for port manager RPC
+```
+
+## Usage
+```
+pm.py [-h] [--port PORT] [--ports-file PORTS_FILE] ip port_config
+
+Tofino port manager tool
+
+positional arguments:
+  ip                    IP of BF-Platfrom
+  port_config           Port configuration
+
+optional arguments:
+  -h, --help            show this help message and exit
+  --port PORT           Port of BF-Platfrom
+  --ports-file PORTS_FILE
+                        A json file which defines ports
+```
+
+## Port config file example
+```
+1/0 BF_SPEED_100G BF_FEC_TYP_NONE
+2/0 BF_SPEED_100G BF_FEC_TYP_NONE
+3/0 BF_SPEED_40G BF_FEC_TYP_NONE
+```
+
+## ports.json
+```
+{
+	"board_type": [
+		[],
+		[PORT1_CHNL0_DP, PORT1_CHNL1_DP, PORT1_CHNL2_DP, PORT1_CHNL3_DP],
+		[PORT2_CHNL0_DP, PORT2_CHNL1_DP, PORT2_CHNL2_DP, PORT2_CHNL3_DP],
+		.........
+	],
+	......
+}
+
+```
diff --git a/tools/test/tofino-port-auto-setup-tool/pm.py b/tools/test/tofino-port-auto-setup-tool/pm.py
new file mode 100755
index 0000000..d93166d
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/pm.py
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+
+import sys
+import glob
+import json
+import argparse
+
+sys.path.append('thrift/gen-py')
+
+from pltfm_pm_rpc.pltfm_pm_rpc import Client
+from pltfm_pm_rpc.ttypes import InvalidPltfmPmOperation
+from pltfm_pm_rpc.ttypes import pltfm_pm_port_speed_t, pltfm_pm_fec_type_t
+from pltfm_pm_rpc.ttypes import pltfm_pm_board_type_t
+from thrift import Thrift
+from thrift.transport import TSocket
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol
+from thrift.protocol import TMultiplexedProtocol
+
+
+class PortMgr:
+    """ Port Manager """
+
+    def __init__(self, serverIp, serverPort=9095, portsDef={}):
+        self.serverIp = serverIp
+        self.serverPort = serverPort
+        self.portsDef = portsDef
+        self.broadType = None
+        self.transport = TSocket.TSocket(serverIp, serverPort)
+        self.transport = TTransport.TBufferedTransport(self.transport)
+        self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)
+        self.protocol = TMultiplexedProtocol.TMultiplexedProtocol(self.protocol, "pltfm_pm_rpc")
+        self.client = Client(self.protocol)
+
+    def __enter__(self):
+        self.transport.open()
+        bd_id = self.getBroadType()
+        self.broadType = pltfm_pm_board_type_t._VALUES_TO_NAMES[bd_id]
+        self.log("Connected, broad type: %s" % (self.broadType))
+        return self
+
+    def __exit__(self, type, value, traceback):
+        self.transport.close()
+        self.log("Disconnected")
+
+    def log(self, msg):
+        print "[%s] %s" % (self.serverIp, msg)
+
+    def portCleanup(self, deviceId=0):
+        self.log("Cleaning up all ports")
+        # clean up is not working.....
+        # return self.client.pltfm_pm_switchd_port_cleanup(deviceId)
+        # try disable all ports and delete all ports
+        for portDef in self.portsDef[self.broadType]:
+            for dp in portDef:
+                try:
+                    if self._getPortStatus(dp, deviceId) != -1:
+                        self.client.pltfm_pm_port_dis(deviceId, dp)
+                        self.client.pltfm_pm_port_del(deviceId, dp)
+                except Exception as e:
+                    raise e
+
+    def getPortStatus(self, portNum, channelNum=0, deviceId=0):
+        dp = self.portsDef[self.broadType][portNum][channelNum]
+        return self._getPortStatus(dp, deviceId)
+
+    def _getPortStatus(self, dp, deviceId=0):
+        try:
+            result = self.client.pltfm_pm_port_oper_status_get(deviceId, dp)
+            return result
+        except InvalidPltfmPmOperation as e:
+            return -1
+
+    def addPort(self, portNum, channelNum=0, deviceId=0,
+                speed=pltfm_pm_port_speed_t.BF_SPEED_100G,
+                fecType=pltfm_pm_fec_type_t.BF_FEC_TYP_NONE):
+        self.log("Adding port %d/%d with speed %s fec %s"
+                 % (portNum, channelNum, speed, fecType))
+        dp = self.portsDef[self.broadType][portNum][channelNum]
+        try:
+            result = self.client.pltfm_pm_port_add(deviceId, dp, speed, fecType)
+            self.log("Port %d/%d added" % (portNum, channelNum))
+            return result
+        except InvalidPltfmPmOperation as e:
+            self.log("Can't add port %d/%d, code: %d" % (portNum, channelNum, e.code))
+
+    def enablePort(self, portNum, channelNum=0, deviceId=0):
+        self.log("Enabling port %d/%d" % (portNum, channelNum))
+        dp = self.portsDef[self.broadType][portNum][channelNum]
+        try:
+            result = self.client.pltfm_pm_port_enable(deviceId, dp)
+            self.log("Port %d/%d enabled" % (portNum, channelNum))
+            return result
+        except Exception as e:
+            self.log("Can't enable port %d/%d, code: %d" % (portNum, channelNum, e.code))
+
+    def getBroadType(self):
+        return self.client.pltfm_pm_board_type_get();
+
+
+def main(args):
+    with open(args.ports_file) as portsFile:
+        portsDef = json.load(portsFile)
+    with PortMgr(args.ip, args.port, portsDef) as portMgr:
+        if args.do_cleanup:
+            portMgr.portCleanup()
+        with open(args.port_config) as portConfig:
+            for line in portConfig:
+                if len(line) == 0:
+                    continue
+                line = line.strip()
+                info = line.split(' ')
+                portChannel = info[0]
+                speed = pltfm_pm_port_speed_t._NAMES_TO_VALUES[info[1]]
+                fecType = pltfm_pm_fec_type_t._NAMES_TO_VALUES[info[2]]
+                portNum = int(portChannel.split('/')[0])
+                channelNum = int(portChannel.split('/')[1])
+                portMgr.addPort(portNum, channelNum, speed=speed, fecType=fecType)
+                portMgr.enablePort(portNum, channelNum)
+
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='Tofino port manager tool')
+    parser.add_argument('ip', help='IP of BF-Platfrom')
+    parser.add_argument('port_config', help='Port configuration')
+    parser.add_argument('--port', type=int, help='Port of BF-Platfrom', default=9095)
+    parser.add_argument('--ports-file', help='A json file which defines ports',
+                        default='ports.json')
+    parser.add_argument('--do-cleanup', help='Performs port cleanup',
+                        type=bool, default=False)
+
+    args = parser.parse_args()
+    main(args)
diff --git a/tools/test/tofino-port-auto-setup-tool/ports-32x.txt b/tools/test/tofino-port-auto-setup-tool/ports-32x.txt
new file mode 100644
index 0000000..ffac3fc
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/ports-32x.txt
@@ -0,0 +1,135 @@
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+PORT|MAC |D_P|P/PT|SPEED |FEC |QSFP|ADM|OPR|FRAMES RX       |FRAMES TX       |E
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+ 1/0|47/0|128|3/ 0| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 1/1|47/1|129|3/ 1| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 1/2|47/2|130|3/ 2| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 1/3|47/3|131|3/ 3| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/0|45/0|136|3/ 8| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/1|45/1|137|3/ 9| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/2|45/2|138|3/10| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/3|45/3|139|3/11| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 3/0|43/0|144|3/16| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 3/1|43/1|145|3/17| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 3/2|43/2|146|3/18| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 3/3|43/3|147|3/19| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/0|41/0|152|3/24| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/1|41/1|153|3/25| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/2|41/2|154|3/26| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/3|41/3|155|3/27| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/0|39/0|160|3/32| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/1|39/1|161|3/33| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/2|39/2|162|3/34| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/3|39/3|163|3/35| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/0|37/0|168|3/40| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/1|37/1|169|3/41| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/2|37/2|170|3/42| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/3|37/3|171|3/43| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/0|35/0|176|3/48| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/1|35/1|177|3/49| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/2|35/2|178|3/50| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/3|35/3|179|3/51| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/0|33/0|184|3/56| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/1|33/1|185|3/57| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/2|33/2|186|3/58| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/3|33/3|187|3/59| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/0|31/0| 60|1/60| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/1|31/1| 61|1/61| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/2|31/2| 62|1/62| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/3|31/3| 63|1/63| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/0|29/0| 52|1/52| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/1|29/1| 53|1/53| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/2|29/2| 54|1/54| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/3|29/3| 55|1/55| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/0|27/0| 44|1/44| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/1|27/1| 45|1/45| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/2|27/2| 46|1/46| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/3|27/3| 47|1/47| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/0|25/0| 36|1/36| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/1|25/1| 37|1/37| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/2|25/2| 38|1/38| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/3|25/3| 39|1/39| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/0|23/0| 28|1/28| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/1|23/1| 29|1/29| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/2|23/2| 30|1/30| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/3|23/3| 31|1/31| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/0|21/0| 20|1/20| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/1|21/1| 21|1/21| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/2|21/2| 22|1/22| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/3|21/3| 23|1/23| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/0|19/0| 12|1/12| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/1|19/1| 13|1/13| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/2|19/2| 14|1/14| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/3|19/3| 15|1/15| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/0|17/0|  4|1/ 4| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/1|17/1|  5|1/ 5| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/2|17/2|  6|1/ 6| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/3|17/3|  7|1/ 7| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/0|15/0|  0|1/ 0| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/1|15/1|  1|1/ 1| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/2|15/2|  2|1/ 2| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/3|15/3|  3|1/ 3| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/0|13/0|  8|1/ 8| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/1|13/1|  9|1/ 9| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/2|13/2| 10|1/10| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/3|13/3| 11|1/11| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/0|11/0| 16|1/16| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/1|11/1| 17|1/17| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/2|11/2| 18|1/18| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/3|11/3| 19|1/19| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/0| 9/0| 24|1/24| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/1| 9/1| 25|1/25| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/2| 9/2| 26|1/26| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/3| 9/3| 27|1/27| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/0| 7/0| 32|1/32| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/1| 7/1| 33|1/33| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/2| 7/2| 34|1/34| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/3| 7/3| 35|1/35| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/0| 5/0| 40|1/40| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/1| 5/1| 41|1/41| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/2| 5/2| 42|1/42| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/3| 5/3| 43|1/43| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/0| 3/0| 48|1/48| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/1| 3/1| 49|1/49| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/2| 3/2| 50|1/50| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/3| 3/3| 51|1/51| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/0| 1/0| 56|1/56| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/1| 1/1| 57|1/57| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/2| 1/2| 58|1/58| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/3| 1/3| 59|1/59| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/0|63/0|188|3/60| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/1|63/1|189|3/61| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/2|63/2|190|3/62| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/3|63/3|191|3/63| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/0|61/0|180|3/52| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/1|61/1|181|3/53| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/2|61/2|182|3/54| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/3|61/3|183|3/55| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/0|59/0|172|3/44| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/1|59/1|173|3/45| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/2|59/2|174|3/46| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/3|59/3|175|3/47| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/0|57/0|164|3/36| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/1|57/1|165|3/37| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/2|57/2|166|3/38| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/3|57/3|167|3/39| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/0|53/0|148|3/20| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/1|53/1|149|3/21| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/2|53/2|150|3/22| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/3|53/3|151|3/23| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/0|55/0|156|3/28| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/1|55/1|157|3/29| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/2|55/2|158|3/30| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/3|55/3|159|3/31| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/0|49/0|132|3/ 4| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/1|49/1|133|3/ 5| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/2|49/2|134|3/ 6| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/3|49/3|135|3/ 7| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/0|51/0|140|3/12| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/1|51/1|141|3/13| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/2|51/2|142|3/14| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/3|51/3|143|3/15| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/0|64/0| 64|1/64| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/1|64/1| 65|1/65| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/2|64/2| 66|1/66| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/3|64/3| 67|1/67| 10G  |NONE| NO |DIS|DWN|               0|               0|
diff --git a/tools/test/tofino-port-auto-setup-tool/ports-65x.txt b/tools/test/tofino-port-auto-setup-tool/ports-65x.txt
new file mode 100644
index 0000000..3e94748
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/ports-65x.txt
@@ -0,0 +1,271 @@
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+PORT|MAC |D_P|P/PT|SPEED |FEC |QSFP|ADM|OPR|FRAMES RX       |FRAMES TX       |E
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+ 1/0|31/0|188|1/60| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 1/1|31/1|189|1/61| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 1/2|31/2|190|1/62| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 1/3|31/3|191|1/63| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/0|30/0|184|1/56| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/1|30/1|185|1/57| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/2|30/2|186|1/58| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 2/3|30/3|187|1/59| 10G  |NONE|YES |DIS|DWN|               0|               0|
+ 3/0|29/0|180|1/52| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 3/1|29/1|181|1/53| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 3/2|29/2|182|1/54| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 3/3|29/3|183|1/55| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/0|28/0|176|1/48| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/1|28/1|177|1/49| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/2|28/2|178|1/50| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 4/3|28/3|179|1/51| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/0|27/0|172|1/44| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/1|27/1|173|1/45| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/2|27/2|174|1/46| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 5/3|27/3|175|1/47| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/0|26/0|168|1/40| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/1|26/1|169|1/41| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/2|26/2|170|1/42| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 6/3|26/3|171|1/43| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/0|25/0|164|1/36| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/1|25/1|165|1/37| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/2|25/2|166|1/38| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 7/3|25/3|167|1/39| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/0|24/0|160|1/32| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/1|24/1|161|1/33| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/2|24/2|162|1/34| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 8/3|24/3|163|1/35| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/0|23/0|156|1/28| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/1|23/1|157|1/29| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/2|23/2|158|1/30| 10G  |NONE| NO |DIS|DWN|               0|               0|
+ 9/3|23/3|159|1/31| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/0|22/0|152|1/24| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/1|22/1|153|1/25| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/2|22/2|154|1/26| 10G  |NONE| NO |DIS|DWN|               0|               0|
+10/3|22/3|155|1/27| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/0|21/0|148|1/20| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/1|21/1|149|1/21| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/2|21/2|150|1/22| 10G  |NONE| NO |DIS|DWN|               0|               0|
+11/3|21/3|151|1/23| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/0|20/0|144|1/16| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/1|20/1|145|1/17| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/2|20/2|146|1/18| 10G  |NONE| NO |DIS|DWN|               0|               0|
+12/3|20/3|147|1/19| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/0|19/0|140|1/12| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/1|19/1|141|1/13| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/2|19/2|142|1/14| 10G  |NONE| NO |DIS|DWN|               0|               0|
+13/3|19/3|143|1/15| 10G  |NONE| NO |DIS|DWN|               0|               0|
+PORT|MAC |D_P|P/PT|SPEED |FEC |QSFP|ADM|OPR|FRAMES RX       |FRAMES TX       |E
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+14/0|18/0|136|1/ 8| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/1|18/1|137|1/ 9| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/2|18/2|138|1/10| 10G  |NONE| NO |DIS|DWN|               0|               0|
+14/3|18/3|139|1/11| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/0|17/0|132|1/ 4| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/1|17/1|133|1/ 5| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/2|17/2|134|1/ 6| 10G  |NONE| NO |DIS|DWN|               0|               0|
+15/3|17/3|135|1/ 7| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/0|16/0|128|1/ 0| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/1|16/1|129|1/ 1| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/2|16/2|130|1/ 2| 10G  |NONE| NO |DIS|DWN|               0|               0|
+16/3|16/3|131|1/ 3| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/0|15/0|  0|0/ 0| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/1|15/1|  1|0/ 1| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/2|15/2|  2|0/ 2| 10G  |NONE| NO |DIS|DWN|               0|               0|
+17/3|15/3|  3|0/ 3| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/0|14/0|  4|0/ 4| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/1|14/1|  5|0/ 5| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/2|14/2|  6|0/ 6| 10G  |NONE| NO |DIS|DWN|               0|               0|
+18/3|14/3|  7|0/ 7| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/0|13/0|  8|0/ 8| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/1|13/1|  9|0/ 9| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/2|13/2| 10|0/10| 10G  |NONE| NO |DIS|DWN|               0|               0|
+19/3|13/3| 11|0/11| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/0|12/0| 12|0/12| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/1|12/1| 13|0/13| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/2|12/2| 14|0/14| 10G  |NONE| NO |DIS|DWN|               0|               0|
+20/3|12/3| 15|0/15| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/0|11/0| 16|0/16| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/1|11/1| 17|0/17| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/2|11/2| 18|0/18| 10G  |NONE| NO |DIS|DWN|               0|               0|
+21/3|11/3| 19|0/19| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/0|10/0| 20|0/20| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/1|10/1| 21|0/21| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/2|10/2| 22|0/22| 10G  |NONE| NO |DIS|DWN|               0|               0|
+22/3|10/3| 23|0/23| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/0| 9/0| 24|0/24| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/1| 9/1| 25|0/25| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/2| 9/2| 26|0/26| 10G  |NONE| NO |DIS|DWN|               0|               0|
+23/3| 9/3| 27|0/27| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/0| 8/0| 28|0/28| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/1| 8/1| 29|0/29| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/2| 8/2| 30|0/30| 10G  |NONE| NO |DIS|DWN|               0|               0|
+24/3| 8/3| 31|0/31| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/0| 7/0| 32|0/32| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/1| 7/1| 33|0/33| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/2| 7/2| 34|0/34| 10G  |NONE| NO |DIS|DWN|               0|               0|
+25/3| 7/3| 35|0/35| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/0| 6/0| 36|0/36| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/1| 6/1| 37|0/37| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/2| 6/2| 38|0/38| 10G  |NONE| NO |DIS|DWN|               0|               0|
+26/3| 6/3| 39|0/39| 10G  |NONE| NO |DIS|DWN|               0|               0|
+PORT|MAC |D_P|P/PT|SPEED |FEC |QSFP|ADM|OPR|FRAMES RX       |FRAMES TX       |E
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+27/0| 5/0| 40|0/40| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/1| 5/1| 41|0/41| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/2| 5/2| 42|0/42| 10G  |NONE| NO |DIS|DWN|               0|               0|
+27/3| 5/3| 43|0/43| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/0| 4/0| 44|0/44| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/1| 4/1| 45|0/45| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/2| 4/2| 46|0/46| 10G  |NONE| NO |DIS|DWN|               0|               0|
+28/3| 4/3| 47|0/47| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/0| 3/0| 48|0/48| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/1| 3/1| 49|0/49| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/2| 3/2| 50|0/50| 10G  |NONE| NO |DIS|DWN|               0|               0|
+29/3| 3/3| 51|0/51| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/0| 2/0| 52|0/52| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/1| 2/1| 53|0/53| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/2| 2/2| 54|0/54| 10G  |NONE| NO |DIS|DWN|               0|               0|
+30/3| 2/3| 55|0/55| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/0| 1/0| 56|0/56| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/1| 1/1| 57|0/57| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/2| 1/2| 58|0/58| 10G  |NONE| NO |DIS|DWN|               0|               0|
+31/3| 1/3| 59|0/59| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/0| 0/0| 60|0/60| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/1| 0/1| 61|0/61| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/2| 0/2| 62|0/62| 10G  |NONE| NO |DIS|DWN|               0|               0|
+32/3| 0/3| 63|0/63| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/0|40/0|284|2/28| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/1|40/1|285|2/29| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/2|40/2|286|2/30| 10G  |NONE| NO |DIS|DWN|               0|               0|
+33/3|40/3|287|2/31| 10G  |NONE| NO |DIS|DWN|               0|               0|
+34/0|41/0|280|2/24| 10G  |NONE| NO |DIS|DWN|               0|               0|
+34/1|41/1|281|2/25| 10G  |NONE| NO |DIS|DWN|               0|               0|
+34/2|41/2|282|2/26| 10G  |NONE| NO |DIS|DWN|               0|               0|
+34/3|41/3|283|2/27| 10G  |NONE| NO |DIS|DWN|               0|               0|
+35/0|42/0|276|2/20| 10G  |NONE| NO |DIS|DWN|               0|               0|
+35/1|42/1|277|2/21| 10G  |NONE| NO |DIS|DWN|               0|               0|
+35/2|42/2|278|2/22| 10G  |NONE| NO |DIS|DWN|               0|               0|
+35/3|42/3|279|2/23| 10G  |NONE| NO |DIS|DWN|               0|               0|
+36/0|43/0|272|2/16| 10G  |NONE| NO |DIS|DWN|               0|               0|
+36/1|43/1|273|2/17| 10G  |NONE| NO |DIS|DWN|               0|               0|
+36/2|43/2|274|2/18| 10G  |NONE| NO |DIS|DWN|               0|               0|
+36/3|43/3|275|2/19| 10G  |NONE| NO |DIS|DWN|               0|               0|
+37/0|44/0|268|2/12| 10G  |NONE| NO |DIS|DWN|               0|               0|
+37/1|44/1|269|2/13| 10G  |NONE| NO |DIS|DWN|               0|               0|
+37/2|44/2|270|2/14| 10G  |NONE| NO |DIS|DWN|               0|               0|
+37/3|44/3|271|2/15| 10G  |NONE| NO |DIS|DWN|               0|               0|
+38/0|45/0|264|2/ 8| 10G  |NONE| NO |DIS|DWN|               0|               0|
+38/1|45/1|265|2/ 9| 10G  |NONE| NO |DIS|DWN|               0|               0|
+38/2|45/2|266|2/10| 10G  |NONE| NO |DIS|DWN|               0|               0|
+38/3|45/3|267|2/11| 10G  |NONE| NO |DIS|DWN|               0|               0|
+39/0|46/0|260|2/ 4| 10G  |NONE| NO |DIS|DWN|               0|               0|
+39/1|46/1|261|2/ 5| 10G  |NONE| NO |DIS|DWN|               0|               0|
+39/2|46/2|262|2/ 6| 10G  |NONE| NO |DIS|DWN|               0|               0|
+39/3|46/3|263|2/ 7| 10G  |NONE| NO |DIS|DWN|               0|               0|
+PORT|MAC |D_P|P/PT|SPEED |FEC |QSFP|ADM|OPR|FRAMES RX       |FRAMES TX       |E
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+40/0|47/0|256|2/ 0| 10G  |NONE| NO |DIS|DWN|               0|               0|
+40/1|47/1|257|2/ 1| 10G  |NONE| NO |DIS|DWN|               0|               0|
+40/2|47/2|258|2/ 2| 10G  |NONE| NO |DIS|DWN|               0|               0|
+40/3|47/3|259|2/ 3| 10G  |NONE| NO |DIS|DWN|               0|               0|
+41/0|32/0|316|2/60| 10G  |NONE| NO |DIS|DWN|               0|               0|
+41/1|32/1|317|2/61| 10G  |NONE| NO |DIS|DWN|               0|               0|
+41/2|32/2|318|2/62| 10G  |NONE| NO |DIS|DWN|               0|               0|
+41/3|32/3|319|2/63| 10G  |NONE| NO |DIS|DWN|               0|               0|
+42/0|33/0|312|2/56| 10G  |NONE| NO |DIS|DWN|               0|               0|
+42/1|33/1|313|2/57| 10G  |NONE| NO |DIS|DWN|               0|               0|
+42/2|33/2|314|2/58| 10G  |NONE| NO |DIS|DWN|               0|               0|
+42/3|33/3|315|2/59| 10G  |NONE| NO |DIS|DWN|               0|               0|
+43/0|34/0|308|2/52| 10G  |NONE| NO |DIS|DWN|               0|               0|
+43/1|34/1|309|2/53| 10G  |NONE| NO |DIS|DWN|               0|               0|
+43/2|34/2|310|2/54| 10G  |NONE| NO |DIS|DWN|               0|               0|
+43/3|34/3|311|2/55| 10G  |NONE| NO |DIS|DWN|               0|               0|
+44/0|35/0|304|2/48| 10G  |NONE| NO |DIS|DWN|               0|               0|
+44/1|35/1|305|2/49| 10G  |NONE| NO |DIS|DWN|               0|               0|
+44/2|35/2|306|2/50| 10G  |NONE| NO |DIS|DWN|               0|               0|
+44/3|35/3|307|2/51| 10G  |NONE| NO |DIS|DWN|               0|               0|
+45/0|36/0|300|2/44| 10G  |NONE| NO |DIS|DWN|               0|               0|
+45/1|36/1|301|2/45| 10G  |NONE| NO |DIS|DWN|               0|               0|
+45/2|36/2|302|2/46| 10G  |NONE| NO |DIS|DWN|               0|               0|
+45/3|36/3|303|2/47| 10G  |NONE| NO |DIS|DWN|               0|               0|
+46/0|37/0|296|2/40| 10G  |NONE| NO |DIS|DWN|               0|               0|
+46/1|37/1|297|2/41| 10G  |NONE| NO |DIS|DWN|               0|               0|
+46/2|37/2|298|2/42| 10G  |NONE| NO |DIS|DWN|               0|               0|
+46/3|37/3|299|2/43| 10G  |NONE| NO |DIS|DWN|               0|               0|
+47/0|38/0|292|2/36| 10G  |NONE| NO |DIS|DWN|               0|               0|
+47/1|38/1|293|2/37| 10G  |NONE| NO |DIS|DWN|               0|               0|
+47/2|38/2|294|2/38| 10G  |NONE| NO |DIS|DWN|               0|               0|
+47/3|38/3|295|2/39| 10G  |NONE| NO |DIS|DWN|               0|               0|
+48/0|39/0|288|2/32| 10G  |NONE| NO |DIS|DWN|               0|               0|
+48/1|39/1|289|2/33| 10G  |NONE| NO |DIS|DWN|               0|               0|
+48/2|39/2|290|2/34| 10G  |NONE| NO |DIS|DWN|               0|               0|
+48/3|39/3|291|2/35| 10G  |NONE| NO |DIS|DWN|               0|               0|
+49/0|56/0|416|3/32| 10G  |NONE| NO |DIS|DWN|               0|               0|
+49/1|56/1|417|3/33| 10G  |NONE| NO |DIS|DWN|               0|               0|
+49/2|56/2|418|3/34| 10G  |NONE| NO |DIS|DWN|               0|               0|
+49/3|56/3|419|3/35| 10G  |NONE| NO |DIS|DWN|               0|               0|
+50/0|57/0|420|3/36| 10G  |NONE| NO |DIS|DWN|               0|               0|
+50/1|57/1|421|3/37| 10G  |NONE| NO |DIS|DWN|               0|               0|
+50/2|57/2|422|3/38| 10G  |NONE| NO |DIS|DWN|               0|               0|
+50/3|57/3|423|3/39| 10G  |NONE| NO |DIS|DWN|               0|               0|
+51/0|58/0|424|3/40| 10G  |NONE| NO |DIS|DWN|               0|               0|
+51/1|58/1|425|3/41| 10G  |NONE| NO |DIS|DWN|               0|               0|
+51/2|58/2|426|3/42| 10G  |NONE| NO |DIS|DWN|               0|               0|
+51/3|58/3|427|3/43| 10G  |NONE| NO |DIS|DWN|               0|               0|
+52/0|59/0|428|3/44| 10G  |NONE| NO |DIS|DWN|               0|               0|
+52/1|59/1|429|3/45| 10G  |NONE| NO |DIS|DWN|               0|               0|
+52/2|59/2|430|3/46| 10G  |NONE| NO |DIS|DWN|               0|               0|
+52/3|59/3|431|3/47| 10G  |NONE| NO |DIS|DWN|               0|               0|
+PORT|MAC |D_P|P/PT|SPEED |FEC |QSFP|ADM|OPR|FRAMES RX       |FRAMES TX       |E
+----+----+---+----+------+----+----+---+---+----------------+----------------+-
+53/0|60/0|432|3/48| 10G  |NONE| NO |DIS|DWN|               0|               0|
+53/1|60/1|433|3/49| 10G  |NONE| NO |DIS|DWN|               0|               0|
+53/2|60/2|434|3/50| 10G  |NONE| NO |DIS|DWN|               0|               0|
+53/3|60/3|435|3/51| 10G  |NONE| NO |DIS|DWN|               0|               0|
+54/0|61/0|436|3/52| 10G  |NONE| NO |DIS|DWN|               0|               0|
+54/1|61/1|437|3/53| 10G  |NONE| NO |DIS|DWN|               0|               0|
+54/2|61/2|438|3/54| 10G  |NONE| NO |DIS|DWN|               0|               0|
+54/3|61/3|439|3/55| 10G  |NONE| NO |DIS|DWN|               0|               0|
+55/0|62/0|440|3/56| 10G  |NONE| NO |DIS|DWN|               0|               0|
+55/1|62/1|441|3/57| 10G  |NONE| NO |DIS|DWN|               0|               0|
+55/2|62/2|442|3/58| 10G  |NONE| NO |DIS|DWN|               0|               0|
+55/3|62/3|443|3/59| 10G  |NONE| NO |DIS|DWN|               0|               0|
+56/0|63/0|444|3/60| 10G  |NONE| NO |DIS|DWN|               0|               0|
+56/1|63/1|445|3/61| 10G  |NONE| NO |DIS|DWN|               0|               0|
+56/2|63/2|446|3/62| 10G  |NONE| NO |DIS|DWN|               0|               0|
+56/3|63/3|447|3/63| 10G  |NONE| NO |DIS|DWN|               0|               0|
+57/0|48/0|384|3/ 0| 10G  |NONE| NO |DIS|DWN|               0|               0|
+57/1|48/1|385|3/ 1| 10G  |NONE| NO |DIS|DWN|               0|               0|
+57/2|48/2|386|3/ 2| 10G  |NONE| NO |DIS|DWN|               0|               0|
+57/3|48/3|387|3/ 3| 10G  |NONE| NO |DIS|DWN|               0|               0|
+58/0|49/0|388|3/ 4| 10G  |NONE| NO |DIS|DWN|               0|               0|
+58/1|49/1|389|3/ 5| 10G  |NONE| NO |DIS|DWN|               0|               0|
+58/2|49/2|390|3/ 6| 10G  |NONE| NO |DIS|DWN|               0|               0|
+58/3|49/3|391|3/ 7| 10G  |NONE| NO |DIS|DWN|               0|               0|
+59/0|50/0|392|3/ 8| 10G  |NONE| NO |DIS|DWN|               0|               0|
+59/1|50/1|393|3/ 9| 10G  |NONE| NO |DIS|DWN|               0|               0|
+59/2|50/2|394|3/10| 10G  |NONE| NO |DIS|DWN|               0|               0|
+59/3|50/3|395|3/11| 10G  |NONE| NO |DIS|DWN|               0|               0|
+60/0|51/0|396|3/12| 10G  |NONE| NO |DIS|DWN|               0|               0|
+60/1|51/1|397|3/13| 10G  |NONE| NO |DIS|DWN|               0|               0|
+60/2|51/2|398|3/14| 10G  |NONE| NO |DIS|DWN|               0|               0|
+60/3|51/3|399|3/15| 10G  |NONE| NO |DIS|DWN|               0|               0|
+61/0|52/0|400|3/16| 10G  |NONE| NO |DIS|DWN|               0|               0|
+61/1|52/1|401|3/17| 10G  |NONE| NO |DIS|DWN|               0|               0|
+61/2|52/2|402|3/18| 10G  |NONE| NO |DIS|DWN|               0|               0|
+61/3|52/3|403|3/19| 10G  |NONE| NO |DIS|DWN|               0|               0|
+62/0|53/0|404|3/20| 10G  |NONE| NO |DIS|DWN|               0|               0|
+62/1|53/1|405|3/21| 10G  |NONE| NO |DIS|DWN|               0|               0|
+62/2|53/2|406|3/22| 10G  |NONE| NO |DIS|DWN|               0|               0|
+62/3|53/3|407|3/23| 10G  |NONE| NO |DIS|DWN|               0|               0|
+63/0|54/0|408|3/24| 10G  |NONE| NO |DIS|DWN|               0|               0|
+63/1|54/1|409|3/25| 10G  |NONE| NO |DIS|DWN|               0|               0|
+63/2|54/2|410|3/26| 10G  |NONE| NO |DIS|DWN|               0|               0|
+63/3|54/3|411|3/27| 10G  |NONE| NO |DIS|DWN|               0|               0|
+64/0|55/0|412|3/28| 10G  |NONE| NO |DIS|DWN|               0|               0|
+64/1|55/1|413|3/29| 10G  |NONE| NO |DIS|DWN|               0|               0|
+64/2|55/2|414|3/30| 10G  |NONE| NO |DIS|DWN|               0|               0|
+64/3|55/3|415|3/31| 10G  |NONE| NO |DIS|DWN|               0|               0|
+65/0|64/0| 64|0/64| 10G  |NONE| NO |DIS|DWN|               0|               0|
+65/1|64/1| 65|0/65| 10G  |NONE| NO |DIS|DWN|               0|               0|
+65/2|64/2| 66|0/66| 10G  |NONE| NO |DIS|DWN|               0|               0|
+65/3|64/3| 67|0/67| 10G  |NONE| NO |DIS|DWN|               0|               0|
diff --git a/tools/test/tofino-port-auto-setup-tool/ports.json b/tools/test/tofino-port-auto-setup-tool/ports.json
new file mode 100644
index 0000000..55dfa52
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/ports.json
@@ -0,0 +1,110 @@
+{
+  "misc": [
+    "Use json[MODEL_NAME][PORT_NUMBER][CHANNEL_NUMBER] directly.",
+    "json[MODEL_NAME][0] will be empty because there is no port 0."
+  ],
+  "BF_PLTFM_BD_ID_MONTARA_P0B": [
+    [],
+    [128, 129, 130, 131],
+    [136, 137, 138, 139],
+    [144, 145, 146, 147],
+    [152, 153, 154, 155],
+    [160, 161, 162, 163],
+    [168, 169, 170, 171],
+    [176, 177, 178, 179],
+    [184, 185, 186, 187],
+    [60, 61, 62, 63],
+    [52, 53, 54, 55],
+    [44, 45, 46, 47],
+    [36, 37, 38, 39],
+    [28, 29, 30, 31],
+    [20, 21, 22, 23],
+    [12, 13, 14, 15],
+    [4, 5, 6, 7],
+    [0, 1, 2, 3],
+    [8, 9, 10, 11],
+    [16, 17, 18, 19],
+    [24, 25, 26, 27],
+    [32, 33, 34, 35],
+    [40, 41, 42, 43],
+    [48, 49, 50, 51],
+    [56, 57, 58, 59],
+    [188, 189, 190, 191],
+    [180, 181, 182, 183],
+    [172, 173, 174, 175],
+    [164, 165, 166, 167],
+    [148, 149, 150, 151],
+    [156, 157, 158, 159],
+    [132, 133, 134, 135],
+    [140, 141, 142, 143],
+    [64, 65, 66, 67]
+  ],
+  "BF_PLTFM_BD_ID_MAVERICKS_P0B": [
+    [],
+    [188, 189, 190, 191],
+    [184, 185, 186, 187],
+    [180, 181, 182, 183],
+    [176, 177, 178, 179],
+    [172, 173, 174, 175],
+    [168, 169, 170, 171],
+    [164, 165, 166, 167],
+    [160, 161, 162, 163],
+    [156, 157, 158, 159],
+    [152, 153, 154, 155],
+    [148, 149, 150, 151],
+    [144, 145, 146, 147],
+    [140, 141, 142, 143],
+    [136, 137, 138, 139],
+    [132, 133, 134, 135],
+    [128, 129, 130, 131],
+    [0, 1, 2, 3],
+    [4, 5, 6, 7],
+    [8, 9, 10, 11],
+    [12, 13, 14, 15],
+    [16, 17, 18, 19],
+    [20, 21, 22, 23],
+    [24, 25, 26, 27],
+    [28, 29, 30, 31],
+    [32, 33, 34, 35],
+    [36, 37, 38, 39],
+    [40, 41, 42, 43],
+    [44, 45, 46, 47],
+    [48, 49, 50, 51],
+    [52, 53, 54, 55],
+    [56, 57, 58, 59],
+    [60, 61, 62, 63],
+    [284, 285, 286, 287],
+    [280, 281, 282, 283],
+    [276, 277, 278, 279],
+    [272, 273, 274, 275],
+    [268, 269, 270, 271],
+    [264, 265, 266, 267],
+    [260, 261, 262, 263],
+    [256, 257, 258, 259],
+    [316, 317, 318, 319],
+    [312, 313, 314, 315],
+    [308, 309, 310, 311],
+    [304, 305, 306, 307],
+    [300, 301, 302, 303],
+    [296, 297, 298, 299],
+    [292, 293, 294, 295],
+    [288, 289, 290, 291],
+    [416, 417, 418, 419],
+    [420, 421, 422, 423],
+    [424, 425, 426, 427],
+    [428, 429, 430, 431],
+    [432, 433, 434, 435],
+    [436, 437, 438, 439],
+    [440, 441, 442, 443],
+    [444, 445, 446, 447],
+    [384, 385, 386, 387],
+    [388, 389, 390, 391],
+    [392, 393, 394, 395],
+    [396, 397, 398, 399],
+    [400, 401, 402, 403],
+    [404, 405, 406, 407],
+    [408, 409, 410, 411],
+    [412, 413, 414, 415],
+    [64, 65, 66, 67]
+  ]
+}
diff --git a/tools/test/tofino-port-auto-setup-tool/push-all-port-configs.sh b/tools/test/tofino-port-auto-setup-tool/push-all-port-configs.sh
new file mode 100755
index 0000000..782b885
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/push-all-port-configs.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+./pm.py 10.254.1.37 37-port-config.txt &
+./pm.py 10.254.1.38 38-port-config.txt &
+./pm.py 10.254.1.39 39-port-config.txt &
+./pm.py 10.254.1.40 40-port-config.txt &
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/__init__.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/__init__.py
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/__init__.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/__init__.py
new file mode 100644
index 0000000..a72f5ea
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'pltfm_pm_rpc']
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/constants.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/constants.py
new file mode 100644
index 0000000..eb0d35a
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/constants.py
@@ -0,0 +1,12 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+from .ttypes import *
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc-remote b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc-remote
new file mode 100755
index 0000000..15bf28a
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc-remote
@@ -0,0 +1,180 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py
+#
+
+import sys
+import pprint
+if sys.version_info[0] > 2:
+    from urllib.parse import urlparse
+else:
+    from urlparse import urlparse
+from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
+from thrift.protocol.TBinaryProtocol import TBinaryProtocol
+
+from pltfm_pm_rpc import pltfm_pm_rpc
+from pltfm_pm_rpc.ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+    print('')
+    print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
+    print('')
+    print('Functions:')
+    print('  pltfm_pm_status_t pltfm_pm_port_add(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port, pltfm_pm_port_speed_t ps, pltfm_pm_fec_type_t fec)')
+    print('  pltfm_pm_status_t pltfm_pm_port_del(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+    print('  pltfm_pm_status_t pltfm_pm_port_enable(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+    print('  pltfm_pm_status_t pltfm_pm_port_dis(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+    print('  pltfm_pm_status_t pltfm_pm_switchd_port_cleanup(pltfm_pm_device_t device)')
+    print('  pltfm_pm_oper_status_t pltfm_pm_port_oper_status_get(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port)')
+    print('  pltfm_pm_board_type_t pltfm_pm_board_type_get()')
+    print('  pltfm_pm_status_t pltfm_pm_port_an_set(pltfm_pm_device_t device, pltfm_pm_dev_port_t dev_port, i32 an_flag)')
+    print('  pltfm_pm_status_t pltfm_pm_serdes_lane_map_set(pltfm_pm_device_t device)')
+    print('  pltfm_pm_status_t pltfm_pm_serdes_init(pltfm_pm_device_t device)')
+    print('')
+    sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent=2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+ssl = False
+validate = True
+ca_certs = None
+keyfile = None
+certfile = None
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+    parts = sys.argv[argi + 1].split(':')
+    host = parts[0]
+    if len(parts) > 1:
+        port = int(parts[1])
+    argi += 2
+
+if sys.argv[argi] == '-u':
+    url = urlparse(sys.argv[argi + 1])
+    parts = url[1].split(':')
+    host = parts[0]
+    if len(parts) > 1:
+        port = int(parts[1])
+    else:
+        port = 80
+    uri = url[2]
+    if url[4]:
+        uri += '?%s' % url[4]
+    http = True
+    argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+    framed = True
+    argi += 1
+
+if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
+    ssl = True
+    argi += 1
+
+if sys.argv[argi] == '-novalidate':
+    validate = False
+    argi += 1
+
+if sys.argv[argi] == '-ca_certs':
+    ca_certs = sys.argv[argi+1]
+    argi += 2
+
+if sys.argv[argi] == '-keyfile':
+    keyfile = sys.argv[argi+1]
+    argi += 2
+
+if sys.argv[argi] == '-certfile':
+    certfile = sys.argv[argi+1]
+    argi += 2
+
+cmd = sys.argv[argi]
+args = sys.argv[argi + 1:]
+
+if http:
+    transport = THttpClient.THttpClient(host, port, uri)
+else:
+    if ssl:
+        socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
+    else:
+        socket = TSocket.TSocket(host, port)
+    if framed:
+        transport = TTransport.TFramedTransport(socket)
+    else:
+        transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol(transport)
+client = pltfm_pm_rpc.Client(protocol)
+transport.open()
+
+if cmd == 'pltfm_pm_port_add':
+    if len(args) != 4:
+        print('pltfm_pm_port_add requires 4 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_port_add(eval(args[0]), eval(args[1]), eval(args[2]), eval(args[3]),))
+
+elif cmd == 'pltfm_pm_port_del':
+    if len(args) != 2:
+        print('pltfm_pm_port_del requires 2 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_port_del(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_port_enable':
+    if len(args) != 2:
+        print('pltfm_pm_port_enable requires 2 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_port_enable(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_port_dis':
+    if len(args) != 2:
+        print('pltfm_pm_port_dis requires 2 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_port_dis(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_switchd_port_cleanup':
+    if len(args) != 1:
+        print('pltfm_pm_switchd_port_cleanup requires 1 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_switchd_port_cleanup(eval(args[0]),))
+
+elif cmd == 'pltfm_pm_port_oper_status_get':
+    if len(args) != 2:
+        print('pltfm_pm_port_oper_status_get requires 2 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_port_oper_status_get(eval(args[0]), eval(args[1]),))
+
+elif cmd == 'pltfm_pm_board_type_get':
+    if len(args) != 0:
+        print('pltfm_pm_board_type_get requires 0 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_board_type_get())
+
+elif cmd == 'pltfm_pm_port_an_set':
+    if len(args) != 3:
+        print('pltfm_pm_port_an_set requires 3 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_port_an_set(eval(args[0]), eval(args[1]), eval(args[2]),))
+
+elif cmd == 'pltfm_pm_serdes_lane_map_set':
+    if len(args) != 1:
+        print('pltfm_pm_serdes_lane_map_set requires 1 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_serdes_lane_map_set(eval(args[0]),))
+
+elif cmd == 'pltfm_pm_serdes_init':
+    if len(args) != 1:
+        print('pltfm_pm_serdes_init requires 1 args')
+        sys.exit(1)
+    pp.pprint(client.pltfm_pm_serdes_init(eval(args[0]),))
+
+else:
+    print('Unrecognized method %s' % cmd)
+    sys.exit(1)
+
+transport.close()
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc.py
new file mode 100644
index 0000000..0d9432b
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/pltfm_pm_rpc.py
@@ -0,0 +1,2106 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+import logging
+from .ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+
+
+class Iface(object):
+    def pltfm_pm_port_add(self, device, dev_port, ps, fec):
+        """
+        Parameters:
+         - device
+         - dev_port
+         - ps
+         - fec
+        """
+        pass
+
+    def pltfm_pm_port_del(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        pass
+
+    def pltfm_pm_port_enable(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        pass
+
+    def pltfm_pm_port_dis(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        pass
+
+    def pltfm_pm_switchd_port_cleanup(self, device):
+        """
+        Parameters:
+         - device
+        """
+        pass
+
+    def pltfm_pm_port_oper_status_get(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        pass
+
+    def pltfm_pm_board_type_get(self):
+        pass
+
+    def pltfm_pm_port_an_set(self, device, dev_port, an_flag):
+        """
+        Parameters:
+         - device
+         - dev_port
+         - an_flag
+        """
+        pass
+
+    def pltfm_pm_serdes_lane_map_set(self, device):
+        """
+        Parameters:
+         - device
+        """
+        pass
+
+    def pltfm_pm_serdes_init(self, device):
+        """
+        Parameters:
+         - device
+        """
+        pass
+
+
+class Client(Iface):
+    def __init__(self, iprot, oprot=None):
+        self._iprot = self._oprot = iprot
+        if oprot is not None:
+            self._oprot = oprot
+        self._seqid = 0
+
+    def pltfm_pm_port_add(self, device, dev_port, ps, fec):
+        """
+        Parameters:
+         - device
+         - dev_port
+         - ps
+         - fec
+        """
+        self.send_pltfm_pm_port_add(device, dev_port, ps, fec)
+        return self.recv_pltfm_pm_port_add()
+
+    def send_pltfm_pm_port_add(self, device, dev_port, ps, fec):
+        self._oprot.writeMessageBegin('pltfm_pm_port_add', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_port_add_args()
+        args.device = device
+        args.dev_port = dev_port
+        args.ps = ps
+        args.fec = fec
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_port_add(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_port_add_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_add failed: unknown result")
+
+    def pltfm_pm_port_del(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        self.send_pltfm_pm_port_del(device, dev_port)
+        return self.recv_pltfm_pm_port_del()
+
+    def send_pltfm_pm_port_del(self, device, dev_port):
+        self._oprot.writeMessageBegin('pltfm_pm_port_del', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_port_del_args()
+        args.device = device
+        args.dev_port = dev_port
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_port_del(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_port_del_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_del failed: unknown result")
+
+    def pltfm_pm_port_enable(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        self.send_pltfm_pm_port_enable(device, dev_port)
+        return self.recv_pltfm_pm_port_enable()
+
+    def send_pltfm_pm_port_enable(self, device, dev_port):
+        self._oprot.writeMessageBegin('pltfm_pm_port_enable', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_port_enable_args()
+        args.device = device
+        args.dev_port = dev_port
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_port_enable(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_port_enable_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_enable failed: unknown result")
+
+    def pltfm_pm_port_dis(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        self.send_pltfm_pm_port_dis(device, dev_port)
+        return self.recv_pltfm_pm_port_dis()
+
+    def send_pltfm_pm_port_dis(self, device, dev_port):
+        self._oprot.writeMessageBegin('pltfm_pm_port_dis', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_port_dis_args()
+        args.device = device
+        args.dev_port = dev_port
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_port_dis(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_port_dis_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_dis failed: unknown result")
+
+    def pltfm_pm_switchd_port_cleanup(self, device):
+        """
+        Parameters:
+         - device
+        """
+        self.send_pltfm_pm_switchd_port_cleanup(device)
+        return self.recv_pltfm_pm_switchd_port_cleanup()
+
+    def send_pltfm_pm_switchd_port_cleanup(self, device):
+        self._oprot.writeMessageBegin('pltfm_pm_switchd_port_cleanup', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_switchd_port_cleanup_args()
+        args.device = device
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_switchd_port_cleanup(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_switchd_port_cleanup_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_switchd_port_cleanup failed: unknown result")
+
+    def pltfm_pm_port_oper_status_get(self, device, dev_port):
+        """
+        Parameters:
+         - device
+         - dev_port
+        """
+        self.send_pltfm_pm_port_oper_status_get(device, dev_port)
+        return self.recv_pltfm_pm_port_oper_status_get()
+
+    def send_pltfm_pm_port_oper_status_get(self, device, dev_port):
+        self._oprot.writeMessageBegin('pltfm_pm_port_oper_status_get', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_port_oper_status_get_args()
+        args.device = device
+        args.dev_port = dev_port
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_port_oper_status_get(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_port_oper_status_get_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_oper_status_get failed: unknown result")
+
+    def pltfm_pm_board_type_get(self):
+        self.send_pltfm_pm_board_type_get()
+        return self.recv_pltfm_pm_board_type_get()
+
+    def send_pltfm_pm_board_type_get(self):
+        self._oprot.writeMessageBegin('pltfm_pm_board_type_get', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_board_type_get_args()
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_board_type_get(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_board_type_get_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_board_type_get failed: unknown result")
+
+    def pltfm_pm_port_an_set(self, device, dev_port, an_flag):
+        """
+        Parameters:
+         - device
+         - dev_port
+         - an_flag
+        """
+        self.send_pltfm_pm_port_an_set(device, dev_port, an_flag)
+        return self.recv_pltfm_pm_port_an_set()
+
+    def send_pltfm_pm_port_an_set(self, device, dev_port, an_flag):
+        self._oprot.writeMessageBegin('pltfm_pm_port_an_set', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_port_an_set_args()
+        args.device = device
+        args.dev_port = dev_port
+        args.an_flag = an_flag
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_port_an_set(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_port_an_set_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_port_an_set failed: unknown result")
+
+    def pltfm_pm_serdes_lane_map_set(self, device):
+        """
+        Parameters:
+         - device
+        """
+        self.send_pltfm_pm_serdes_lane_map_set(device)
+        return self.recv_pltfm_pm_serdes_lane_map_set()
+
+    def send_pltfm_pm_serdes_lane_map_set(self, device):
+        self._oprot.writeMessageBegin('pltfm_pm_serdes_lane_map_set', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_serdes_lane_map_set_args()
+        args.device = device
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_serdes_lane_map_set(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_serdes_lane_map_set_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_serdes_lane_map_set failed: unknown result")
+
+    def pltfm_pm_serdes_init(self, device):
+        """
+        Parameters:
+         - device
+        """
+        self.send_pltfm_pm_serdes_init(device)
+        return self.recv_pltfm_pm_serdes_init()
+
+    def send_pltfm_pm_serdes_init(self, device):
+        self._oprot.writeMessageBegin('pltfm_pm_serdes_init', TMessageType.CALL, self._seqid)
+        args = pltfm_pm_serdes_init_args()
+        args.device = device
+        args.write(self._oprot)
+        self._oprot.writeMessageEnd()
+        self._oprot.trans.flush()
+
+    def recv_pltfm_pm_serdes_init(self):
+        iprot = self._iprot
+        (fname, mtype, rseqid) = iprot.readMessageBegin()
+        if mtype == TMessageType.EXCEPTION:
+            x = TApplicationException()
+            x.read(iprot)
+            iprot.readMessageEnd()
+            raise x
+        result = pltfm_pm_serdes_init_result()
+        result.read(iprot)
+        iprot.readMessageEnd()
+        if result.success is not None:
+            return result.success
+        if result.ouch is not None:
+            raise result.ouch
+        raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_pm_serdes_init failed: unknown result")
+
+
+class Processor(Iface, TProcessor):
+    def __init__(self, handler):
+        self._handler = handler
+        self._processMap = {}
+        self._processMap["pltfm_pm_port_add"] = Processor.process_pltfm_pm_port_add
+        self._processMap["pltfm_pm_port_del"] = Processor.process_pltfm_pm_port_del
+        self._processMap["pltfm_pm_port_enable"] = Processor.process_pltfm_pm_port_enable
+        self._processMap["pltfm_pm_port_dis"] = Processor.process_pltfm_pm_port_dis
+        self._processMap["pltfm_pm_switchd_port_cleanup"] = Processor.process_pltfm_pm_switchd_port_cleanup
+        self._processMap["pltfm_pm_port_oper_status_get"] = Processor.process_pltfm_pm_port_oper_status_get
+        self._processMap["pltfm_pm_board_type_get"] = Processor.process_pltfm_pm_board_type_get
+        self._processMap["pltfm_pm_port_an_set"] = Processor.process_pltfm_pm_port_an_set
+        self._processMap["pltfm_pm_serdes_lane_map_set"] = Processor.process_pltfm_pm_serdes_lane_map_set
+        self._processMap["pltfm_pm_serdes_init"] = Processor.process_pltfm_pm_serdes_init
+
+    def process(self, iprot, oprot):
+        (name, type, seqid) = iprot.readMessageBegin()
+        if name not in self._processMap:
+            iprot.skip(TType.STRUCT)
+            iprot.readMessageEnd()
+            x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+            oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+            x.write(oprot)
+            oprot.writeMessageEnd()
+            oprot.trans.flush()
+            return
+        else:
+            self._processMap[name](self, seqid, iprot, oprot)
+        return True
+
+    def process_pltfm_pm_port_add(self, seqid, iprot, oprot):
+        args = pltfm_pm_port_add_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_port_add_result()
+        try:
+            result.success = self._handler.pltfm_pm_port_add(args.device, args.dev_port, args.ps, args.fec)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_port_add", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_port_del(self, seqid, iprot, oprot):
+        args = pltfm_pm_port_del_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_port_del_result()
+        try:
+            result.success = self._handler.pltfm_pm_port_del(args.device, args.dev_port)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_port_del", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_port_enable(self, seqid, iprot, oprot):
+        args = pltfm_pm_port_enable_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_port_enable_result()
+        try:
+            result.success = self._handler.pltfm_pm_port_enable(args.device, args.dev_port)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_port_enable", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_port_dis(self, seqid, iprot, oprot):
+        args = pltfm_pm_port_dis_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_port_dis_result()
+        try:
+            result.success = self._handler.pltfm_pm_port_dis(args.device, args.dev_port)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_port_dis", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_switchd_port_cleanup(self, seqid, iprot, oprot):
+        args = pltfm_pm_switchd_port_cleanup_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_switchd_port_cleanup_result()
+        try:
+            result.success = self._handler.pltfm_pm_switchd_port_cleanup(args.device)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_switchd_port_cleanup", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_port_oper_status_get(self, seqid, iprot, oprot):
+        args = pltfm_pm_port_oper_status_get_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_port_oper_status_get_result()
+        try:
+            result.success = self._handler.pltfm_pm_port_oper_status_get(args.device, args.dev_port)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_port_oper_status_get", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_board_type_get(self, seqid, iprot, oprot):
+        args = pltfm_pm_board_type_get_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_board_type_get_result()
+        try:
+            result.success = self._handler.pltfm_pm_board_type_get()
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_board_type_get", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_port_an_set(self, seqid, iprot, oprot):
+        args = pltfm_pm_port_an_set_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_port_an_set_result()
+        try:
+            result.success = self._handler.pltfm_pm_port_an_set(args.device, args.dev_port, args.an_flag)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_port_an_set", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_serdes_lane_map_set(self, seqid, iprot, oprot):
+        args = pltfm_pm_serdes_lane_map_set_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_serdes_lane_map_set_result()
+        try:
+            result.success = self._handler.pltfm_pm_serdes_lane_map_set(args.device)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_serdes_lane_map_set", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+    def process_pltfm_pm_serdes_init(self, seqid, iprot, oprot):
+        args = pltfm_pm_serdes_init_args()
+        args.read(iprot)
+        iprot.readMessageEnd()
+        result = pltfm_pm_serdes_init_result()
+        try:
+            result.success = self._handler.pltfm_pm_serdes_init(args.device)
+            msg_type = TMessageType.REPLY
+        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+            raise
+        except InvalidPltfmPmOperation as ouch:
+            msg_type = TMessageType.REPLY
+            result.ouch = ouch
+        except Exception as ex:
+            msg_type = TMessageType.EXCEPTION
+            logging.exception(ex)
+            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+        oprot.writeMessageBegin("pltfm_pm_serdes_init", msg_type, seqid)
+        result.write(oprot)
+        oprot.writeMessageEnd()
+        oprot.trans.flush()
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+
+class pltfm_pm_port_add_args(object):
+    """
+    Attributes:
+     - device
+     - dev_port
+     - ps
+     - fec
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+        (2, TType.I32, 'dev_port', None, None, ),  # 2
+        (3, TType.I32, 'ps', None, None, ),  # 3
+        (4, TType.I32, 'fec', None, None, ),  # 4
+    )
+
+    def __init__(self, device=None, dev_port=None, ps=None, fec=None,):
+        self.device = device
+        self.dev_port = dev_port
+        self.ps = ps
+        self.fec = fec
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.I32:
+                    self.dev_port = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 3:
+                if ftype == TType.I32:
+                    self.ps = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 4:
+                if ftype == TType.I32:
+                    self.fec = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_add_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        if self.dev_port is not None:
+            oprot.writeFieldBegin('dev_port', TType.I32, 2)
+            oprot.writeI32(self.dev_port)
+            oprot.writeFieldEnd()
+        if self.ps is not None:
+            oprot.writeFieldBegin('ps', TType.I32, 3)
+            oprot.writeI32(self.ps)
+            oprot.writeFieldEnd()
+        if self.fec is not None:
+            oprot.writeFieldBegin('fec', TType.I32, 4)
+            oprot.writeI32(self.fec)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_add_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_add_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_del_args(object):
+    """
+    Attributes:
+     - device
+     - dev_port
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+        (2, TType.I32, 'dev_port', None, None, ),  # 2
+    )
+
+    def __init__(self, device=None, dev_port=None,):
+        self.device = device
+        self.dev_port = dev_port
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.I32:
+                    self.dev_port = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_del_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        if self.dev_port is not None:
+            oprot.writeFieldBegin('dev_port', TType.I32, 2)
+            oprot.writeI32(self.dev_port)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_del_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_del_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_enable_args(object):
+    """
+    Attributes:
+     - device
+     - dev_port
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+        (2, TType.I32, 'dev_port', None, None, ),  # 2
+    )
+
+    def __init__(self, device=None, dev_port=None,):
+        self.device = device
+        self.dev_port = dev_port
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.I32:
+                    self.dev_port = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_enable_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        if self.dev_port is not None:
+            oprot.writeFieldBegin('dev_port', TType.I32, 2)
+            oprot.writeI32(self.dev_port)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_enable_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_enable_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_dis_args(object):
+    """
+    Attributes:
+     - device
+     - dev_port
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+        (2, TType.I32, 'dev_port', None, None, ),  # 2
+    )
+
+    def __init__(self, device=None, dev_port=None,):
+        self.device = device
+        self.dev_port = dev_port
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.I32:
+                    self.dev_port = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_dis_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        if self.dev_port is not None:
+            oprot.writeFieldBegin('dev_port', TType.I32, 2)
+            oprot.writeI32(self.dev_port)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_dis_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_dis_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_switchd_port_cleanup_args(object):
+    """
+    Attributes:
+     - device
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+    )
+
+    def __init__(self, device=None,):
+        self.device = device
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_switchd_port_cleanup_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_switchd_port_cleanup_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_switchd_port_cleanup_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_oper_status_get_args(object):
+    """
+    Attributes:
+     - device
+     - dev_port
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+        (2, TType.I32, 'dev_port', None, None, ),  # 2
+    )
+
+    def __init__(self, device=None, dev_port=None,):
+        self.device = device
+        self.dev_port = dev_port
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.I32:
+                    self.dev_port = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_oper_status_get_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        if self.dev_port is not None:
+            oprot.writeFieldBegin('dev_port', TType.I32, 2)
+            oprot.writeI32(self.dev_port)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_oper_status_get_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_oper_status_get_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_board_type_get_args(object):
+
+    thrift_spec = (
+    )
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_board_type_get_args')
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_board_type_get_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_board_type_get_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_an_set_args(object):
+    """
+    Attributes:
+     - device
+     - dev_port
+     - an_flag
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+        (2, TType.I32, 'dev_port', None, None, ),  # 2
+        (3, TType.I32, 'an_flag', None, None, ),  # 3
+    )
+
+    def __init__(self, device=None, dev_port=None, an_flag=None,):
+        self.device = device
+        self.dev_port = dev_port
+        self.an_flag = an_flag
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.I32:
+                    self.dev_port = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 3:
+                if ftype == TType.I32:
+                    self.an_flag = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_an_set_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        if self.dev_port is not None:
+            oprot.writeFieldBegin('dev_port', TType.I32, 2)
+            oprot.writeI32(self.dev_port)
+            oprot.writeFieldEnd()
+        if self.an_flag is not None:
+            oprot.writeFieldBegin('an_flag', TType.I32, 3)
+            oprot.writeI32(self.an_flag)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_port_an_set_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_port_an_set_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_serdes_lane_map_set_args(object):
+    """
+    Attributes:
+     - device
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+    )
+
+    def __init__(self, device=None,):
+        self.device = device
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_serdes_lane_map_set_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_serdes_lane_map_set_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_serdes_lane_map_set_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_serdes_init_args(object):
+    """
+    Attributes:
+     - device
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.BYTE, 'device', None, None, ),  # 1
+    )
+
+    def __init__(self, device=None,):
+        self.device = device
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.BYTE:
+                    self.device = iprot.readByte()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_serdes_init_args')
+        if self.device is not None:
+            oprot.writeFieldBegin('device', TType.BYTE, 1)
+            oprot.writeByte(self.device)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
+class pltfm_pm_serdes_init_result(object):
+    """
+    Attributes:
+     - success
+     - ouch
+    """
+
+    thrift_spec = (
+        (0, TType.I32, 'success', None, None, ),  # 0
+        (1, TType.STRUCT, 'ouch', (InvalidPltfmPmOperation, InvalidPltfmPmOperation.thrift_spec), None, ),  # 1
+    )
+
+    def __init__(self, success=None, ouch=None,):
+        self.success = success
+        self.ouch = ouch
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 0:
+                if ftype == TType.I32:
+                    self.success = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 1:
+                if ftype == TType.STRUCT:
+                    self.ouch = InvalidPltfmPmOperation()
+                    self.ouch.read(iprot)
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('pltfm_pm_serdes_init_result')
+        if self.success is not None:
+            oprot.writeFieldBegin('success', TType.I32, 0)
+            oprot.writeI32(self.success)
+            oprot.writeFieldEnd()
+        if self.ouch is not None:
+            oprot.writeFieldBegin('ouch', TType.STRUCT, 1)
+            self.ouch.write(oprot)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/ttypes.py b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/ttypes.py
new file mode 100644
index 0000000..3e0404c
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/gen-py/pltfm_pm_rpc/ttypes.py
@@ -0,0 +1,175 @@
+#
+# Autogenerated by Thrift Compiler (0.10.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+#  options string: py
+#
+
+from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
+from thrift.protocol.TProtocol import TProtocolException
+import sys
+
+from thrift.transport import TTransport
+
+
+class pltfm_pm_port_speed_t(object):
+    BF_SPEED_NONE = 0
+    BF_SPEED_1G = 1
+    BF_SPEED_10G = 2
+    BF_SPEED_25G = 3
+    BF_SPEED_40G = 4
+    BF_SPEED_40G_NB = 5
+    BF_SPEED_50G = 6
+    BF_SPEED_100G = 7
+    BF_SPEED_40G_NON_BREAKABLE = 8
+
+    _VALUES_TO_NAMES = {
+        0: "BF_SPEED_NONE",
+        1: "BF_SPEED_1G",
+        2: "BF_SPEED_10G",
+        3: "BF_SPEED_25G",
+        4: "BF_SPEED_40G",
+        5: "BF_SPEED_40G_NB",
+        6: "BF_SPEED_50G",
+        7: "BF_SPEED_100G",
+        8: "BF_SPEED_40G_NON_BREAKABLE",
+    }
+
+    _NAMES_TO_VALUES = {
+        "BF_SPEED_NONE": 0,
+        "BF_SPEED_1G": 1,
+        "BF_SPEED_10G": 2,
+        "BF_SPEED_25G": 3,
+        "BF_SPEED_40G": 4,
+        "BF_SPEED_40G_NB": 5,
+        "BF_SPEED_50G": 6,
+        "BF_SPEED_100G": 7,
+        "BF_SPEED_40G_NON_BREAKABLE": 8,
+    }
+
+
+class pltfm_pm_fec_type_t(object):
+    BF_FEC_TYP_NONE = 0
+    BF_FEC_TYP_FIRECODE = 1
+    BF_FEC_TYP_REED_SOLOMON = 2
+
+    _VALUES_TO_NAMES = {
+        0: "BF_FEC_TYP_NONE",
+        1: "BF_FEC_TYP_FIRECODE",
+        2: "BF_FEC_TYP_REED_SOLOMON",
+    }
+
+    _NAMES_TO_VALUES = {
+        "BF_FEC_TYP_NONE": 0,
+        "BF_FEC_TYP_FIRECODE": 1,
+        "BF_FEC_TYP_REED_SOLOMON": 2,
+    }
+
+
+class pltfm_pm_oper_status_t(object):
+    DOWN = 0
+    UP = 1
+
+    _VALUES_TO_NAMES = {
+        0: "DOWN",
+        1: "UP",
+    }
+
+    _NAMES_TO_VALUES = {
+        "DOWN": 0,
+        "UP": 1,
+    }
+
+
+class pltfm_pm_board_type_t(object):
+    BF_PLTFM_BD_ID_MAVERICKS_P0A = 564
+    BF_PLTFM_BD_ID_MAVERICKS_P0B = 4660
+    BF_PLTFM_BD_ID_MONTARA_P0A = 8756
+    BF_PLTFM_BD_ID_MONTARA_P0B = 12852
+    BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU = 16948
+    BF_PLTFM_BD_ID_UNKNOWN = 0
+    XFFFF = 1
+
+    _VALUES_TO_NAMES = {
+        564: "BF_PLTFM_BD_ID_MAVERICKS_P0A",
+        4660: "BF_PLTFM_BD_ID_MAVERICKS_P0B",
+        8756: "BF_PLTFM_BD_ID_MONTARA_P0A",
+        12852: "BF_PLTFM_BD_ID_MONTARA_P0B",
+        16948: "BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU",
+        0: "BF_PLTFM_BD_ID_UNKNOWN",
+        1: "XFFFF",
+    }
+
+    _NAMES_TO_VALUES = {
+        "BF_PLTFM_BD_ID_MAVERICKS_P0A": 564,
+        "BF_PLTFM_BD_ID_MAVERICKS_P0B": 4660,
+        "BF_PLTFM_BD_ID_MONTARA_P0A": 8756,
+        "BF_PLTFM_BD_ID_MONTARA_P0B": 12852,
+        "BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU": 16948,
+        "BF_PLTFM_BD_ID_UNKNOWN": 0,
+        "XFFFF": 1,
+    }
+
+
+class InvalidPltfmPmOperation(TException):
+    """
+    Attributes:
+     - code
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.I32, 'code', None, None, ),  # 1
+    )
+
+    def __init__(self, code=None,):
+        self.code = code
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.I32:
+                    self.code = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('InvalidPltfmPmOperation')
+        if self.code is not None:
+            oprot.writeFieldBegin('code', TType.I32, 1)
+            oprot.writeI32(self.code)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        return
+
+    def __str__(self):
+        return repr(self)
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
diff --git a/tools/test/tofino-port-auto-setup-tool/thrift/pltfm_pm_rpc.thrift b/tools/test/tofino-port-auto-setup-tool/thrift/pltfm_pm_rpc.thrift
new file mode 100644
index 0000000..b556518
--- /dev/null
+++ b/tools/test/tofino-port-auto-setup-tool/thrift/pltfm_pm_rpc.thrift
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * BAREFOOT NETWORKS CONFIDENTIAL & PROPRIETARY
+ *
+ * Copyright (c) 2015-2016 Barefoot Networks, Inc.
+
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains the property of
+ * Barefoot Networks, Inc. and its suppliers, if any. The intellectual and
+ * technical concepts contained herein are proprietary to Barefoot Networks,
+ * Inc.
+ * and its suppliers and may be covered by U.S. and Foreign Patents, patents in
+ * process, and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material is
+ * strictly forbidden unless prior written permission is obtained from
+ * Barefoot Networks, Inc.
+ *
+ * No warranty, explicit or implicit is provided, unless granted under a
+ * written agreement with Barefoot Networks, Inc.
+ *
+ * $Id: $
+ *
+ ******************************************************************************/
+/*
+        pltfm_pm thrift file
+*/
+
+namespace py pltfm_pm_rpc
+namespace cpp pltfm_pm_rpc
+
+typedef i32 pltfm_pm_status_t
+typedef i32 pltfm_pm_dev_port_t
+typedef byte pltfm_pm_device_t
+
+exception InvalidPltfmPmOperation {
+  1:i32 code
+}
+
+enum pltfm_pm_port_speed_t {
+  BF_SPEED_NONE = 0,
+  BF_SPEED_1G = 1,
+  BF_SPEED_10G = 2,
+  BF_SPEED_25G = 3,
+  BF_SPEED_40G = 4,
+  BF_SPEED_40G_NB = 5,
+  BF_SPEED_50G = 6,
+  BF_SPEED_100G = 7,
+  BF_SPEED_40G_NON_BREAKABLE = 8
+}
+
+enum pltfm_pm_fec_type_t {
+  BF_FEC_TYP_NONE = 0,
+  BF_FEC_TYP_FIRECODE = 1,
+  BF_FEC_TYP_REED_SOLOMON = 2
+}
+
+enum pltfm_pm_oper_status_t {
+  DOWN = 0,
+  UP = 1
+}
+
+enum pltfm_pm_board_type_t {
+  BF_PLTFM_BD_ID_MAVERICKS_P0A = 0x0234,
+  BF_PLTFM_BD_ID_MAVERICKS_P0B = 0x1234,
+  BF_PLTFM_BD_ID_MONTARA_P0A = 0x2234,
+  BF_PLTFM_BD_ID_MONTARA_P0B = 0x3234,
+  BF_PLTFM_BD_ID_MAVERICKS_P0B_EMU = 0x4234,
+  BF_PLTFM_BD_ID_UNKNOWN = 0XFFFF
+}
+
+service pltfm_pm_rpc {
+    /* init */
+    pltfm_pm_status_t pltfm_pm_port_add(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port, 3:pltfm_pm_port_speed_t ps, 4:pltfm_pm_fec_type_t fec) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_port_del(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_port_enable(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_port_dis(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_switchd_port_cleanup(1:pltfm_pm_device_t device) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_oper_status_t pltfm_pm_port_oper_status_get(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_board_type_t pltfm_pm_board_type_get() throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_port_an_set(1:pltfm_pm_device_t device, 2:pltfm_pm_dev_port_t dev_port, 3:i32 an_flag) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_serdes_lane_map_set(1:pltfm_pm_device_t device) throws (1:InvalidPltfmPmOperation ouch);
+    pltfm_pm_status_t pltfm_pm_serdes_init(1:pltfm_pm_device_t device) throws (1:InvalidPltfmPmOperation ouch);
+}