tdl-xoa-driver 1.5.0__py3-none-any.whl → 1.5.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tdl-xoa-driver
3
- Version: 1.5.0
4
- Summary: TDL XOA Python API is a Python library providing user-friendly communication interfaces to Teledyne LeCroy Xena Ethernet traffic generation test equipment. It provides a rich collection of APIs that can be used to either write test scripts or develop applications.
3
+ Version: 1.5.0b1
4
+ Summary: XOA Driver is a Python library providing user-friendly communication interfaces to Teledyne LeCroy Xena Ethernet traffic generation test equipment. It provides a rich collection of APIs that can be used to either write test scripts or develop applications.
5
5
  Home-page: https://github.com/xenanetworks/tdl-xoa-driver
6
6
  Author: Leonard Yu, Zoltan Hanisch
7
7
  Author-email: Leonard.Yu@teledyne.com, Zoltan.Hanisch@teledyne.com
@@ -33,15 +33,15 @@ Dynamic: requires-python
33
33
  Dynamic: summary
34
34
 
35
35
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tdl-xoa-driver) [![PyPI](https://img.shields.io/pypi/v/tdl-xoa-driver)](https://pypi.python.org/pypi/tdl-xoa-driver) [![Documentation Status](https://readthedocs.com/projects/xena-networks-tdl-xoa-driver/badge/?version=latest)](https://docs.xenanetworks.com/projects/tdl-xoa-driver/en/latest/?badge=latest)
36
- # TDL XOA Python API
37
- TDL XOA Python API is a standalone Python library that provides a user-friendly and powerful interface for automating network testing tasks using Xena Networks test equipment. Xena test equipment is a high-performance network test device designed for testing and measuring the performance of network equipment and applications.
36
+ # XOA Driver
37
+ XOA Driver is a standalone Python library that provides a user-friendly and powerful interface for automating network testing tasks using Xena Networks test equipment. Xena test equipment is a high-performance network test device designed for testing and measuring the performance of network equipment and applications.
38
38
 
39
39
  ## Introduction
40
- The TDL XOA Python API is designed to be easy to use and integrate with other automation tools and frameworks. It provides a comprehensive set of methods and classes for interacting with Xena test equipment, including the ability to create and run complex test scenarios, generate and analyze traffic at line rate, and perform detailed analysis of network performance and behavior.
40
+ The XOA Driver is designed to be easy to use and integrate with other automation tools and frameworks. It provides a comprehensive set of methods and classes for interacting with Xena test equipment, including the ability to create and run complex test scenarios, generate and analyze traffic at line rate, and perform detailed analysis of network performance and behavior.
41
41
 
42
- The TDL XOA Python API simplifies the process of automating network testing tasks using Xena test equipment. It provides a simple, yet powerful, interface for interacting with Xena test equipment using the Python programming language. With the TDL XOA Python API, network engineers and testing professionals can easily create and execute test scenarios, generate and analyze traffic, and perform detailed analysis of network performance and behavior, all while leveraging the power and flexibility of the Python programming language.
42
+ The XOA Driver simplifies the process of automating network testing tasks using Xena test equipment. It provides a simple, yet powerful, interface for interacting with Xena test equipment using the Python programming language. With the XOA Driver, network engineers and testing professionals can easily create and execute test scenarios, generate and analyze traffic, and perform detailed analysis of network performance and behavior, all while leveraging the power and flexibility of the Python programming language.
43
43
 
44
- Overall, the TDL XOA Python API is a valuable tool for anyone looking to automate their network testing tasks using Xena test equipment. With its simple, yet powerful, interface and support for the Python programming language, the TDL XOA Python API provides a flexible and extensible framework for automating network testing tasks and improving the quality of network infrastructure.
44
+ Overall, the XOA Driver is a valuable tool for anyone looking to automate their network testing tasks using Xena test equipment. With its simple, yet powerful, interface and support for the Python programming language, the XOA Driver provides a flexible and extensible framework for automating network testing tasks and improving the quality of network infrastructure.
45
45
 
46
46
  ## Documentation
47
47
  The user documentation is hosted:
@@ -1,5 +1,5 @@
1
- tdl_xoa_driver-1.5.0.dist-info/licenses/LICENSE,sha256=Oc3Sih78tKR5tfTaIGcU3qytyX6JAzzAUlwW-qQaRaQ,11351
2
- xoa_driver/__init__.py,sha256=EVqC3P32gzbLOIwM_qFsWGkiAdZUF-R9Ukew3M39koQ,48
1
+ tdl_xoa_driver-1.5.0b1.dist-info/licenses/LICENSE,sha256=Oc3Sih78tKR5tfTaIGcU3qytyX6JAzzAUlwW-qQaRaQ,11351
2
+ xoa_driver/__init__.py,sha256=toYGpyit6mdS5499zhu0n3s6XQfzEKLMaKylpr_SP0Q,50
3
3
  xoa_driver/enums.py,sha256=SgwfIdPYol1AOZ-vl0ZtV3pRc3qXjm6QMq8ryOzjmuY,8559
4
4
  xoa_driver/exceptions.py,sha256=baNpophPmeNujMTSfL9TsYHa3Gju2-ozNOg78n8tqN8,1957
5
5
  xoa_driver/hlfuncs.py,sha256=tfyhbYX86XWpc4yFoBrj1OYqVJJfDnoxC6tHLlWTHkQ,311
@@ -16,12 +16,12 @@ xoa_driver/functions/exceptions.py,sha256=JlQSHNmiSS_mOQygqituLQF5fFVg38LG4Ktz7q
16
16
  xoa_driver/functions/headers.py,sha256=Rf_em8LqCZOz0oxiqvtAFwx71_CtD9_I0p-vEZWtc6E,33886
17
17
  xoa_driver/functions/mgmt.py,sha256=njuTrUDgtXwNk0OllFjCObVJXwQ4l4-a2RA7KAORpZU,16513
18
18
  xoa_driver/functions/tools.py,sha256=d4p-v49qwXCQW1NFKRhLmT7Lje2H8EGaRy2inDmLJ18,9786
19
- xoa_driver/functions/cli/__init__.py,sha256=1qCG8oiucQ51v8tS6mAvu9MpBDQ4dqDhzx-EvdhDTQQ,458
20
- xoa_driver/functions/cli/_cli_manager.py,sha256=MKU2wS0Gxd514zvyWsm4qiYg-WLPA6vrHZy2QFcqpsU,22166
19
+ xoa_driver/functions/cli/__init__.py,sha256=OAl_kI2q7qf9aDsm2ib5_UIUSHpXLcLNFMMF9dlhwNc,468
20
+ xoa_driver/functions/cli/_cli_manager.py,sha256=B_ILKXL3VhoTGWzB4UrB1UV7LQKc2C45pm9m4BJSaEA,22162
21
21
  xoa_driver/functions/cli/_config_block.py,sha256=KaNiAq4ht6Hfoo7iE2h03SAXhE3WX5efyHJcE74dYto,12245
22
22
  xoa_driver/functions/cli/_socket_driver.py,sha256=rVmkSQZr4Ygu8NNkOSuW9_5dqaSc0kpF1SUaV2jPwJs,3334
23
- xoa_driver/functions/cli/port_config.py,sha256=VYsrRyuB7gctUlNLb2gqYXz_slj41lkdAGsj8AePqCU,4534
24
- xoa_driver/functions/cli/testbed_config.py,sha256=EU2xZHFO4ugWK-cEg9IA2foNON2-n2RjTej0cN68M-U,8229
23
+ xoa_driver/functions/cli/port_config.py,sha256=4YX7tIWXXtgKWM6-9Nt_bXhY-SfWv0hqA4U26SvvH4I,4170
24
+ xoa_driver/functions/cli/test_case_config.py,sha256=_dLPENNihGO40PPpg99LJxPe8TSkXTRFavN07bMdfPY,8016
25
25
  xoa_driver/functions/cmis/__init__.py,sha256=AWHrzTQYDJFmC_7vkZfin6AhehyQRojxbWLUNhCIlzc,113
26
26
  xoa_driver/functions/cmis/_constants.py,sha256=VqjqpeByPEHMnMNdEeQe8hwUe6-QwtOMDwusiay638g,645
27
27
  xoa_driver/functions/cmis/_replies.py,sha256=kw-7Ua_Ddu5_9fjVwQfEI-AlyPy6-c7uS7HyPKgNHHQ,22975
@@ -38,7 +38,7 @@ xoa_driver/internals/commands/m_commands.py,sha256=gslylrFybNN4juTqNkCENiGWvosWz
38
38
  xoa_driver/internals/commands/p4_commands.py,sha256=3nj6suKf0PCC7jMSGidzeAmm4VTpFd5qz2FukuF5R40,78768
39
39
  xoa_driver/internals/commands/p4e_commands.py,sha256=2hIa6S5aHY_Bht1QQ3ql3cFTLoWwwcGzvslAXeXc6rg,5056
40
40
  xoa_driver/internals/commands/p4g_commands.py,sha256=noIrvLYsjrc_t9hQ0msOCaOA0NsVNdTIySIjHoJEnOM,292438
41
- xoa_driver/internals/commands/p_commands.py,sha256=GlZ1P2zAlKZPlePs-apRyYEjsKreKbdHg4NuCsl02Uw,230083
41
+ xoa_driver/internals/commands/p_commands.py,sha256=4UKJXG1T9dyN5QUH8AUorCRQT1orddf4mT0a2gfkFOs,228549
42
42
  xoa_driver/internals/commands/pc_commands.py,sha256=uJe-wTla8vVDFChfSqpDNbpxCwx9OJ7WET2oM5KNHOs,11060
43
43
  xoa_driver/internals/commands/pd_commands.py,sha256=s0Ts7RN6WASyUGuuGmlxEPxDKSsnM50SXRbIFhTtsiQ,12492
44
44
  xoa_driver/internals/commands/pe_commands.py,sha256=z5YgV85RMw6CFYQF5Z8qKyCujiGk1psV-KYEdZeIBkU,38690
@@ -46,10 +46,10 @@ xoa_driver/internals/commands/pec_commands.py,sha256=bu2uSpMObsGob1QM4YzyhVAW6aN
46
46
  xoa_driver/internals/commands/ped_commands.py,sha256=J_QQxgrun71UWFpOQTFBxZe5tK-hOPxtCWiAGFKSc8Y,39736
47
47
  xoa_driver/internals/commands/pef_commands.py,sha256=q-JLQ2-JOHwfu-Ku28cc89mwJtKP_rJ9-QtFvOOxNVk,82219
48
48
  xoa_driver/internals/commands/pf_commands.py,sha256=5PVBA8N6G-1O6PN1l1XmmKKYS8DkGRz2NV6z6NuppKU,14540
49
- xoa_driver/internals/commands/pl1_commands.py,sha256=oJVLGGoSDyL3X8Llmhm36Ajp38gsJgQLcI69RXZEHnE,69312
49
+ xoa_driver/internals/commands/pl1_commands.py,sha256=mM0kNH8Te2YXD-OfDqkJv1Q5EwsHbczBSM0iTZAQWYQ,66370
50
50
  xoa_driver/internals/commands/pl_commands.py,sha256=znhmeTgPlqURsJ2dxIvQnOioE-qU2650fLtHaK0ZiMs,6382
51
51
  xoa_driver/internals/commands/pm_commands.py,sha256=tlt3yoEpCnjRmJ2EEq-BCOeBH4oppXvl5mea172Z_KA,9514
52
- xoa_driver/internals/commands/pp_commands.py,sha256=VK03-T3695ehn9l_tBNmKYf4L7qo-mxUAcpxLalq_Vk,82448
52
+ xoa_driver/internals/commands/pp_commands.py,sha256=dKi8oqE0iKOVdtiTjqrZq772NfkpcafR8xMR6HdE69E,82762
53
53
  xoa_driver/internals/commands/pr_commands.py,sha256=CeDP8ZJPGiwFUKkgFfYN84loNwWDxQdHV4Fi2JVuYZI,31871
54
54
  xoa_driver/internals/commands/ps_commands.py,sha256=o5x24Z7kz-3jXRsTxmehkmG_0pbeYLldFbtPgu6fEZQ,96440
55
55
  xoa_driver/internals/commands/pt_commands.py,sha256=bBWPSppymycMH3CDZLQJoDXR2YdRsGJpVB3MVRNa81Q,15187
@@ -147,11 +147,10 @@ xoa_driver/internals/hli/modules/modules_l23/module_l23_base.py,sha256=TIB77QUNf
147
147
  xoa_driver/internals/hli/ports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
148
148
  xoa_driver/internals/hli/ports/base_port.py,sha256=8p25Wh2lTd9CEFueuhm-y8yvNMIW8yoz6oUxVbWlFC8,3646
149
149
  xoa_driver/internals/hli/ports/port_l23/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
- xoa_driver/internals/hli/ports/port_l23/edun_l1.py,sha256=bXOzhk_TByWdmaTQf4ZlpEdvJBKNtxMsSJnEd2V4dBs,5853
151
150
  xoa_driver/internals/hli/ports/port_l23/family_combi.py,sha256=0FCeQ0B2Jjth7jqvJexSI6ODCZk6Rm48_Vr_edZBRyI,1001
152
151
  xoa_driver/internals/hli/ports/port_l23/family_d.py,sha256=o9QzNcBORpAbsFSl_MN83J4Tjhmk7w77bAN2FlRyyWQ,1166
153
152
  xoa_driver/internals/hli/ports/port_l23/family_e.py,sha256=s7aL5b9d9E8Zsm63oIqA6ZUZ74PPug8GPWpsHQsJRCs,2678
154
- xoa_driver/internals/hli/ports/port_l23/family_edun.py,sha256=Rm95n8z6qLNTE41nbhr_VaK8tJ4yy8boKyIWgQwOZbs,2275
153
+ xoa_driver/internals/hli/ports/port_l23/family_edun.py,sha256=YWeT_RUEEZaQRcu3HybTo34H1A9bApopHZITdud0cms,2260
155
154
  xoa_driver/internals/hli/ports/port_l23/family_f.py,sha256=vx0rN-vQP7v8m5Pcc6RvlisNui0IxMxKvab54Iwn2_4,4007
156
155
  xoa_driver/internals/hli/ports/port_l23/family_g.py,sha256=OeDpsOr-65V_FWuhifeXH3gaJpKbyftdtWgU8X-_ous,2011
157
156
  xoa_driver/internals/hli/ports/port_l23/family_h.py,sha256=MeUehj0unvHX9W3glfVORKdqX8kbu-hmZvMtwJbE-go,1840
@@ -159,7 +158,7 @@ xoa_driver/internals/hli/ports/port_l23/family_i.py,sha256=ZHXXiO0LOUbRCSXcYize1
159
158
  xoa_driver/internals/hli/ports/port_l23/family_j.py,sha256=SZ2RYsI63Z6xatcfIcyLobrpuuofdEFty3JU51s2tcY,1858
160
159
  xoa_driver/internals/hli/ports/port_l23/family_k.py,sha256=X8l9kZe58dizhzNbC-JY3z2m-_YwsGdE_tf_73NiZw0,1952
161
160
  xoa_driver/internals/hli/ports/port_l23/family_l.py,sha256=Ao3-XNKpBi-4s49guS5Yc8Hk0DWX0yJ40YMnL0KjzdU,2148
162
- xoa_driver/internals/hli/ports/port_l23/family_l1.py,sha256=DifAvVGI48gx4ps1syQJ1B1FnxYz9gkLhQVqcCv1pxc,3867
161
+ xoa_driver/internals/hli/ports/port_l23/family_l1.py,sha256=WWaEe7qmdE3xY9ExO6HLHjymCGMrNeRLCpcetcyCnmI,3851
163
162
  xoa_driver/internals/hli/ports/port_l23/family_m.py,sha256=rvYpgYvN9Mrb_abxW-J1Zwn-36nCh_oBrNF0IV2qcIE,779
164
163
  xoa_driver/internals/hli/ports/port_l23/fault_jkl.py,sha256=vsbpTsBGhQJHlb6cdhaKIIosif4Vh5mn5luYO_tOPtk,641
165
164
  xoa_driver/internals/hli/ports/port_l23/freya_l1.py,sha256=wdNZDLHrSd3SxFVR3-C3ZPcE4SzjfcdsoLeKjV6_UuI,28777
@@ -225,7 +224,7 @@ xoa_driver/internals/utils/managers/abc.py,sha256=M3XgI2FVQLUXixS5SKnZTm0MweHY6D
225
224
  xoa_driver/internals/utils/managers/exceptions.py,sha256=fqLSin-OQCIKuhpzvK6RZThF3FJ8FsHers4EmqM9gSs,628
226
225
  xoa_driver/internals/utils/managers/modules_manager.py,sha256=sCEhqUu7Waot16rucJ5nI9FyHuFEeU_sBx1JjZdhDJg,3236
227
226
  xoa_driver/internals/utils/managers/ports_manager.py,sha256=FRizJ4-V0iE66cSuswW01-6QvXhCuGxHGvmtaDVOeFg,3484
228
- tdl_xoa_driver-1.5.0.dist-info/METADATA,sha256=n9lA_6UpADSopJmiimWHcVkbofDK-SwhhIzh5W6Nx4U,4163
229
- tdl_xoa_driver-1.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
230
- tdl_xoa_driver-1.5.0.dist-info/top_level.txt,sha256=sBbN3hwpa4s2VxsUBoWJ5jIqqDr50vgcEb-V8kL7pvE,11
231
- tdl_xoa_driver-1.5.0.dist-info/RECORD,,
227
+ tdl_xoa_driver-1.5.0b1.dist-info/METADATA,sha256=QJGr1OksZNy3I8SyINx0bWSjpPOFvN2UL2Mqwraga0c,4101
228
+ tdl_xoa_driver-1.5.0b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
229
+ tdl_xoa_driver-1.5.0b1.dist-info/top_level.txt,sha256=sBbN3hwpa4s2VxsUBoWJ5jIqqDr50vgcEb-V8kL7pvE,11
230
+ tdl_xoa_driver-1.5.0b1.dist-info/RECORD,,
xoa_driver/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.5.0"
1
+ __version__ = "1.5.0b1"
2
2
  __short_version__ = "1.5"
@@ -6,16 +6,16 @@ from .port_config import (
6
6
  load_port_config,
7
7
  port_config_from_file,
8
8
  )
9
- from .testbed_config import (
10
- save_testbed_config,
11
- load_testbed_config,
9
+ from .test_case_config import (
10
+ save_test_case_config,
11
+ load_test_case_config,
12
12
  module_config_from_file,
13
13
  )
14
14
  __all__ = (
15
15
  "save_port_config",
16
16
  "load_port_config",
17
17
  "port_config_from_file",
18
- "save_testbed_config",
19
- "load_testbed_config",
18
+ "save_test_case_config",
19
+ "load_test_case_config",
20
20
  "module_config_from_file",
21
21
  )
@@ -150,12 +150,12 @@ class XOACLIManager:
150
150
  # Check for C_LOGON or password in string, as a safeguard
151
151
  if re.search(r'C_LOGON\s*".*"', msg) or re.search(r'password\s*=\s*".*"', msg, flags=re.IGNORECASE) or re.search(r'--password=\S+', msg, flags=re.IGNORECASE):
152
152
  logging.info(f"{time.time()} [Sensitive command redacted]")
153
- # print(f"{time.time()} [Sensitive command redacted]")
153
+ print(f"{time.time()} [Sensitive command redacted]")
154
154
  return
155
155
  # Redact as an additional precaution
156
156
  safe_msg = _redact_sensitive(msg)
157
157
  logging.info(f"{time.time()} {safe_msg}")
158
- # print(f"{time.time()} {safe_msg}")
158
+ print(f"{time.time()} {safe_msg}")
159
159
  def log_command(self, cmd:str) -> None:
160
160
  """Place the command in the log cmd list for later logging
161
161
 
@@ -1,11 +1,10 @@
1
1
  import asyncio
2
2
  from xoa_driver import testers, ports
3
- from typing import List, Tuple
4
3
  from ._cli_manager import XOACLIManager
5
4
  from ._config_block import *
6
5
 
7
6
  async def save_port_config(tester: testers.L23Tester, port: ports.GenericL23Port, path: str, debug=False, halt_on_error=False) -> str:
8
- """Save port config to the specified filepath
7
+ """Save configuration from the test port to the specified filepath
9
8
 
10
9
  :param tester: Chassis object
11
10
  :type tester: testers.L23Tester
@@ -49,12 +48,12 @@ async def save_port_config(tester: testers.L23Tester, port: ports.GenericL23Port
49
48
 
50
49
  # Save configuration to file
51
50
  result = port_config_block.config_block_str
52
- with open(path, 'w+') as xpcfile:
51
+ with open(path, 'w+', newline='') as xpcfile:
53
52
  xpcfile.write(result)
54
53
  return result
55
54
 
56
- async def load_port_config(tester: testers.L23Tester, port: ports.GenericL23Port, path: str, debug=False, halt_on_error=False) -> List[Tuple[str, str]]:
57
- """Load port config from the specified filepath
55
+ async def load_port_config(tester: testers.L23Tester, port: ports.GenericL23Port, path: str, debug=False, halt_on_error=False) -> None:
56
+ """Load configuration to the test port from the specified filepath
58
57
 
59
58
  :param tester: Chassis object
60
59
  :type tester: testers.L23Tester
@@ -62,8 +61,6 @@ async def load_port_config(tester: testers.L23Tester, port: ports.GenericL23Port
62
61
  :type port: ports.GenericL23Port
63
62
  :param load_path: File path to load the port configuration from
64
63
  :type load_path: str
65
- :return: List of tuples containing response and the corresponding command sent
66
- :rtype: List[Tuple[str, str]]
67
64
  """
68
65
 
69
66
  tester_ip = tester.info.host
@@ -80,10 +77,8 @@ async def load_port_config(tester: testers.L23Tester, port: ports.GenericL23Port
80
77
  # Reserve the port before applying configuration
81
78
  xm.reserve_port(port_index)
82
79
 
83
- result: List[Tuple[str, str]] = []
84
-
85
80
  # Read configuration from file
86
- with open(path, 'r', encoding='utf-8') as xpcfile:
81
+ with open(path, 'r', newline='') as xpcfile:
87
82
  config_data = xpcfile.read()
88
83
 
89
84
  # Deserialize config block and send CLI commands
@@ -92,14 +87,12 @@ async def load_port_config(tester: testers.L23Tester, port: ports.GenericL23Port
92
87
  cli_cmds = config_block.commands
93
88
  for cmd in cli_cmds:
94
89
  if cmd.strip(): # Ensure the command is not empty
95
- resp = xm.send(cmd=f"{port_index} {cmd}", sync_on=False)
96
- result.append((resp, f"{port_index} {cmd}"))
90
+ xm.send(cmd=f"{port_index} {cmd}", sync_on=False)
97
91
 
98
92
  # Free the port after applying configuration
99
93
  xm.free_port(port_index)
100
- return result
101
94
 
102
- async def port_config_from_file(tester: testers.L23Tester, port: ports.GenericL23Port, path: str, debug=False, halt_on_error=False) -> List[Tuple[str, str]]:
95
+ async def port_config_from_file(tester: testers.L23Tester, port: ports.GenericL23Port, path: str, debug=False, halt_on_error=False) -> None:
103
96
  """Load port configuration from the specifiied filepath. This function is a wrapper around load_port_config to provide backward compatibility.
104
97
 
105
98
  :param tester: Chassis object
@@ -108,9 +101,7 @@ async def port_config_from_file(tester: testers.L23Tester, port: ports.GenericL2
108
101
  :type port: ports.GenericL23Port
109
102
  :param load_path: File path to load the port configuration from
110
103
  :type load_path: str
111
- :return: List of tuples containing response and command sent
112
- :rtype: List[Tuple[str, str]]
113
104
  """
114
- return await load_port_config(tester, port, path, debug=debug, halt_on_error=halt_on_error)
105
+ await load_port_config(tester, port, path, debug=debug, halt_on_error=halt_on_error)
115
106
 
116
107
 
@@ -1,12 +1,12 @@
1
1
  import asyncio
2
2
  from xoa_driver import testers, modules, ports
3
3
  from ._cli_manager import XOACLIManager
4
- from typing import List, Tuple
4
+ from typing import List
5
5
  from ..mgmt import *
6
6
  from ._config_block import *
7
7
 
8
- async def save_testbed_config(tester: testers.L23Tester, ports: List[ports.GenericL23Port], path: str, testbed_name: str = "<testbed>", with_module_config: bool = True, debug=False, halt_on_error=False) -> str:
9
- """Save testbed configuration to the specifiied filepath
8
+ async def save_test_case_config(tester: testers.L23Tester, ports: List[ports.GenericL23Port], path: str, testbed_name: str = "<testbed>", with_module_config: bool = True, debug=False, halt_on_error=False) -> str:
9
+ """Save module configuration to the specifiied filepath
10
10
 
11
11
  :param tester: Chassis object
12
12
  :type tester: testers.L23Tester
@@ -90,13 +90,13 @@ async def save_testbed_config(tester: testers.L23Tester, ports: List[ports.Gener
90
90
  port_config_block.commands = raw_resp[0]
91
91
  result += "\n" + ";\n" + port_config_block.config_block_str
92
92
 
93
- with open(path, 'w+') as xtcfile:
93
+ with open(path, 'w+', newline='') as xtcfile:
94
94
  xtcfile.write(result)
95
95
 
96
96
  return result
97
97
 
98
- async def load_testbed_config(tester: testers.L23Tester, path: str, mode: str = "default", delay_after_module_config: int = 5, debug=False, halt_on_error=False) -> List[Tuple[str, str]]:
99
- """Load testbed configuration from the specifiied filepath
98
+ async def load_test_case_config(tester: testers.L23Tester, path: str, mode: str = "default", delay_after_module_config: int = 5, debug=False, halt_on_error=False) -> None:
99
+ """Load module configuration from the specifiied filepath
100
100
 
101
101
  :param tester: Chassis object
102
102
  :type tester: testers.L23Tester
@@ -106,8 +106,6 @@ async def load_testbed_config(tester: testers.L23Tester, path: str, mode: str =
106
106
  :type mode: str
107
107
  :param delay_after_module_config: Delay in seconds after configuring each module to ensure proper configuration
108
108
  :type delay_after_module_config: int
109
- :return: List of tuples containing response and the corresponding command sent
110
- :rtype: List[Tuple[str, str]]
111
109
  """
112
110
 
113
111
  tester_ip = tester.info.host
@@ -120,55 +118,50 @@ async def load_testbed_config(tester: testers.L23Tester, path: str, mode: str =
120
118
  # Log on and set username
121
119
  xm.logon_set_owner(tester_password)
122
120
 
123
- result: List[Tuple[str, str]] = []
124
-
125
121
  # Read configuration from file
126
- with open(path, 'r') as xpcfile:
122
+ with open(path, 'r', newline='') as xpcfile:
127
123
  config_data = xpcfile.read()
128
124
 
129
- # Parse the config data to configure modules and ports block by block
130
- config_datas = config_data.split(f";\n")
131
- for block in config_datas:
132
- if config_block_type(config_block_str=block) == ConfigMetadataType.MODULE and mode in ["default", "module"]:
133
- module_block = ConfigBlock()
134
- module_block.config_block_str = block
135
- module_index = module_block.module_id
136
-
137
- # Free the module before applying configuration
138
- module = tester.modules.obtain(int(module_index))
139
- await release_module(module=module, should_release_ports=True)
140
- # Reserve the module before applying configuration
141
- xm.reserve_module(module_index)
142
-
143
- # Send each command to the tester
144
- for cmd in module_block.commands:
145
- if cmd.strip(): # Ensure the command is not empty
146
- # print(f"Applying command: {module_index} {cmd}")
147
- resp = xm.send(cmd=f"{module_index} {cmd}", sync_on=False)
148
- result.append((resp, f"{module_index} {cmd}"))
149
- # Free the module after applying configuration
150
- xm.free_module(module_index)
151
- await asyncio.sleep(delay_after_module_config) # Small delay to ensure proper module configuration
152
-
153
- elif config_block_type(config_block_str=block) == ConfigMetadataType.PORT and mode in ["default", "port"]:
154
- port_block = ConfigBlock()
155
- port_block.config_block_str = block
156
- port_index = port_block.port_id
157
-
158
- # Reserve the port before applying configuration
159
- xm.reserve_port(port_index)
160
-
161
- # Send each command to the tester
162
- for cmd in port_block.commands:
163
- if cmd.strip(): # Ensure the command is not empty
164
- # print(f"Applying command: {port_index} {cmd}")
165
- resp = xm.send(cmd=f"{port_index} {cmd}", sync_on=False)
166
- result.append((resp, f"{port_index} {cmd}"))
167
- # Free the port after applying configuration
168
- xm.free_port(port_index)
169
- return result
170
-
171
- async def module_config_from_file(tester: testers.L23Tester, path: str, debug=False, halt_on_error=False) -> List[Tuple[str, str]]:
125
+ # Parse the config data to configure modules and ports block by block
126
+ config_datas = config_data.split(f";\n")
127
+ for block in config_datas:
128
+ if config_block_type(config_block_str=block) == ConfigMetadataType.MODULE and mode in ["default", "module"]:
129
+ module_block = ConfigBlock()
130
+ module_block.config_block_str = block
131
+ module_index = module_block.module_id
132
+
133
+ # Free the module before applying configuration
134
+ module = tester.modules.obtain(int(module_index))
135
+ await release_module(module=module, should_release_ports=True)
136
+ # Reserve the module before applying configuration
137
+ xm.reserve_module(module_index)
138
+
139
+ # Send each command to the tester
140
+ for cmd in module_block.commands:
141
+ if cmd.strip(): # Ensure the command is not empty
142
+ print(f"Applying command: {module_index} {cmd}")
143
+ xm.send(cmd=f"{module_index} {cmd}", sync_on=False)
144
+ # Free the module after applying configuration
145
+ xm.free_module(module_index)
146
+ await asyncio.sleep(delay_after_module_config) # Small delay to ensure proper module configuration
147
+
148
+ elif config_block_type(config_block_str=block) == ConfigMetadataType.PORT and mode in ["default", "port"]:
149
+ port_block = ConfigBlock()
150
+ port_block.config_block_str = block
151
+ port_index = port_block.port_id
152
+
153
+ # Reserve the port before applying configuration
154
+ xm.reserve_port(port_index)
155
+
156
+ # Send each command to the tester
157
+ for cmd in port_block.commands:
158
+ if cmd.strip(): # Ensure the command is not empty
159
+ print(f"Applying command: {port_index} {cmd}")
160
+ xm.send(cmd=f"{port_index} {cmd}", sync_on=False)
161
+ # Free the port after applying configuration
162
+ xm.free_port(port_index)
163
+
164
+ async def module_config_from_file(tester: testers.L23Tester, path: str, debug=False, halt_on_error=False) -> None:
172
165
  """Load module configuration from the specifiied filepath. This function is a wrapper around load_module_config to provide backward compatibility.
173
166
 
174
167
  :param tester: Chassis object
@@ -176,4 +169,4 @@ async def module_config_from_file(tester: testers.L23Tester, path: str, debug=Fa
176
169
  :param path: File path to load the module configuration from
177
170
  :type path: str
178
171
  """
179
- return await load_testbed_config(tester, path, mode="module", debug=debug, halt_on_error=halt_on_error)
172
+ await load_test_case_config(tester, path, mode="module", debug=debug, halt_on_error=halt_on_error)
@@ -601,44 +601,7 @@ class P_CAPABILITIES:
601
601
  * Bit 0: Normal modifier (16/24-bit) supports little-endian
602
602
  * Bit 1: Extended modifier (32-bit) supports little-endian
603
603
  """
604
- capture_bitmask: int = field(XmpInt(), min_version=470)
605
- """integer, bitmask indicating capture capabilities.
606
-
607
- If all bits are 0: CAPTURE_NOT_SUPPORTED
608
-
609
- Bits [0:11] are for Start triggers:
610
-
611
- * Bit 0: CAPTURE_START_ON
612
- * Bit 1: CAPTURE_START_FCSERROR
613
- * Bit 2: CAPTURE_START_FILTER
614
- * Bit 3: CAPTURE_START_PLDERROR
615
- * Bit 4-11: Reserved
616
-
617
- Bits [12:23] are for Stop triggers:
618
-
619
- * Bit 12: CAPTURE_STOP_FULL
620
- * Bit 13: CAPTURE_STOP_FCSERROR
621
- * Bit 14: CAPTURE_STOP_FILTER
622
- * Bit 15: CAPTURE_STOP_PLDERROR
623
- * Bit 16: CAPTURE_STOP_USERSTOP
624
- * Bit 17-23: Reserved
625
-
626
- Bits [24:31] are for Keep modes:
627
-
628
- * Bit 24: CAPTURE_KEEP_ALL
629
- * Bit 25: CAPTURE_KEEP_FCSERR
630
- * Bit 26: CAPTURE_KEEP_NOTPLD
631
- * Bit 27: CAPTURE_KEEP_TPLD
632
- * Bit 28: CAPTURE_KEEP_FILTER
633
- * Bit 29: CAPTURE_KEEP_PLDERR
634
- * Bit 30-31: Reserved
635
- """
636
- num_txeq_pre: int = field(XmpInt(), min_version=470)
637
- """The number of postcursors = num_txeq - num_txeq_pre - 1."""
638
- txeq_max_seq: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()], length=10), min_version=470)
639
- """max value of individual TXEQ taps, SEQuential: <pre-n> <pre-(n-q)> ... <prr1> <main> <post1> <post2> ...."""
640
- txeq_min_seq: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()], length=10), min_version=470)
641
- """min-value of individual TXEQ taps, SEQuential: <pre-n> <pre-(n-q)> ... <prr1> <main> <post1> <post2> ...."""
604
+
642
605
 
643
606
 
644
607
  def get(self) -> Token[GetDataAttr]:
@@ -1549,6 +1512,7 @@ class P_XMITONE:
1549
1512
  A valid Frame Check Sum is written into the final four bytes.
1550
1513
 
1551
1514
  :param hex_data: raw bytes of the packet in hex to transmit
1515
+ :rtype: typing.List[str]
1552
1516
  """
1553
1517
 
1554
1518
  return Token(self._connection, build_set_request(self, module=self._module, port=self._port, hex_data=hex_data))
@@ -832,16 +832,7 @@ class PL1_PRESET_CONFIG_COEFF:
832
832
  @dataclass
833
833
  class PL1_PHYTXEQ_LEVEL:
834
834
  """
835
- Control and monitor the equalizer settings (mV/dB values) of the on-board PHY in the transmission direction (towards the transceiver cage).
836
-
837
- This command returns a variable number of tap values with module-dependent ordering:
838
-
839
- - **Regular Freya**: Original fixed format [pre3, pre2, pre, main, post]
840
- - **Loki-4P and H-Freya/Edun**: Variable number in N*pre, main, M*post layout
841
- [pre_n, pre_n-1, ..., pre_1, main, post_1, post_2, ..., post_m]
842
-
843
- Use P_CAPABILITIES to query ``numtxeqtaps`` and ``numtxeqpretaps`` to determine
844
- the number of taps and layout.
835
+ Control and monitor the equalizer settings of the on-board PHY in the transmission direction (towards the transceiver cage).
845
836
 
846
837
  .. note::
847
838
 
@@ -858,63 +849,44 @@ class PL1_PHYTXEQ_LEVEL:
858
849
  _serdes_xindex: int
859
850
 
860
851
  class GetDataAttr(ResponseBodyStruct):
861
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
862
- """list of integers, TX EQ tap values in mV/dB. The number and layout depend on the platform:
863
-
864
- - Regular Freya: [pre3, pre2, pre, main, post] where pre3/pre2 in dB/10 (0-71), pre/post in dB/10 (0-187), main in mV (507-998)
865
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, post_2, ..., post_m]
866
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
867
- """
868
-
852
+ pre3: int = field(XmpInt())
853
+ """integer, pre3 tap value in dB/10, ranges from 0 to 71. Default = 0 (neutral)"""
854
+ pre2: int = field(XmpInt())
855
+ """integer, pre2 tap value in dB/10, ranges from 0 to 71. Default = 0 (neutral)"""
856
+ pre: int = field(XmpInt())
857
+ """integer, pre tap value in dB/10, ranges from 0 to 187. Default = 0 (neutral)"""
858
+ main: int = field(XmpInt())
859
+ """integer, main tap value in mV, ranges from 507 to 998."""
860
+ post: int = field(XmpInt())
861
+ """integer, post tap value in dB/10, ranges from 0 to 187 Default = 0 (neutral)"""
862
+
869
863
  class SetDataAttr(RequestBodyStruct):
870
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
871
- """list of integers, TX EQ tap values in mV/dB. The number and layout depend on the platform:
872
-
873
- - Regular Freya: [pre3, pre2, pre, main, post] where pre3/pre2 in dB/10 (0-71), pre/post in dB/10 (0-187), main in mV (507-998)
874
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, post_2, ..., post_m]
875
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
876
- """
864
+ pre3: int = field(XmpInt())
865
+ """integer, pre3 tap value in dB/10, ranges from 0 to 71. Default = 0 (neutral)"""
866
+ pre2: int = field(XmpInt())
867
+ """integer, pre2 tap value in dB/10, ranges from 0 to 71. Default = 0 (neutral)"""
868
+ pre: int = field(XmpInt())
869
+ """integer, pre tap value in dB/10, ranges from 0 to 187. Default = 0 (neutral)"""
870
+ main: int = field(XmpInt())
871
+ """integer, main tap value in mV, ranges from 507 to 998."""
872
+ post: int = field(XmpInt())
873
+ """integer, post tap value in dB/10, ranges from 0 to 187 Default = 0 (neutral)"""
877
874
 
878
875
  def get(self) -> Token[GetDataAttr]:
879
- """Get the TX equalizer settings (mV/dB values) of the on-board PHY.
880
-
881
- The returned tap values layout depends on the platform. Query P_CAPABILITIES
882
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the format.
883
-
884
- :return: list of TX EQ tap values in mV/dB
885
- :rtype: PL1_PHYTXEQ_LEVEL.GetDataAttr
886
- """
887
876
 
888
877
  return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex]))
