2019-07-17 00:18:04 +02:00
|
|
|
# See LICENSE for licensing information.
|
|
|
|
|
#
|
2022-11-30 23:50:43 +01:00
|
|
|
# Copyright (c) 2016-2022 Regents of the University of California and The Board
|
2019-07-17 00:18:04 +02:00
|
|
|
# of Regents for the Oklahoma Agricultural and Mechanical College
|
|
|
|
|
# (acting for and on behalf of Oklahoma State University)
|
|
|
|
|
# All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
class delay_data():
|
|
|
|
|
"""
|
|
|
|
|
This is the delay class to represent the delay information
|
|
|
|
|
Time is 50% of the signal to 50% of reference signal delay.
|
|
|
|
|
Slew is the 10% of the signal to 90% of signal
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self, delay=0.0, slew=0.0):
|
|
|
|
|
""" init function support two init method"""
|
|
|
|
|
# will take single input as a coordinate
|
|
|
|
|
self.delay = delay
|
|
|
|
|
self.slew = slew
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
""" override print function output """
|
2019-10-03 01:26:02 +02:00
|
|
|
return "Delta Data: Delay {} Slew {}".format(self.delay, self.slew)
|
2019-07-17 00:18:04 +02:00
|
|
|
|
|
|
|
|
def __add__(self, other):
|
|
|
|
|
"""
|
|
|
|
|
Override - function (left), for delay_data: a+b != b+a
|
|
|
|
|
"""
|
2019-10-03 01:26:02 +02:00
|
|
|
assert isinstance(other, delay_data)
|
2019-07-17 00:18:04 +02:00
|
|
|
return delay_data(other.delay + self.delay,
|
|
|
|
|
other.slew)
|
|
|
|
|
|
|
|
|
|
def __radd__(self, other):
|
|
|
|
|
"""
|
|
|
|
|
Override - function (right), for delay_data: a+b != b+a
|
|
|
|
|
"""
|
2019-10-03 01:26:02 +02:00
|
|
|
assert isinstance(other, delay_data)
|
2019-07-17 00:18:04 +02:00
|
|
|
return delay_data(other.delay + self.delay,
|
|
|
|
|
self.slew)
|