Reset processing on assert edge only

This commit is contained in:
Alex Forencich
2021-03-21 12:25:09 -07:00
parent 78bc288812
commit 448815b16d
5 changed files with 43 additions and 43 deletions

View File

@@ -186,26 +186,26 @@ class PtpClock(Reset):
if self._run_cr is not None:
self._run_cr.kill()
self._run_cr = None
self.ts_96_s = 0
self.ts_96_ns = 0
self.ts_96_fns = 0
self.ts_64_ns = 0
self.ts_64_fns = 0
self.drift_cnt = 0
if self.ts_96 is not None:
self.ts_96 <= 0
if self.ts_64 is not None:
self.ts_64 <= 0
if self.ts_step is not None:
self.ts_step <= 0
if self.pps is not None:
self.pps <= 0
else:
self.log.info("Reset de-asserted")
if self._run_cr is None:
self._run_cr = cocotb.scheduler.start_soon(self._run())
self.ts_96_s = 0
self.ts_96_ns = 0
self.ts_96_fns = 0
self.ts_64_ns = 0
self.ts_64_fns = 0
self.drift_cnt = 0
if self.ts_96 is not None:
self.ts_96 <= 0
if self.ts_64 is not None:
self.ts_64 <= 0
if self.ts_step is not None:
self.ts_step <= 0
if self.pps is not None:
self.pps <= 0
async def _run(self):
while True:
await RisingEdge(self.clock)