889
878
 
890
- def set(self, tap_values: typing.List[int]) -> Token[None]:
891
- """Set the TX equalizer settings (mV/dB values) of the on-board PHY.
892
-
893
- The tap values layout depends on the platform. Query P_CAPABILITIES
894
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the required format.
895
-
896
- :param tap_values: list of TX EQ tap values in mV/dB in platform-specific order
897
- :type tap_values: typing.List[int]
898
- """
879
+ def set(self, pre3:int, pre2: int, pre: int, main: int, post: int) -> Token[None]:
899
880
 
900
881
  return Token(
901
882
  self._connection,
902
- build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], tap_values=tap_values))
903
-
883
+ build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], pre3=pre3, pre2=pre2, pre=pre, main=main, post=post))
884
+
904
885
  @register_command
905
886
  @dataclass
906
887
  class PL1_PHYTXEQ_COEFF:
907
888
  """
908
- Control and monitor the equalizer settings (IEEE coefficient values) of the on-board PHY in the transmission direction (towards the transceiver cage).
909
-
910
- This command returns a variable number of tap values with module-dependent ordering:
911
-
912
- - **Regular Freya**: Original fixed format [pre3, pre2, pre, main, post]
913
- - **Loki-4P and H-Freya/Edun**: Variable number in N*pre, main, M*post layout
914
- [pre_n, pre_n-1, ..., pre_1, main, post_1, post_2, ..., post_m]
915
-
916
- Use P_CAPABILITIES to query ``numtxeqtaps`` and ``numtxeqpretaps`` to determine
917
- the number of taps and layout.
889
+ Control and monitor the equalizer settings of the on-board PHY in the transmission direction (towards the transceiver cage).
918
890
 
919
891
  .. note::
920
892
 
@@ -941,48 +913,38 @@ class PL1_PHYTXEQ_COEFF:
941
913
  _serdes_xindex: int
942
914
 
943
915
  class GetDataAttr(ResponseBodyStruct):
944
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
945
- """list of integers, TX EQ tap values as IEEE coefficients scaled by 1E3. The number and layout depend on the platform:
946
-
947
- - Regular Freya: [pre3, pre2, pre, main, post] where pre3/pre/post are negative, pre2/main are positive
948
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
949
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
950
- """
951
-
916
+ pre3: int = field(XmpInt())
917
+ """integer, pre3 tap value, negative, scaled by 1E3. Default = 0 (neutral)"""
918
+ pre2: int = field(XmpInt())
919
+ """integer, pre2 tap value, positive, scaled by 1E3. Default = 0 (neutral)"""
920
+ pre: int = field(XmpInt())
921
+ """integer, pre tap value, negative, scaled by 1E3. Default = 0 (neutral)"""
922
+ main: int = field(XmpInt())
923
+ """integer, main tap value, positive, scaled by 1E3. Default = 1000"""
924
+ post: int = field(XmpInt())
925
+ """integer, post tap value, negative, scaled by 1E3. Default = 0 (neutral)"""
926
+
952
927
  class SetDataAttr(RequestBodyStruct):
953
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
954
- """list of integers, TX EQ tap values as IEEE coefficients scaled by 1E3. The number and layout depend on the platform:
955
-
956
- - Regular Freya: [pre3, pre2, pre, main, post] where pre3/pre/post are negative, pre2/main are positive
957
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
958
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
959
- """
928
+ pre3: int = field(XmpInt())
929
+ """integer, pre3 tap value, negative, scaled by 1E3. Default = 0 (neutral)"""
930
+ pre2: int = field(XmpInt())
931
+ """integer, pre2 tap value, positive, scaled by 1E3. Default = 0 (neutral)"""
932
+ pre: int = field(XmpInt())
933
+ """integer, pre tap value, negative, scaled by 1E3. Default = 0 (neutral)"""
934
+ main: int = field(XmpInt())
935
+ """integer, main tap value, positive, scaled by 1E3. Default = 1000"""
936
+ post: int = field(XmpInt())
937
+ """integer, post tap value, negative, scaled by 1E3. Default = 0 (neutral)"""
960
938
 
961
939
  def get(self) -> Token[GetDataAttr]:
962
- """Get the TX equalizer settings (IEEE coefficient values) of the on-board PHY.
963
-
964
- The returned tap values layout depends on the platform. Query P_CAPABILITIES
965
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the format.
966
-
967
- :return: list of TX EQ tap values as IEEE coefficients scaled by 1E3
968
- :rtype: PL1_PHYTXEQ_COEFF.GetDataAttr
969
- """
970
940
 
971
941
  return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex]))
972
942
 
973
- def set(self, tap_values: typing.List[int]) -> Token[None]:
974
- """Set the TX equalizer settings (IEEE coefficient values) of the on-board PHY.
975
-
976
- The tap values layout depends on the platform. Query P_CAPABILITIES
977
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the required format.
978
-
979
- :param tap_values: list of TX EQ tap values as IEEE coefficients scaled by 1E3 in platform-specific order
980
- :type tap_values: typing.List[int]
981
- """
943
+ def set(self, pre3:int, pre2: int, pre: int, main: int, post: int) -> Token[None]:
982
944
 
983
945
  return Token(
984
946
  self._connection,
985
- build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], tap_values=tap_values))
947
+ build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], pre3=pre3, pre2=pre2, pre=pre, main=main, post=post))
986
948
 
987
949
  @register_command
988
950
  @dataclass
@@ -1383,16 +1345,7 @@ class PL1_ANLT:
1383
1345
  @dataclass
1384
1346
  class PL1_PHYTXEQ:
1385
1347
  """
