Using PyBERT as a Library

This Jupyter notebook provides an example of using the functionality of the PyBERT Python package, not as a stand alone GUI application, but rather as a library, importing into a higher level Python script.

Original author: David Banas capn.freako@gmail.com
Original date: June 28, 2021

Copyright © 2021 David Banas, Inc.; all rights reserved World wide.

Table of Contents

Introduction

In the typical use case, PyBERT is run as a stand alone GUI application. However, it is also possible to draw from the PyBERT package, as a library, importing only certain needed features into a larger Python script. This Jupyter notebook provides an example of doing just that.

Furthermore, this example shows how to import PyBERT functionality into a higher level Python script, when IBIS-AMI models are being used, in place of PyBERT's native Tx/Rx models.

Global Defines

If you get lucky, you might get away w/ only editing this section.

Imports

Here, we import everything we'll need. (I'm not sure why, but these notebooks tend to work more smoothly if you import everything first, before executing any other Python code.)

PyBERT Object

Here, we instantiate and configure our PyBERT object and run a trial simulation of an "ideal" channel, to generate the Tx output.

Note: You may need to dismiss some GUI dialog alerts.

Note: If you changed the Tx/Rx IBIS file names, above, then you'll probably get an error like this, the first time you run this cell:

ValueError: Failed parameter tree search looking for: <ParamName>; available keys: dict_keys(['tx_tap_nm2', 'tx_tap_np1', 'tx_tap_units', 'tx_tap_nm1'])

Just swap in one of the listed available keys, in line 20, and you should be good to go.

Note: If you get the following error, having set myPyBERT.tx_use_ts4 to True:

TypeError: 'NoneType' object is not subscriptable

then your chosen IBIS file doesn't provide on-die S-parameters; set myPyBERT.tx_use_ts4 to False and re-run this cell.

Tx Output

Here, we plot the last 100 unit intervals, as well as the "eye" diagram, for the output of the Tx.

Channel Model

Here, we (optionally) apply a custom channel model to the signal above.

Rx Equalization and Clock/Data Recovery

Here, we model the receiver equalization and clock/data recovery functionality.