Hello,
We are using a ZCU111 and pynq 2.5 (Vivado 2019). We have a design with 5xDAC, (4 in tile 0 and last one in tile 1). First of all, have to say we are newbies at pynq and my apologies if something done here is bad practice. Any advice will be sincerely apreciated.
Our Main parameters are :
AXI Stream Clk: 122.88MHz
Interpolation mode: x8
Samples per cycle: 4
Mixer: Fine, IQ->Real
Nyquist Zone: 1
Sampling Rate: 1966.08Msps
Sysref: 8.192MHz (less than 10MHz, 1966.08/16/15 and 122.88/15)
with such parameters we are trying to use MTS with the event source EVNT_SRC_SYSREF at the mixer. Nevertheless, we only achieve synce among Dac00, Dac01, Dac02 and Dac03 (tile 0), but not for the dac at tile 1.
what we are doing at pynq is the following:
-First of all we have a function RunMTS() that uses xrfdc.c structs and pointers written at xrfdc/init.py as recommended at pg269.pdf for the rfdc:
def RunMTS(self):
self._DAC_Sync_Config = _ffi.new("XRFdc_MultiConverter_Sync_Config*")
self._ADC_Sync_Config = _ffi.new("XRFdc_MultiConverter_Sync_Config*")
self.entero = _ffi.new("int*")
_lib.XRFdc_MultiConverter_Init(self._DAC_Sync_Config,self.entero,self.entero)
self._DAC_Sync_Config.Tiles = 0x3
self._DAC_Sync_Config.SysRef_Enable = 0
self.status1 = _lib.XRFdc_MultiConverter_Sync(self._instance,_lib.XRFDC_DAC_TILE,self._DAC_Sync_Config)
-In the same way, Secondly we have functions sysrefEnable() and sysrefDisable() at xrfdc/init.py:
def sysrefDisable(self):
self.enable[0] = 0
self.status3 = _lib.XRFdc_MTS_Sysref_Config(self._instance, self._DAC_Sync_Config, self._ADC_Sync_Config, self.enable)
def sysrefEnable(self):
self.enable[0] = 1
self.status3 = _lib.XRFdc_MTS_Sysref_Config(self._instance, self._DAC_Sync_Config, self._ADC_Sync_Config, self.enable)
With all this mentioned, when loading our Overlay via jupyter notebook, and declaring our DACs, we have a function for configuring the mixer, following advices from xilinx resetting NCO pahses:
def configDacsMTS(freq):
rf.sysrefDisable()
time.sleep(1)
dac00.NyquistZone = 1
dac00.MixerSettings = {
'CoarseMixFreq': xrfdc.COARSE_MIX_BYPASS,
'EventSource': xrfdc.EVNT_SRC_SYSREF,
'FineMixerScale': xrfdc.MIXER_SCALE_1P0,
'Freq': freq,
'MixerMode': xrfdc.MIXER_MODE_C2R,
'MixerType': xrfdc.MIXER_TYPE_FINE,
'PhaseOffset': 0.0
}
#dac00.UpdateEvent(xrfdc.EVENT_MIXER)
dac_tile0.SetupFIFO(True)
dac01.NyquistZone = 1
dac01.MixerSettings = {
'CoarseMixFreq': xrfdc.COARSE_MIX_BYPASS,
'EventSource': xrfdc.EVNT_SRC_SYSREF,
'FineMixerScale': xrfdc.MIXER_SCALE_1P0,
'Freq': freq,
'MixerMode': xrfdc.MIXER_MODE_C2R,
'MixerType': xrfdc.MIXER_TYPE_FINE,
'PhaseOffset': 0.0
}
#dac01.UpdateEvent(xrfdc.EVENT_MIXER)
dac_tile0.SetupFIFO(True)
dac02.NyquistZone = 1
dac02.MixerSettings = {
'CoarseMixFreq': xrfdc.COARSE_MIX_BYPASS,
'EventSource': xrfdc.EVNT_SRC_SYSREF,
'FineMixerScale': xrfdc.MIXER_SCALE_1P0,
'Freq': freq,
'MixerMode': xrfdc.MIXER_MODE_C2R,
'MixerType': xrfdc.MIXER_TYPE_FINE,
'PhaseOffset': 0.0
}
#dac01.UpdateEvent(xrfdc.EVENT_MIXER)
dac_tile0.SetupFIFO(True)
dac03.NyquistZone = 1
dac03.MixerSettings = {
'CoarseMixFreq': xrfdc.COARSE_MIX_BYPASS,
'EventSource': xrfdc.EVNT_SRC_SYSREF,
'FineMixerScale': xrfdc.MIXER_SCALE_1P0,
'Freq': freq,
'MixerMode': xrfdc.MIXER_MODE_C2R,
'MixerType': xrfdc.MIXER_TYPE_FINE,
'PhaseOffset': 0.0
}
#dac01.UpdateEvent(xrfdc.EVENT_MIXER)
dac_tile0.SetupFIFO(True)
dac10.NyquistZone = 1
dac10.MixerSettings = {
'CoarseMixFreq': xrfdc.COARSE_MIX_BYPASS,
'EventSource': xrfdc.EVNT_SRC_SYSREF,
'FineMixerScale': xrfdc.MIXER_SCALE_1P0,
'Freq': freq,
'MixerMode': xrfdc.MIXER_MODE_C2R,
'MixerType': xrfdc.MIXER_TYPE_FINE,
'PhaseOffset': 0.0
}
#dac12.UpdateEvent(xrfdc.EVENT_MIXER)
dac_tile1.SetupFIFO(True)
#Reset every DAC NCO_Phase
dac00.ResetNCOPhase()
dac01.ResetNCOPhase()
dac02.ResetNCOPhase()
dac03.ResetNCOPhase()
dac10.ResetNCOPhase()
time.sleep(0.2)
rf.sysrefEnable()
time.sleep(0.2)
rf.sysrefDisable()
With this code, only sync is achieved on 4 DACs at Tile 0, but we get a delay at Tile 1âs DAC, and so huge (more than 20ns). Furthermore, when using configDacsMTS(), Dacs from Tile 0 get the new frequency and sync, but Tile 1 does not work, it becomes noisy and unstable. When using diferent Event Source (EVNT_SRC_IMMEDIATE, or EVNT_SRC_TILE) mixer behaves well, but of course without sync.
Please, could anyone tell us we could be our mistake?? we are a little bit lost at this pointâŚ
Thanks a lots in advantage, any additional info you need from design (screenshots, more parameters) will be given if needed
PD:
additional info we got from DAC_Sync_Config.Latency and DAC_Sync_Config.Offset is we are having such a huge latency, and an offset at one tile:
Latency: 172624
Offset: 0
Latency: 171720
Offset: 31