1386
- Control and monitor the equalizer settings (native values) of the on-board PHY in the transmission direction (towards the transceiver cage).
1387
-
1388
- This command returns a variable number of tap values with module-dependent ordering:
1389
-
1390
- - **Regular Freya**: Original fixed format [pre3, pre2, pre, main, post]
1391
- - **Loki-4P and H-Freya/Edun**: Variable number in N*pre, main, M*post layout
1392
- [pre_n, pre_n-1, ..., pre_1, main, post_1, post_2, ..., post_m]
1393
-
1394
- Use P_CAPABILITIES to query ``numtxeqtaps`` and ``numtxeqpretaps`` to determine
1395
- the number of taps and layout.
1348
+ Control and monitor the equalizer settings of the on-board PHY in the transmission direction (towards the transceiver cage).
1396
1349
 
1397
1350
  .. note::
1398
1351
 
@@ -1409,48 +1362,38 @@ class PL1_PHYTXEQ:
1409
1362
  _serdes_xindex: int
1410
1363
 
1411
1364
  class GetDataAttr(ResponseBodyStruct):
1412
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
1413
- """list of integers, TX EQ tap values (native values). The number and layout depend on the platform:
1414
-
1415
- - Regular Freya: [pre3, pre2, pre, main, post]
1416
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
1417
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
1418
- """
1419
-
1365
+ pre3: int = field(XmpInt())
1366
+ """integer, pre3 tap value. Default = 0 (neutral)"""
1367
+ pre2: int = field(XmpInt())
1368
+ """integer, pre2 tap value. Default = 0 (neutral)"""
1369
+ pre: int = field(XmpInt())
1370
+ """integer, pre tap value. Default = 0 (neutral)"""
1371
+ main: int = field(XmpInt())
1372
+ """integer, main tap value."""
1373
+ post: int = field(XmpInt())
1374
+ """integer, post tap value. Default = 0 (neutral)"""
1375
+
1420
1376
  class SetDataAttr(RequestBodyStruct):
