From d5d382349c95c12d8816e3c53168fdcccb8b515e Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Mon, 22 Jun 2020 15:39:54 -0700 Subject: [PATCH 1/2] Update _Lmk048Base.py ### Description - Overhauling the LMK.Init() procedure - `self.LmkReg_0x0144.set(0x74)` is a bug and was preventing DCLK[12,10,8,6] from getting synchronized during the SYNC event --- python/surf/devices/ti/_Lmk048Base.py | 45 +++++++-------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/python/surf/devices/ti/_Lmk048Base.py b/python/surf/devices/ti/_Lmk048Base.py index 7eea9fff1e..8f77572e61 100644 --- a/python/surf/devices/ti/_Lmk048Base.py +++ b/python/surf/devices/ti/_Lmk048Base.py @@ -1104,63 +1104,40 @@ def LoadCodeLoaderMacFile(arg): @self.command(description='Powerdown the sysref lines',) def PwrDwnSysRef(): self.EnableSysRef.set(0) - time.sleep(0.010) # TODO: Optimize this timeout @self.command(description='Powerup the sysref lines',) def PwrUpSysRef(): self.EnableSysRef.set(self.sysrefMode) - self.LmkReg_0x0143.set(0x12) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0143.set(0x32) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0143.set(0x12) - time.sleep(0.010) # TODO: Optimize this timeout @self.command(description='1: Powerdown',) def PwrDwnLmkChip(): self.POWER_DOWN.set(1) - time.sleep(0.010) # TODO: Optimize this timeout @self.command(description='0: Normal Operation',) def PwrUpLmkChip(): self.POWER_DOWN.set(0) - time.sleep(0.010) # TODO: Optimize this timeout @self.command(description='Synchronize LMK internal counters. Warning this function will power off and power on all the system clocks',) def Init(): + # Cache the current value self.sysrefMode = self.EnableSysRef.get() - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0139.set(0x0) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0143.set(0x11) - time.sleep(0.010) # TODO: Optimize this timeout + + # Preparing for SYNC + self.LmkReg_0x0139.set(self.sysrefMode) + self.LmkReg_0x013E.set(0x3) self.LmkReg_0x0140.set(0x0) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0144.set(0x74) - time.sleep(0.010) # TODO: Optimize this timeout + self.LmkReg_0x0144.set(0x0) + + # Force a SYNC self.LmkReg_0x0143.set(0x11) - time.sleep(0.010) # TODO: Optimize this timeout self.LmkReg_0x0143.set(0x31) - time.sleep(0.010) # TODO: Optimize this timeout self.LmkReg_0x0143.set(0x11) - time.sleep(0.010) # TODO: Optimize this timeout + + # Disable additional SYNCs + self.LmkReg_0x0143.set(0x01) self.LmkReg_0x0144.set(0xFF) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0139.set(self.sysrefMode) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x013E.set(0x3) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0143.set(0x12) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0143.set(0x32) - time.sleep(0.010) # TODO: Optimize this timeout - self.LmkReg_0x0143.set(0x12) - time.sleep(0.010) # TODO: Optimize this timeout # Fixed Register: self.LmkReg_0x0145.set(0x7F) # Always program this register to value 127 (0x7F) - time.sleep(0.010) # TODO: Optimize this timeout self.LmkReg_0x0171.set(0xAA) # Always program to 170 (0xAA) - time.sleep(0.010) # TODO: Optimize this timeout self.LmkReg_0x0172.set(0x02) # Always program to 2 (0x02) - time.sleep(0.010) # TODO: Optimize this timeout From 3b7d1762b72bdb8d9e64459ce7a3da1c0feabf09 Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Mon, 22 Jun 2020 15:45:22 -0700 Subject: [PATCH 2/2] Linter bug fix --- python/surf/devices/ti/_Lmk048Base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/surf/devices/ti/_Lmk048Base.py b/python/surf/devices/ti/_Lmk048Base.py index 8f77572e61..26d2156435 100644 --- a/python/surf/devices/ti/_Lmk048Base.py +++ b/python/surf/devices/ti/_Lmk048Base.py @@ -11,7 +11,6 @@ import pyrogue as pr import re import ast -import time class Lmk048Base(pr.Device): def __init__(self, **kwargs):