From bc8dbb039c29d067bb229ae48a1fa3b73b22daf0 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 9 Feb 2024 15:11:32 -0800 Subject: [PATCH] Remove extraneous scaleb(-9) in set_ts_tod_ns so that the seconds value is set correctly Signed-off-by: Alex Forencich --- cocotbext/eth/ptp.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cocotbext/eth/ptp.py b/cocotbext/eth/ptp.py index e17b036..b132652 100644 --- a/cocotbext/eth/ptp.py +++ b/cocotbext/eth/ptp.py @@ -132,7 +132,6 @@ class PtpClock(Reset): def set_ts_tod_ns(self, t): ts_s, ts_ns = self.ctx.divmod(Decimal(t), Decimal(1000000000)) - ts_s = ts_s.scaleb(-9).to_integral_value() ts_ns, ts_fns = self.ctx.divmod(ts_ns, Decimal(1)) ts_ns = ts_ns.to_integral_value() ts_fns = (ts_fns * Decimal(2**32)).to_integral_value()