1421
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
1422
- """list of integers, TX EQ tap values (native values). The number and layout depend on the platform:
1423
-
1424
- - Regular Freya: [pre3, pre2, pre, main, post]
1425
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
1426
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
1427
- """
1377
+ pre3: int = field(XmpInt())
1378
+ """integer, pre3 tap value. Default = 0 (neutral)"""
1379
+ pre2: int = field(XmpInt())
1380
+ """integer, pre2 tap value. Default = 0 (neutral)"""
1381
+ pre: int = field(XmpInt())
1382
+ """integer, pre tap value. Default = 0 (neutral)"""
1383
+ main: int = field(XmpInt())
1384
+ """integer, main tap value."""
1385
+ post: int = field(XmpInt())
1386
+ """integer, post tap value. Default = 0 (neutral)"""
1428
1387
 
1429
1388
  def get(self) -> Token[GetDataAttr]:
1430
- """Get the TX equalizer settings (native values) of the on-board PHY.
1431
-
1432
- The returned tap values layout depends on the platform. Query P_CAPABILITIES
1433
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the format.
1434
-
1435
- :return: list of TX EQ tap values (native values)
1436
- :rtype: PL1_PHYTXEQ.GetDataAttr
1437
- """
1438
1389
 
1439
1390
  return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex]))
