@@ -70,6 +70,7 @@ def __init__(self, db_id: int, connector: str, gearbox: Gearbox):
70
70
DVSDatabase .__init__ (self , db_id , connector )
71
71
self .gearbox = gearbox
72
72
self .ports = {}
73
+ self .port_oid_to_intf_idx = {}
73
74
self ._wait_for_gb_asic_db_to_initialize ()
74
75
75
76
for connector in self .get_keys ("ASIC_STATE:SAI_OBJECT_TYPE_PORT_CONNECTOR" ):
@@ -88,9 +89,29 @@ def __init__(self, db_id: int, connector: str, gearbox: Gearbox):
88
89
if intf ["system_lanes" ] == system_lanes :
89
90
assert intf ["line_lanes" ] == line_lanes
90
91
self .ports [intf ["index" ]] = (system_port_oid , line_port_oid )
92
+ self .port_oid_to_intf_idx [system_port_oid ] = (i , True )
93
+ self .port_oid_to_intf_idx [line_port_oid ] = (i , False )
91
94
92
95
assert len (self .ports ) == len (self .gearbox .interfaces )
93
96
97
+ for serdes in self .get_keys ("ASIC_STATE:SAI_OBJECT_TYPE_PORT_SERDES" ):
98
+ fvs = self .get_entry ("ASIC_STATE:SAI_OBJECT_TYPE_PORT_SERDES" , serdes )
99
+ port_oid = fvs .get ("SAI_PORT_SERDES_ATTR_PORT_ID" )
100
+ intf_idx , is_system = self .port_oid_to_intf_idx [port_oid ]
101
+ intf = self .gearbox .interfaces [ intf_idx ]
102
+ appl_db_key_prefix = 'system_' if is_system else 'line_'
103
+ for asic_db_key , appl_db_key_suffix in [
104
+ ("SAI_PORT_SERDES_ATTR_TX_FIR_MAIN" , "tx_fir_main" ),
105
+ ("SAI_PORT_SERDES_ATTR_TX_FIR_PRE1" , "tx_fir_pre1" ),
106
+ ("SAI_PORT_SERDES_ATTR_TX_FIR_PRE2" , "tx_fir_pre2" ),
107
+ ("SAI_PORT_SERDES_ATTR_TX_FIR_POST1" , "tx_fir_post1" ),
108
+ ("SAI_PORT_SERDES_ATTR_TX_FIR_POST2" , "tx_fir_post2" ),
109
+ ]:
110
+ if asic_db_key not in fvs :
111
+ continue
112
+ asic_db_value = fvs .get (asic_db_key ).split (":" )[- 1 ]
113
+ assert intf [appl_db_key_prefix + appl_db_key_suffix ] == asic_db_value
114
+
94
115
def _wait_for_gb_asic_db_to_initialize (self ) -> None :
95
116
"""Wait up to 30 seconds for the default fields to appear in ASIC DB."""
96
117
def _verify_db_contents ():
0 commit comments