Package: ocptv-pci-lmt
PCIe Lane Margining Tool (LMT)LMT is a standard PCIE margining measurement added by PCI-SIG in the PCIe 4.0 specification.
This is required mainly to overcome the challenges in delivering a reliable 16GT/s solution.
Lane Margining enables system designers to measure the available margin in a standardized manner.Key BenefitsWorks in a production platform without any test equipmentProvides a way to measure actual margin when running prod trafficProvides visibility to the details of the defect:exactly which wires/pins are badexactly how ‘bad’ each wire pair (vs a nominal system)Avoids excessive part swaps triggered by multiple repair actionsProvides a reliable way to check if source defect is fixed after repairsThis project is part ofocp-diag-coreand exists under the sameMIT License Agreement.UsageMinimum python version is currently py3.8The binary can be installed fromPyPI ocptv-pci_lmtand can be used directly on a system as such:> pci_lmt -h
usage: pci_lmt [-h] [-o {json,csv}] [-e ERROR_COUNT_LIMIT] [-d DWELL_TIME] [-a ANNOTATION] [-v] [--version] config_file

Runs Lane Margining Test on PCIe devices.

positional arguments:
  config_file           Path to the configuration file (in JSON format).

optional arguments:
  -h, --help            show this help message and exit
  -o {json,csv}         Output format. Supported formats: json, csv. Default: json
  -e ERROR_COUNT_LIMIT  Maximum errors allowed before terminating the test. Default: 63
  -d DWELL_TIME         Amount of time (in seconds) to wait before making BER measurements. Default: 5
  -a ANNOTATION         Annotation string to be prefix'd for LMT results. Default: <empty>
  -v                    Verbosity level. Use '-v' for INFO and '-vv' for DEBUG. Default: 0
  --version             Print tool version and exit.ContactFeel free to start a newdiscussion, or otherwise post anissue/request.Developer notesNew code may be committed through features or bugfix branches (eg.fea/cool_new_thingorbugfix/none_in_collector). All PRs must be merged into thedevbranch.Quickest way to setup a dev environment:# make a venv, see https://docs.python.org/3/library/venv.html>python3-mvenvenv
../env/bin/activate

>pipinstall-rrequirements.txt# [1] then the main script can be run from source>pythonsrc/pci_lmt_bin/main.py--version
main.py1.1.1# [2] or alternatively do a local editable install and use it as an executable# see: https://setuptools.pypa.io/en/latest/userguide/development_mode.html>pipinstall-e.
>pci_lmt--version
pci_lmt1.1.1Before pushing new commits upstream, please check that your changes pass the linters, formatting, typechecker, etc.
All the following checks should pass (and return exit code 0). They are also run in a github action, which safeguards against problematic code.>black.--check--preview
Alldone!✨🍰✨14fileswouldbeleftunchanged.# remove the fixme disable to see the list of TODOs in the codebase>pylintsrctests--disablefixme

--------------------------------------------------------------------
Yourcodehasbeenratedat10.00/10(previousrun:10.00/10,+0.00)>mypysrctests--check-untyped-defs
Success:noissuesfoundin14sourcefiles# run all unit tests>findtests-typef-name"test_*.py"|xargstestslide