1440
1391
 
1441
- def set(self, tap_values: typing.List[int]) -> Token[None]:
1442
- """Set the TX equalizer settings (native values) of the on-board PHY.
1443
-
1444
- The tap values layout depends on the platform. Query P_CAPABILITIES
1445
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the required format.
1446
-
1447
- :param tap_values: list of TX EQ tap values (native values) in platform-specific order
1448
- :type tap_values: typing.List[int]
1449
- """
1392
+ def set(self, pre3:int, pre2: int, pre: int, main: int, post: int) -> Token[None]:
1450
1393
 
1451
1394
  return Token(
1452
1395
  self._connection,
1453
- build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], tap_values=tap_values))
1396
+ build_set_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex], pre3=pre3, pre2=pre2, pre=pre, main=main, post=post))
1454
1397
 
1455
1398
  @register_command
1456
1399
  @dataclass
@@ -595,7 +595,7 @@ class PP_PMAERRPUL_PARAMS:
595
595
  def set(self, duration: int, period: int, repetition: int, coeff: int, exp: int) -> Token[None]:
596
596
  """Set PMA pulse error injection settings.
597
597
 
598
- :param duration: 0 ms - 5000 ms; increments of 1 ms; 0 = constant BER
598
+ :param duration: 0 ms - 5000m s; increments of 1 ms; 0 = constant BER
599
599
  :type duration: int
600
600
  :param period: 10 ms - 50000 ms; number of ms - must be multiple of 10 ms
601
601
  :type period: int
@@ -1117,19 +1117,7 @@ class PP_EYEINFO:
1117
1117
  class PP_PHYTXEQ:
1118
1118
  """
