mirror of
https://github.com/alexforencich/verilog-ethernet.git
synced 2025-01-28 07:03:08 +08:00
Remove extraneous scaleb(-9) in set_ts_tod_ns in ptp_td so that the seconds field can be set correctly
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
parent
22abe6cacb
commit
ae17f7db00
@ -127,7 +127,6 @@ class PtpTdSource(Reset):
|
|||||||
|
|
||||||
def set_ts_tod_ns(self, t):
|
def set_ts_tod_ns(self, t):
|
||||||
ts_s, ts_ns = self.ctx.divmod(Decimal(t), Decimal(1000000000))
|
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_fns = self.ctx.divmod(ts_ns, Decimal(1))
|
||||||
ts_ns = ts_ns.to_integral_value()
|
ts_ns = ts_ns.to_integral_value()
|
||||||
ts_fns = (ts_fns * Decimal(2**32)).to_integral_value()
|
ts_fns = (ts_fns * Decimal(2**32)).to_integral_value()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user