.cdr - CDR Model

Behavioral model of a “bang-bang” clock data recovery (CDR) unit.

Original Author: David Banas <capn.freako@gmail.com>

Original Date: 17 June 2014

This Python script provides a behavioral model of a “bang-bang” clock data recovery (CDR) unit. The class defined, here, is intended for integration into the larger PyBERT framework.

Copyright (c) 2019 by David Banas; All rights reserved World wide.

class pybert.models.cdr.CDR(delta_t: float, alpha: float, ui: float, n_lock_ave: int = 500, rel_lock_tol: float = 0.01, lock_sustain: int = 500)[source]

Bases: object

A class providing behavioral modeling of a ‘bang- bang’ clock data recovery (CDR) unit.

Parameters:
  • delta_t – The proportional branch correction, in seconds.

  • alpha – The integral branch correction, normalized to proportional branch correction.

  • ui – The nominal unit interval, in seconds.

Keyword Arguments:
  • n_lock_ave – Number of unit intervals to use for determining lock. Default: 500.

  • rel_lock_tol – Lock tolerance, relative to delta_t. Default: 0.01.

  • lock_sustain – Length of lock sustain vector used to provide histerysis. Default: 500.

Notes

1. The code does not care what units are actually used for delta_t and ui, only that they are the same.

adapt(samples: numpy.typing.NDArray.numpy.float64) tuple[float, bool][source]

Adapt period/phase, according to 3 samples.

Should be called, when the clock has just struck.

Synopsis:

(ui, locked) = adapt(samples)

Parameters:

samples

A list of 3 samples of the input waveform, as follows

  • at the last clock time

  • at the last unit interval boundary time

  • at the current clock time

Returns:

The new unit interval estimate (s), and a flag indicating locked status.

property locked: bool

The current locked state.

property ui: float

The current unit interval estimate.