1119
1119
  Control and monitor the equalizer settings of the on-board PHY in the
1120
- transmission direction (towards the transceiver cage).
1121
-
1122
- This command returns a variable number of tap values with module-dependent ordering:
1123
-
1124
- - **Legacy Loki-2P/Thor**: Original fixed format [pre, main, post, pre2, pre3, mode]
1125
- - **Regular Freya**: Original fixed format [pre, main, post, pre2, pre3, mode]
1126
- - **Loki-4P and H-Freya/Edun**: Variable number in N*pre, main, M*post layout
1127
- [pre_n, pre_n-1, ..., pre_1, main, post_1, post_2, ..., post_m]
1128
-
1129
- Use P_CAPABILITIES to query ``numtxeqtaps`` and ``numtxeqpretaps`` to determine
1130
- the number of taps and layout:
1131
- - ``numtxeqpretaps``: Number of precursor taps (N)
1132
- - ``numtxeqtaps - numtxeqpretaps - 1``: Number of postcursor taps (M)
1120
+ transmission direction (towards the transceiver cage) on Thor and Loki modules.
1133
1121
 
1134
1122
  .. versionchanged:: 1.1
1135
1123
 
@@ -1144,46 +1132,63 @@ class PP_PHYTXEQ:
1144
1132
  _serdes_xindex: int
1145
1133
 
1146
1134
  class GetDataAttr(ResponseBodyStruct):
1147
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
1148
- """list of integers, TX EQ tap values. The number and layout depend on the platform:
1149
-
1150
- - Legacy Loki-2P/Thor and Regular Freya: [pre, main, post, pre2, pre3, mode]
1151
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
1152
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
1153
- """
1135
+ pre: int = field(XmpInt())
1136
+ """integer, preemphasis, (range: Module dependent), default = 0 (neutral)."""
1137
+ main: int = field(XmpInt())
1138
+ """integer, amplification, (range: Module dependent), default = 0 (neutral)."""
1139
+ post: int = field(XmpInt())
1140
+ """integer, postemphasis, (range: Module dependent), default = 0 (neutral)."""
1141
+ pre2: int = field(XmpInt())
1142
+ """integer, preemphasis, (range: Module dependent), default = 0 (neutral)."""
1143
+ pre3_post2: int = field(XmpInt())
1144
+ """integer, postemphasis, (range: Module dependent), default = 0 (neutral)."""
1145
+ post3: int = field(XmpInt())
1146
+ """integer, postemphasis, (range: Module dependent), default = 0 (neutral)."""
1147
+ mode: int = field(XmpInt())
1148
+ """integer, value must be 4"""
1154
1149
 
1155
1150
  class SetDataAttr(RequestBodyStruct):
1156
- tap_values: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
1157
- """list of integers, TX EQ tap values. The number and layout depend on the platform:
1158
-
1159
- - Legacy Loki-2P/Thor and Regular Freya: [pre, main, post, pre2, pre3, mode]
1160
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
1161
- where N = numtxeqpretaps and M = numtxeqtaps - numtxeqpretaps - 1
1162
- """
1151
+ pre: int = field(XmpInt())
1152
+ """integer, preemphasis, (range: Module dependent), default = 0 (neutral)."""
1153
+ main: int = field(XmpInt())
1154
+ """integer, amplification, (range: Module dependent), default = 0 (neutral)."""
1155
+ post: int = field(XmpInt())
1156
+ """integer, postemphasis, (range: Module dependent), default = 0 (neutral)."""
1157
+ pre2: int = field(XmpInt())
1158
+ """integer, preemphasis, (range: Module dependent), default = 0 (neutral)."""
1159
+ pre3_post2: int = field(XmpInt())
1160
+ """integer, postemphasis, (range: Module dependent), default = 0 (neutral)."""
1161
+ post3: int = field(XmpInt())
1162
+ """integer, postemphasis, (range: Module dependent), default = 0 (neutral)."""
1163
+ mode: int = field(XmpInt())
1164
+ """integer, value must be 4"""
1163
1165
 
1164
1166
  def get(self) -> Token[GetDataAttr]:
1165
- """Get the TX equalizer settings of the on-board PHY.
1166
-
1167
- The returned tap values layout depends on the platform. Query P_CAPABILITIES
1168
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the format.
1167
+ """Get the equalizer settings of the on-board PHY in the
1168
+ transmission direction (towards the transceiver cage) on Thor and Loki modules.
1169
1169
 
1170
- :return: list of TX EQ tap values
1170
+ :return: preemphasis, (range: Module dependent), default = 0 (neutral).
1171
1171
  :rtype: PP_PHYTXEQ.GetDataAttr
1172
1172
  """
1173
1173
 
1174
1174
  return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._serdes_xindex]))
1175
1175
 
1176
- def set(self, tap_values: typing.List[int]) -> Token[None]:
1177
- """Set the TX equalizer settings of the on-board PHY.
1178
-
1179
- The tap values layout depends on the platform. Query P_CAPABILITIES
1180
- for ``numtxeqtaps`` and ``numtxeqpretaps`` to determine the required format:
1181
-
1182
- - Legacy Loki-2P/Thor and Regular Freya: [pre, main, post, pre2, pre3, mode]
1183
- - Loki-4P and H-Freya/Edun: [pre_n, ..., pre_1, main, post_1, ..., post_m]
1176
+ def set(self, pre2: int, pre: int, main: int, post: int, pre3_post2: int, post3: int) -> Token[None]:
1177
+ """Set the equalizer settings of the on-board PHY in the
1178
+ transmission direction (towards the transceiver cage) on Thor and Loki modules.
1184
1179
 
1185
- :param tap_values: list of TX EQ tap values in platform-specific order
1186
- :type tap_values: typing.List[int]
1180
+ :param pre2: pre2 emphasis
1181
+ :type pre2: int
1182
+ :param pre: pre emphasis
1183
+ :type pre: int
1184
+ :param main: main emphasis
1185
+ :type main: int
1186
+ :param post: post emphasis
1187
+ :type post: int
1188
+ :param pre3_post2: post2 or pre3 emphasis
1189
+ :type pre3_post2: int
1190
+ :param post3: post3 emphasis
1191
+ :type post3: int
1187
1192
  """
1188
1193
 
1189
1194
  return Token(
@@ -1193,7 +1198,13 @@ class PP_PHYTXEQ:
1193
1198
  module=self._module,
1194
1199
  port=self._port,
1195
1200
  indices=[self._serdes_xindex],
1196
- tap_values=tap_values))
1201
+ pre2=pre2,
1202
+ pre=pre,
1203
+ main=main,
1204
+ post=post,
1205
+ pre3_post2=pre3_post2,
1206
+ post3=post3,
1207
+ mode=4))
1197
1208
 
1198
1209
 
1199
1210
  @register_command
@@ -17,7 +17,7 @@ from .pcs_pma_ghijkl import (
17
17
  SerDes,
18
18
  )
19
19
  from .pcs_pma_l import PcsPma as PcsPma3
20
- from .edun_l1 import Layer1
20
+ from .freya_l1 import Layer1
21
21
 
22
22
  class PcsPma(PcsPma1, PcsPma2, PcsPma3):
23
23
  """Edun PCS/PMA
@@ -41,11 +41,11 @@ class FamilyEdun(BasePortL23Genuine):
41
41
  :type: PcsPma
42
42
  """
43
43
 
44
- # serdes: Tuple[SerDes, ...]
45
- # """SerDes index
44
+ serdes: Tuple[SerDes, ...]
45
+ """SerDes index
46
46
 
47
- # :type: Tuple[SerDes, ...]
48
- # """
47
+ :type: Tuple[SerDes, ...]
48
+ """
49
49
 
50
50
  def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
51
51
  super().__init__(conn, module_id, port_id)
@@ -60,10 +60,10 @@ class FamilyEdun(BasePortL23Genuine):
60
60
  async def _setup(self) -> Self:
61
61
  await super()._setup()
62
62
  self.pcs_pma = PcsPma(self._conn, self)
63
- # self.serdes = tuple(
64
- # SerDes(self._conn, *self.kind, serdes_xindex=serdes_xindex)
65
- # for serdes_xindex in range(self.info.capabilities.serdes_count)
66
- # )
63
+ self.serdes = tuple(
64
+ SerDes(self._conn, *self.kind, serdes_xindex=serdes_xindex)
65
+ for serdes_xindex in range(self.info.capabilities.serdes_count)
66
+ )
67
67
  self.l1 = L1(self._conn, self)
68
68
  return self
69
69
 
@@ -41,11 +41,11 @@ class FamilyFreya(BasePortL23Genuine):
41
41
  :type: PcsPma
42
42
  """
43
43
 
44
- # serdes: Tuple[SerDes, ...]
45
- # """SerDes index
44
+ serdes: Tuple[SerDes, ...]
45
+ """SerDes index
46
46
 
47
- # :type: Tuple[SerDes, ...]
48
- # """
47
+ :type: Tuple[SerDes, ...]
48
+ """
49
49
 
50
50
  def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
51
51
  super().__init__(conn, module_id, port_id)
@@ -60,10 +60,10 @@ class FamilyFreya(BasePortL23Genuine):
60
60
  async def _setup(self) -> Self:
61
61
  await super()._setup()
62
62
  self.pcs_pma = PcsPma(self._conn, self)
63
- # self.serdes = tuple(
64
- # SerDes(self._conn, *self.kind, serdes_xindex=serdes_xindex)
65
- # for serdes_xindex in range(self.info.capabilities.serdes_count)
66
- # )
63
+ self.serdes = tuple(
64
+ SerDes(self._conn, *self.kind, serdes_xindex=serdes_xindex)
65
+ for serdes_xindex in range(self.info.capabilities.serdes_count)
66
+ )
67
67
  self.l1 = L1(self._conn, self)
68
68
  return self
69
69
 
@@ -1,181 +0,0 @@
1
- from typing import (
2
- TYPE_CHECKING,
3
- Tuple,
4
- )
5
- if TYPE_CHECKING:
6
- from xoa_driver.internals.core import interfaces as itf
7
- from xoa_driver.internals.commands import (
8
- PP_PRECODING,
9
- PP_GRAYCODING,
10
- PL1_PHYTXEQ_LEVEL,
11
- PL1_PHYTXEQ_COEFF,
12
- PL1_PCS_VARIANT,
13
- PL1_PHYTXEQ,
14
- PL1_CWE_CYCLE,
15
- PL1_CWE_ERR_SYM_INDICES,
16
- PL1_CWE_BIT_ERR_MASK,
17
- PL1_CWE_FEC_ENGINE,
18
- PL1_CWE_FEC_STATS,
19
- PL1_CWE_CONTROL,
20
- PL1_CWE_FEC_STATS_CLEAR,
21
- PP_PRBSTYPE,
22
- PL1_PNSWAP_RX,
23
- PL1_PNSWAP_TX,
24
- PP_AUTONEG,
25
- PP_AUTONEGSTATUS,
26
- PP_LINKTRAIN,
27
- )
28
- from .pcs_pma_ghijkl import (
29
- Prbs,
30
- )
31
- from xoa_driver import enums
32
-
33
- class EdunPMA:
34
- """Edun PMA"""
35
-
36
- def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_xindex: int) -> None:
37
- self.precoding = PP_PRECODING(conn, module_id, port_id, serdes_xindex)
38
- """GET/SET Pre-Coding Configurations.
39
-
40
- :type: PP_PRECODING
41
- """
42
-
43
- self.graycoding = PP_GRAYCODING(conn, module_id, port_id, serdes_xindex)
44
- """GET/SET Gray-Coding Configurations.
45
-
46
- :type: PP_GRAYCODING
47
- """
48
-
49
- self.pn_swap_rx = PL1_PNSWAP_RX(conn, module_id, port_id, serdes_xindex)
50
- """GET/SET PN-Swap RX Configurations.
51
-
52
- :type: PL1_PNSWAP_RX
53
- """
54
-
55
- self.pn_swap_tx = PL1_PNSWAP_TX(conn, module_id, port_id, serdes_xindex)
56
- """GET/SET PN-Swap TX Configurations.
57
-
58
- :type: PL1_PNSWAP_TX
59
- """
60
-
61
- class EdunTxTap:
62
- """Edun Tx Tap"""
63
-
64
- def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_xindex: int) -> None:
65
- self.native = PL1_PHYTXEQ(conn, module_id, port_id, serdes_xindex)
66
- """TX tap native value. (only for Edun)
67
-
68
- :type: PL1_PHYTXEQ
69
- """
70
-
71
- self.level = PL1_PHYTXEQ_LEVEL(conn, module_id, port_id, serdes_xindex)
72
- """TX tap mV/dB value. (only for Edun)
73
-
74
- :type: PL1_PHYTXEQ_LEVEL
75
- """
76
-
77
- self.ieee = PL1_PHYTXEQ_COEFF(conn, module_id, port_id, serdes_xindex)
78
- """TX tap IEEE coefficient value. (only for Edun)
79
-
80
- :type: PL1_PHYTXEQ_COEFF
81
- """
82
-
83
- # class EdunRxTap:
84
- # """Edun Rx tap
85
- # """
86
- # def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_xindex: int) -> None:
87
- # self.status = P_EDUN_RX_STATUS(conn, module_id, port_id, serdes_xindex)
88
- # """Edun Rx tap status
89
- # """
90
-
91
- class EdunMedium:
92
- def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_xindex: int) -> None:
93
- self.tx = EdunTxTap(conn, module_id, port_id, serdes_xindex)
94
- """Edun Tx tap
95
- """
96
- # self.rx = EdunRxTap(conn, module_id, port_id, serdes_xindex)
97
- # """Edun Rx tap
98
- # """
99
-
100
- class SerDesEdun:
101
- """L23 high-speed port SerDes configuration and status."""
102
-
103
- def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, serdes_xindex: int) -> None:
104
-
105
- self.prbs = Prbs(conn, module_id, port_id, serdes_xindex)
106
- """PRBS
107
- :type: Prbs
108
- """
109
-
110
- self.pma = EdunPMA(conn, module_id, port_id, serdes_xindex)
111
- """Edun PMA
112
-
113
- :type: EdunPMA
114
- """
115
-
116
- self.medium = EdunMedium(conn, module_id, port_id, serdes_xindex)
117
- """Edun medium
118
-
119
- :type: EdunMedium
120
- """
121
-
122
- class EdunAutoneg:
123
- """Edun port-level autoneg. For per-serdes configuration and status, use serdes[x]
124
- """
125
- def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
126
- self.config = PP_AUTONEG(conn, module_id, port_id)
127
- """Autoneg config and status
128
- """
129
- self.status = PP_AUTONEGSTATUS(conn, module_id, port_id)
130
- """Autoneg status
131
- """
132
-
133
- class EdunFecCodewordErrorInject:
134
- """Edun FEC Codeword Error Injection
135
- """
136
- def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
137
- self.cycle = PL1_CWE_CYCLE(conn, module_id, port_id)
138
- """FEC codeword error injection cycle.
139
- """
140
- self.err_symbols = PL1_CWE_ERR_SYM_INDICES(conn, module_id, port_id)
141
- """The positions of the errored symbols in errored codewords.
142
- """
143
- self.bit_err_mask = PL1_CWE_BIT_ERR_MASK(conn, module_id, port_id)
144
- """The bit error mask for the errored symbols.
145
- """
146
- self.engine = PL1_CWE_FEC_ENGINE(conn, module_id, port_id)
147
- """The FEC engines to use.
148
- """
149
- self.statistics = PL1_CWE_FEC_STATS(conn, module_id, port_id)
150
- """FEC error injection statistics
151
- """
152
- self.clear_stats = PL1_CWE_FEC_STATS_CLEAR(conn, module_id, port_id)
153
- """Clear FEC codeword injection stats
154
- """
155
- self.control = PL1_CWE_CONTROL(conn, module_id, port_id)
156
- """Control the FEC codeword error injection
157
- """
158
-
159
- class Layer1:
160
- def __init__(self, conn: "itf.IConnection", port) -> None:
161
- self.serdes: Tuple[SerDesEdun, ...] = tuple(
162
- SerDesEdun(conn, *port.kind, serdes_xindex=idx)
163
- for idx in range(port.info.capabilities.serdes_count)
164
- )
165
- self.autoneg = EdunAutoneg(conn, *port.kind)
166
- """Edun port-level autoneg. For per-serdes configuration and status, use serdes[x]
167
- """
168
- self.lt = PP_LINKTRAIN(conn, *port.kind)
169
- """Edun Link Training on serdes level
170
-
171
- :type: PP_LINKTRAIN
172
- """
173
- self.pcs_variant = PL1_PCS_VARIANT(conn, *port.kind)
174
- """PCS variant configuration
175
- """
176
- self.fec_error_inject = EdunFecCodewordErrorInject(conn, *port.kind)
177
- """FEC codeword error injection
178
- """
179
- self.prbs_config = PP_PRBSTYPE(conn, *port.kind)
180
- """PRBS configuration, including PRBS polynomial, invert mode, and statistic collection mode (for RX).
181
- """