qick.rfboard
Classes
|
|
|
|
|
|
|
Class to describe the ADC-DC channel chain. |
|
|
|
|
|
|
|
|
|
This class provides SPI access to the PE43705 step attenuator. |
|
|
|
|
|
|
|
|
|
|
|
Bias DAC chip AD5781. |
|
Bias DAC chip DAC11001. |
|
This class is used to enable one daughter card on the RF Board for the ZCU216, V1. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADMV8818 filter chip. |
|
|
|
Variable gain amp LMH6401. |
|
GPIO chip MCP23S08. |
|
LO Synthesis chip ADF4372 |
|
|
|
Overrides the __init__ method of QickSoc in order to add the drivers for the preproduction (V1) version of the RF board. |
|
|
|
|
|
|
alias of |
|
|
|
|
- class qick.rfboard.AxisSignalGenV3(*args: Any, **kwargs: Any)[source]
Bases:
SocIP- bindto = ['user.org:user:axis_signal_gen_v3:1.0', 'QICK:QICK:axis_signal_gen_v3:1.0']
- N = 12
- NDDS = 16
- MAX_LENGTH = 65536
- property cfg
- class qick.rfboard.AxisSignalGenV3Ctrl(*args: Any, **kwargs: Any)[source]
Bases:
SocIP- bindto = ['user.org:user:axis_signal_gen_v3_ctrl:1.0', 'QICK:QICK:axis_signal_gen_v3_ctrl:1.0']
- N = 10
- NDDS = 16
- B = 16
- MAX_v = 65535
- fs = 4096
- add(freq=0, phase=0, addr=0, gain=30000, nsamp=1600, outsel='dds', mode='periodic', stdysel='zero')[source]
- property cfg
- class qick.rfboard.AxisSignalGenV6Ctrl(*args: Any, **kwargs: Any)[source]
Bases:
SocIP- bindto = ['user.org:user:axis_signal_gen_v6_ctrl:1.0', 'QICK:QICK:axis_signal_gen_v6_ctrl:1.0']
- add(freq=0, phase=0, addr=0, gain=0.99, nsamp=1600, outsel='dds', mode='periodic', stdysel='zero', phrst='no')[source]
- property cfg
- class qick.rfboard.AxisDdsMrSwitch(*args: Any, **kwargs: Any)[source]
Bases:
SocIP- bindto = ['user.org:user:axis_dds_mr_switch:1.0', 'QICK:QICK:axis_dds_mr_switch:1.0']
- property cfg
- class qick.rfboard.AxisSwitchV1(*args: Any, **kwargs: Any)[source]
Bases:
SocIP- bindto = ['user.org:user:axis_switch_v1:1.0', 'QICK:QICK:axis_switch_v1:1.0']
- property cfg
- class qick.rfboard.spi(*args: Any, **kwargs: Any)[source]
Bases:
SocIP- bindto = ['xilinx.com:ip:axi_quad_spi:3.2']
- SPI_REGLIST = ['DGIER', 'IPISR', 'IPIER', 'SRR', 'SPICR', 'SPISR', 'SPI_DTR', 'SPI_DRR', 'SPI_SSR', 'SPI_TXFIFO_OR', 'SPI_RXFIFO_OR']
- config(lsb='lsb', msttran='enable', ssmode='ssr', rxfifo='rst', txfifo='rst', cpha='', cpol='high', mst='master', en='enable', loopback='no')[source]
- en_level(nch=4, chlist=[0], en_l='high')[source]
chlist: list of bits to enable en_l: enable level “high”: ignore nch, enabled bits are set high “low”: nch is total length, enabled bits are set low
- send_m(data, ch_en, cs_t='pulse')[source]
The data must be formatted in bytes, regardless of the data width of the SPI IP. For data width 16 or 32, the bytes will be packed in little-endian order.
- receive()[source]
The returned data will be formatted in bytes, regardless of the data width of the SPI IP. For data width 16 or 32, the bytes will be unpacked in little-endian order.
- send_receive_m(data, ch_en, cs_t='pulse')[source]
data: list of bytes to send ch_en: destination address
- property cfg
- class qick.rfboard.BiasAD5781(spi_ip, ch_en, cs_t='')[source]
Bases:
objectBias DAC chip AD5781.
- cmd_wr = 0
- cmd_rd = 1
- VREFN = -10
- VREFP = 10
- B = 18
- REGS = {'CLEAR_REG': 3, 'CTRL_REG': 2, 'DAC_REG': 1, 'SOFT_REG': 4}
- class qick.rfboard.BiasDAC11001(spi_ip, ch_en, cs_t='')[source]
Bases:
objectBias DAC chip DAC11001.
- cmd_wr = 0
- cmd_rd = 1
- VREFN = -10
- VREFP = 10
- B = 20
- REGS = {'CONFIG1_REG': 2, 'CONFIG2_REG': 6, 'DAC_CLEAR_DATA_REG': 3, 'DAC_DATA_REG': 1, 'STATUS_REG': 5, 'TRIGGER_REG': 4}
- class qick.rfboard.AttenuatorPE43705(spi_ip, ch=0, nch=3, le=[0], en_l='high', cs_t='pulse')[source]
Bases:
objectThis class provides SPI access to the PE43705 step attenuator. Range is 0-31.75 dB. Parts are used in serial mode. This device’s SPI interface is write-only, no readback. See schematics for Address/LE correspondance.
- nSteps = 128
- dbStep = 0.25
- dbMinAtt = 0
- dbMaxAtt = 31.75
- class qick.rfboard.FilterADMV8818(spi_ip, ch, cs_t='')[source]
Bases:
objectADMV8818 filter chip.
- cmd_wr = 0
- cmd_rd = 1
- REGS = {'ADI_SPI_CONFIG_A': 0, 'ADI_SPI_CONFIG_B': 1, 'CHIPTYPE': 3, 'PRODUCT_ID_H': 5, 'PRODUCT_ID_L': 4, 'WR0_FILTER': 33, 'WR0_SW': 32}
- BANDS = {'HPF': {'HPF1': {'max': 3.55, 'min': 1.75, 'switch': 1}, 'HPF2': {'max': 7.25, 'min': 3.4, 'switch': 2}, 'HPF3': {'max': 12.6, 'min': 6.6, 'switch': 3}, 'HPF4': {'max': 19.9, 'min': 12.5, 'switch': 4}, 'bypass': {'max': 18.0, 'min': 2.0, 'switch': 0}}, 'LPF': {'LPF1': {'max': 3.85, 'min': 2.05, 'switch': 1}, 'LPF2': {'max': 7.25, 'min': 3.35, 'switch': 2}, 'LPF3': {'max': 13.0, 'min': 7.0, 'switch': 3}, 'LPF4': {'max': 18.85, 'min': 12.55, 'switch': 4}, 'bypass': {'max': 18.0, 'min': 2.0, 'switch': 0}}}
- B = 4
- class qick.rfboard.GpioMCP23S08(spi_ip, ch_en, dev_addr, iodir=0, cs_t='')[source]
Bases:
objectGPIO chip MCP23S08.
- cmd_wr = 64
- cmd_rd = 65
- REGS = {'DEFVAL_REG': 3, 'GPINTEN_REG': 2, 'GPIO_REG': 9, 'GPPU_REG': 6, 'INTCAP_REG': 8, 'INTCON_REG': 4, 'INTF_REG': 7, 'IOCON_REG': 5, 'IODIR_REG': 0, 'IPOL_REG': 1, 'OLAT_REG': 10}
- class qick.rfboard.LoSynthADF4372(spi_ip, nch=2, le=[0], en_l='low', cs_t='')[source]
Bases:
objectLO Synthesis chip ADF4372
- f_REF_in = 122.88
- MOD1 = 33554432
- cmd_wr = 0
- cmd_rd = 128
- REGS = {'ADC_CLK_REG': 53, 'ADC_OFFSET_REG': 58, 'ADC_REG': 50, 'AUXOUT_REG': 114, 'BIAS_SEL_X2_REG': 112, 'BIAS_SEL_X4_REG': 113, 'BLEED0_REG': 38, 'BLEED1_REG': 39, 'CAL_PRE_REG': 18, 'CHIP_REG': 3, 'CLK1_DIV_HIGH_REG': 64, 'CLK1_DIV_LOW_REG': 63, 'CLK2_DIV_REG': 65, 'CONFIG0_REG': 0, 'CONFIG1_REG': 1, 'CONFIG2_REG': 30, 'CONFIG3_REG': 35, 'CONFIG4_REG': 42, 'CP_TMODE_REG': 62, 'FRAC1_HIGH_REG': 22, 'FRAC1_LOW_REG': 20, 'FRAC1_MID_REG': 21, 'FRAC2_HIGH_REG': 24, 'FRAC2_LOW_REG': 23, 'ICP_OFFSET_REG': 54, 'INT_HIGH_REG': 17, 'INT_LOW_REG': 16, 'LD_PD_ADC_REG': 115, 'LOCK_DETECT_REG': 124, 'LOCK_REG': 40, 'MOD2_HIGH_REG': 26, 'MOD2_LOW_REG': 25, 'MUXOUT_REG': 32, 'PHASE_HIGH_REG': 29, 'PHASE_LOW_REG': 27, 'PHASE_MID_REG': 28, 'PROD_ID0_REG': 4, 'PROD_ID1_REG': 5, 'PROD_REV_REG': 6, 'RCNT_REG': 31, 'REF_REG': 34, 'RFDIV_REG': 36, 'RFOUT_REG': 37, 'SD_REG': 43, 'SD_RESET_REG': 61, 'SI_BAND_REG': 55, 'SI_VCO_REG': 56, 'SI_VTUNE_REG': 57, 'SYNTH_TIMEOUT_REG': 51, 'TIMEOUT_REG': 49, 'TRM_RESD0_REG': 71, 'TRM_RESD1_REG': 82, 'VCO_BAND_REG': 48, 'VCO_BIAS0_REG': 44, 'VCO_BIAS1_REG': 45, 'VCO_BIAS2_REG': 46, 'VCO_BIAS3_REG': 47, 'VCO_DATA_HIGH_REG': 111, 'VCO_DATA_LOW_REG': 110, 'VCO_TIMEOUT_REG': 52}
- class qick.rfboard.GainLMH6401(spi_ip, ch_en, cs_t='')[source]
Bases:
objectVariable gain amp LMH6401.
- B = 6
- Gmin = -6
- Gmax = 26
- cmd_wr = 0
- cmd_rd = 128
- REGS = {'GAIN_REG': 2, 'PRODID_REG': 1, 'REVID_REG': 0, 'TFREQ_REG': 5, 'TGAIN_REG': 4}
- class qick.rfboard.AdcRfChain111(ch, switches, attn_spi)[source]
Bases:
AbsAdcRfChain
- class qick.rfboard.AdcDcChain111(ch, switches, gain_spi)[source]
Bases:
AbsAdcDcChainClass to describe the ADC-DC channel chain.
- class qick.rfboard.DacChain111(ch, switches, attn_spi)[source]
Bases:
AbsDacRfChain,AbsDacDcChain
- class qick.rfboard.FilterChain(soc, card, global_ch, card_num, card_ch)[source]
Bases:
Chain216- __init__(soc, card, global_ch, card_num, card_ch)
- class qick.rfboard.DacRfChain216(soc, card, global_ch, card_num, card_ch)[source]
Bases:
AbsDacRfChain,FilterChain- disable()[source]
Because this daughter card doesn’t have a per-channel power switch, we don’t power it down.
- init_filter()
- read_filter(reg='')
- set_filter(fc=0, bw=None, ftype='lowpass')
- set_filter_raw(hpf=-1, lpf=-1)
- class qick.rfboard.AdcRfChain216(soc, card, global_ch, card_num, card_ch)[source]
Bases:
AbsAdcRfChain,FilterChain- init_filter()
- read_filter(reg='')
- set_filter(fc=0, bw=None, ftype='lowpass')
- set_filter_raw(hpf=-1, lpf=-1)
- class qick.rfboard.DacDcChain216(soc, card, global_ch, card_num, card_ch)[source]
Bases:
AbsDacDcChain,Chain216
- class qick.rfboard.AdcDcChain216(soc, card, global_ch, card_num, card_ch)[source]
Bases:
AbsAdcDcChain,Chain216
- class qick.rfboard.DacBalunChain216(soc, card, global_ch, card_num, card_ch)[source]
Bases:
AbsDacBalunChain,Chain216
- class qick.rfboard.AdcBalunChain216(soc, card, global_ch, card_num, card_ch)[source]
Bases:
AbsAdcBalunChain,Chain216
- class qick.rfboard.DaughterCard216(card_num, soc, gpio)[source]
Bases:
ABC- NCH = None
- CARDNUM_OFFSET = None
- CHAIN_CLASS = None
- GPIO_OUTPUTS = [None, None, None, None]
- NAME = ''
- class qick.rfboard.DacRfCard216(card_num, soc, gpio)[source]
Bases:
DaughterCard216- NCH = 4
- CARDNUM_OFFSET = 0
- CHAIN_CLASS
alias of
DacRfChain216
- GPIO_OUTPUTS = [('RFOUT5V0_EN0', 0), ('RFOUT5V0_EN1', 0), None, None]
- NAME = 'RF Out'
- __init__(card_num, soc, gpio)
- class qick.rfboard.DacDcCard216(card_num, soc, gpio)[source]
Bases:
DaughterCard216- NCH = 4
- CARDNUM_OFFSET = 0
- CHAIN_CLASS
alias of
DacDcChain216
- GPIO_OUTPUTS = [('PD0', 0), ('PD1', 0), ('PD2', 0), ('PD3', 0)]
- NAME = 'DC Out'
- __init__(card_num, soc, gpio)
- disable_all()
- class qick.rfboard.DacBalunCard216(card_num, soc, gpio)[source]
Bases:
DaughterCard216- NCH = 4
- CARDNUM_OFFSET = 0
- CHAIN_CLASS
alias of
DacBalunChain216
- GPIO_OUTPUTS = [None, None, None, None]
- NAME = 'Balun Out'
- __init__(card_num, soc, gpio)
- disable_all()
- class qick.rfboard.AdcRfCard216(card_num, soc, gpio)[source]
Bases:
DaughterCard216- NCH = 2
- CARDNUM_OFFSET = 4
- CHAIN_CLASS
alias of
AdcRfChain216
- GPIO_OUTPUTS = [('RFIN5V0CH0_EN', 0), ('RFIN5V0CH1_EN', 0), None, None]
- NAME = 'RF In'
- __init__(card_num, soc, gpio)
- disable_all()
- class qick.rfboard.AdcDcCard216(card_num, soc, gpio)[source]
Bases:
DaughterCard216- NCH = 2
- CARDNUM_OFFSET = 4
- CHAIN_CLASS
alias of
AdcDcChain216
- GPIO_OUTPUTS = [('PD0', 1), ('PD1', 1), None, None]
- NAME = 'DC In'
- __init__(card_num, soc, gpio)
- disable_all()
- class qick.rfboard.AdcBalunCard216(card_num, soc, gpio)[source]
Bases:
DaughterCard216- NCH = 2
- CARDNUM_OFFSET = 4
- CHAIN_CLASS
alias of
AdcBalunChain216
- GPIO_OUTPUTS = [None, None, None, None]
- NAME = 'Balun In'
- __init__(card_num, soc, gpio)
- disable_all()
- class qick.rfboard.BoardSelection(gpio_ip)[source]
Bases:
objectThis class is used to enable one daughter card on the RF Board for the ZCU216, V1.
- class qick.rfboard.RFQickSoc(*args: Any, **kwargs: Any)[source]
Bases:
QickSocOverrides the __init__ method of QickSoc in order to add the drivers for the preproduction (V1) version of the RF board. Otherwise supports all the QickSoc functionality.
- HAS_LO = True
- __init__(bitfile, clk_output=None, no_tproc=False, **kwargs)[source]
A bitfile must always be provided, since the default bitstream will not work with the RF board.
The ZCU111 RF board takes its LO reference from the ZCU111 clock output. So if clk_output is None, the clocks will be re-initialized every time. This ensures that the LO output to the RF board is enabled.
- rfb_set_gen_rf(gen_ch, att1, att2)[source]
Enable and configure an RF-board output channel for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_gen_dc(gen_ch)[source]
Enable and configure an RF-board output channel for DC output.
- Parameters:
gen_ch (int) – DAC channel (index in ‘gens’ list)
- rfb_set_dac_rf(dac_port, att1, att2)[source]
Enable and configure a QICK box or RF board DAC port for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_dac_dc(dac_port)[source]
Enable and configure a QICK box or RF board DAC port for DC output.
- Parameters:
dac_port (int) – QICK box or RF board DAC port number (0-15 for ZCU216, 0-7 for ZCU111)
- rfb_set_ro_rf(ro_ch, att)[source]
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- rfb_set_ro_dc(ro_ch, gain)[source]
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_adc_rf(adc_port, att)[source]
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- rfb_set_adc_dc(adc_port, gain)[source]
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- adcfreq(f, gen_ch=0, ro_ch=0)
Takes a frequency and trims it to the closest DDS frequency valid for both channels.
- arm_ddr4(ch, nt, force_overwrite=False)
Prepare the DDR4 buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record the specified amount of data. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
nt (int) – Number of data transfers to record; the number of IQ samples/transfer (128 or 256) is printed in the QickSoc config. Note that the amount of useful data is less (see
get_ddr4)force_overwrite (bool) – Allow a DDR4 acqusition that exceeds the DDR4 memory capacity. The memory will be used as a circular buffer: later transfers will wrap around to the beginning of the memory and overwrite older data.
- arm_mr(ch)
Prepare the Multi-Rate buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record until the buffer is filled. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
- calc_fstep(dicts)
Finds the least common multiple of the frequency steps of one or more channels (typically two, a generator and a readout) For proper frequency matching, you should only use frequencies that are evenly divisible by this value. The order of the parameters does not matter.
- calc_fstep_int(dict1, other_dicts)
Finds the multiplier that needs to be applied to a channel’s frequency step size to allow this channel to be frequency-matched with another channel.
- calc_mixer_freq(gen_ch, mixer_freq, nqz, ro_ch)
Set the NCO frequency that will be mixed with the generator output.
The RFdc driver does its own math to convert a frequency to a register value. (see XRFdc_SetMixerSettings in xrfdc_mixer.c, and “NCO Frequency Conversion” in PG269) This is what it does: 1. Add/subtract fs to get the frequency in the range of [-fs/2, fs/2]. 2. If the original frequency was not in [-fs/2, fs/2] and the DAC is configured for 2nd Nyquist zone, multiply by -1. 3. Convert to a 48-bit register value, rounding using C integer casting (i.e. round towards 0).
Step 2 is not desirable for us, so we must undo it.
The rounding gives unexpected results sometimes: it’s hard to tell if a freq will get rounded up or down. This is important if the demanded frequency was rounded to a valid frequency for frequency matching. The safest way to get consistent behavior is to always round to a valid NCO frequency. We are trusting that the floating-point math is exact and a number we rounded here is still a round number in the RFdc driver.
- calc_muxgen_regs(gen_ch, freqs, gains, phases, ro_ch, absolute_freqs, mixer_freq)
Calculate the register values to program into a multiplexed generator. mixer_freq will have been rounded appropriately in declare_gen, and will be 0 if there’s no mixer
- calc_ro_freq(rocfg, ro_pars, ro_regs, absolute_freqs, mixer_freq, flip_freq=False)
Calculate the readout frequency and registers.
- calc_ro_regs(rocfg, phase, sel, ch=None)
Calculate the settings to configure a readout.
- Returns:
settings for QickSoc.config_readout()
- Return type:
- ch_fstep(dict1)
Finds the frequency step size of a single channel (generator or readout).
- check_pfb_collisions(rocfg, cfg1, cfgs)
Check whether the specified PFB config collides or interefers with any others. If this PFB block can’t put two readouts on the same channel, this method will raise an error on collisions. Possible crosstalk will be identified in warnings.
- cleanup_round()
This runs after a program has finished running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- clear_ddr4(length=None)
Clear the DDR4 buffer, filling it with 0’s. This is not necessary (the buffer will overwrite old data), but may be useful for debugging. Clearing the full buffer (4 GB) typically takes 4-5 seconds.
- Parameters:
length (int) – Number of samples to clear (starting at the beginning of the buffer). If None, clear the entire buffer.
- clear_tproc_counter(addr)
Initialize the tProc shot counter. For tProc v1, the data memory at the specified address is zeroed. For tProc v2, the tProc is reset, which zeroes all registers (the address is ignored).
Typical tProc v2 programs will also initialize the counter registers at the beginning of the program, but zeroing the counter now is important to distinguish “program waiting for external start” from “program complete.”
- Parameters:
addr (int) – Counter address
- clocks_locked()
Checks whether the DAC and ADC PLLs are locked. This can only be run after the bitstream has been downloaded. A failure usually means the FPGA is not getting a good reference clock from the on-board clock chips.
- Returns:
clock status
- Return type:
- config_avg(ch, address=0, length=1, edge_counting=False, high_threshold=1000, low_threshold=0)
Configure accumulated buffer; must then enable using enable_buf()
- config_buf(ch, address=0, length=1)
Configure decimated buffer; must then enable using enable_buf()
- config_clocks(force_init_clks, clk_output, external_clk)
Configure PLLs if requested, or if any ADC/DAC is not locked. The ADC/DAC PLL lock status is read through the RFDC IP, so this assumes that the bitstream has already been downloaded. The reference clock frequency must already have been read from the firmware config.
- config_mux_gen(ch, tones)
Set up a list of tones all at once, using raw (integer) units. If the supplied list of tones is shorter than the number supported, the extra tones will have their gains set to 0.
- config_mux_readout(pfbpath, cfgs, sel=None)
Set up a list of readout frequencies all at once, using raw (integer) units.
- configure_readout(ch, ro_regs)
Configure readout channel output style and frequency. This method is only for use with PYNQ-configured readouts.
- cycles2us(cycles, gen_ch=None, ro_ch=None)
Converts clock cycles to microseconds. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- deg2int(deg, thisch)
Converts phase in degrees to integer value suitable for writing to a register. This method works for both generators and readouts.
- deg2reg(deg, gen_ch=0, ro_ch=None)
Converts degrees into phase register values; numbers greater than 360 will effectively be wrapped.
- description()
Generate a printable description of the QICK configuration.
- Returns:
description
- Return type:
- dump_cfg(gen_file_path=None)
Generate a JSON description of the QICK configuration. You can save this string to a file and load it to recreate the QickConfig.
- enable_buf(ch, enable_avg=True, enable_buf=True)
Enable capture of accumulated and/or decimated data for a buffer
- freeze_adc_cals(blocknames)
Freeze the calibrations (stop the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- freq2int(f, thisch, otherch=None)
Converts frequency in MHz to integer value suitable for writing to a register. This method works for both generators and readouts. If a gen will be connected to an RO, the two channels must have exactly the same frequency, and you must supply the config for the other channel.
- freq2reg(f, gen_ch=0, ro_ch=None)
Converts frequency in MHz to tProc generator register value.
- freq2reg_adc(f, ro_ch=0, gen_ch=None)
Converts frequency in MHz to readout register value.
- get_accumulated(ch, address=0, length=None)
Acquires data from the readout accumulated buffer
- get_adc_attenuator(blockname)
Read the RFSoC ADC’s built-in step attenuator.
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- get_cfg()
Return the QICK configuration dictionary. This contains everything you need to recreate the QickConfig.
- Returns:
configuration dictionary
- Return type:
- get_ddr4(nt, start=None)
Get data from the DDR4 buffer. The first samples (typically 401 or 801) of the buffer are always stale data from the previous acquisition.
- Parameters:
nt (int) – Number of data transfers (each transfer is 128 or 256 decimated samples) to retrieve. If start=None, the amount of data will be reduced (see below).
start (int) – Number of samples to skip at the beginning of the buffer. If a value is specified, the end address of the transfer window will also be incremented. If None, the junk at the start of the buffer will be skipped but the end address will not be incremented. This reduces the amount of data, giving you exactly the block of valid data from a DDR4 trigger with the same value of nt.
- get_decimated(ch, address=0, length=None)
Acquires data from the readout decimated buffer
- Parameters:
- Returns:
List of I and Q decimated arrays
- Return type:
- get_maxv(gen_ch)
Convenience method for looking up a generator’s maximum allowed envelope value. The absolute value of the idata/qdata should not exceed this. Typically you will want to normalize your envelope’s maximum range to this value.
- get_mr(start=None)
Get data from the multi-rate buffer. The first 8 samples are always stale data from the previous acquisition. The transfer window always extends to the end of the buffer.
- Parameters:
start (int) – Number of samples to skip at the beginning of the buffer. If None, the junk at the start of the buffer is skipped.
- get_sample_rates()
Produce dictionaries of the current sample rates of the DAC and ADC tiles. A dictionary of this form can be used to configure the sample rates at SoC initialization.
- get_tproc_counter(addr)
Read the tProc shot counter. For tProc V1, this accesses the data memory at the given address. For tProc V2, this accesses one of the two special AXI-readable registers.
- int2deg(r, thisch)
Converts register value to degrees. This method works for both generators and readouts.
- int2freq(r, thisch)
Converts register value to MHz. This method works for both generators and readouts.
- load_bin_program(binprog, load_mem=True)
Write the program to the tProc program memory.
- Parameters:
binprog (numpy.ndarray or dict) – compiled program (format depends on tProc version)
load_mem (bool) – write waveform and data memory now (can do this later with reload_mem())
- load_envelope(ch, data, addr)
Load envelope data into a signal generator.
- Parameters:
ch (int) – Generator channel to configure
data (numpy.ndarray of int16) – Array of (I, Q) values for pulse envelope
addr (int) – Starting address
- load_mem(data, mem_sel='dmem', addr=0)
Write a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
data (numpy.ndarray of int) – Data to be loaded 32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
mem_sel (str) – “pmem”, “dmem”, “wmem”
addr (int) – Starting write address
- load_weights(ch, data, addr=0)
Load weights array to a weighted buffer.
- Parameters:
ch (int) – Readout channel to configure
data (numpy.ndarray of int16) – array of 16-bit (I, Q) values for weights
address (int) – starting address
- map_signal_paths(no_tproc)
Make lists of signal generator, readout, and buffer blocks in the firmware. Also map the switches connecting the generators and buffers to DMA. Fill the config dictionary with parameters of the DAC and ADC channels.
- pl_reset(reinit=True)
Reset all firmware IP blocks. This pulses the pl_resetn0 line from the PS (also known as the “fabric reset” or the “PS-PL reset”). Every firmware block’s reset logic is triggered by this pulse. The main visible effect of this reset is to reset the start times of all the phase-coherent DDS oscillators.
Some firmware blocks have startup code in their __initialize__() to configure the block after the firmware is loaded. That configuration gets wiped out by a PL reset, so this method also re-configures those blocks.
More info on the PL reset: The reset sequence is defined in psu_ps_pl_reset_config_data() in psu_init.c. You can find this in the BSP or the firmware project files. The reset sequence and the memory addresses invovled appear to be the same for all RFSoCs.
https://support.xilinx.com/s/article/68962 https://support.xilinx.com/s/question/0D52E00006lLhBnSAK/zynq-ultrascale-howto-reset-the-pl https://docs.amd.com/r/en-US/ug1137-zynq-ultrascale-mpsoc-swdev/GPIO-Reset-to-PL https://docs.amd.com/r/en-US/pg201-zynq-ultrascale-plus-processing-system/Fabric-Reset-Enable
- Parameters:
reinit (bool) – Reinitialize firmware blocks. False is OK if you haven’t run map_signal_paths() yet (which triggers block initialization).
- poll_data(totaltime=0.1, timeout=None)
Get as much data as possible from the streamer data queue. Stop when any of the following conditions are met: * all the data has been transferred (based on the total_count) * we got data, and it has been totaltime seconds since poll_data was called * timeout is defined, and the timeout expired without getting new data in the queue If there are errors in the error queue, raise the first one.
- prepare_round()
This runs before a program starts running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- read_mem(length, mem_sel='dmem', addr=0)
Read a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
- Returns:
32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
- Return type:
- reg2deg(r, gen_ch=0, ro_ch=None)
Converts phase register values into degrees.
- reg2freq(r, gen_ch=0)
Converts frequency from format readable by generator to MHz.
- reg2freq_adc(r, ro_ch=0)
Converts frequency from format readable by readout to MHz.
- reload_mem()
Reload the waveform and data memory, overwriting any changes made by running the program.
- reset_gens()
Reset the tProc and run a minimal tProc program that drives all signal generators with 0’s. Useful for stopping any periodic or stdysel=”last” outputs that may have been driven by a previous program.
- round_sample_rate(tiletype, tile, fs_target)
Return the closest achievable sample rate to the requested value. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- roundfreq(f, dicts)
Round a frequency to the LCM of the frequency steps of one or more channels (typically two, a generator and a readout).
- Parameters:
f (float or numpy.ndarray) – frequency (MHz)
- Returns:
rounded frequency (MHz)
- Return type:
- set_adc_attenuator(blockname, attenuation)
Set the RFSoC ADC’s built-in step attenuator. The requested value will be rounded to the nearest valid value (0-27 dB inclusive, 1 dB steps).
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- Parameters:
- Returns:
The rounded attenuation value that was actually set (dB)
- Return type:
- set_all_clks(clk_output, external_clk)
Resets all the board clocks
- set_iq(ch, f, i, q, ro_ch=None, phase_reset=True)
Set frequency, I, and Q for a constant-IQ output.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – frequency (in MHz)
i (float) – I value (in range -1 to 1)
q (float) – Q value (in range -1 to 1)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
- set_mixer_freq(ch, f, ro_ch=None, phase_reset=True, fullscale=False)
Set mixer frequency for a signal generator. If the generator does not have a mixer, you will get an error.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – Mixer frequency (in MHz)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want mixer freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
fullscale (bool) – use the full DAC output range, disabling the mixer’s default 0.7 scale factor (see https://docs.amd.com/r/en-US/pg269-rf-data-converter/RF-DAC-Numerical-Controlled-Oscillator-and-Mixer, https://docs.amd.com/r/en-US/pg269-rf-data-converter/struct-XRFdc_Mixer_Settings)
- set_nyquist(ch, nqz, force=False)
Sets DAC channel ch to operate in Nyquist zone nqz mode.
- start_readout(total_shots, counter_addr=1, ch_list=None, reads_per_shot=1, stride=None)
Start a streaming readout of the accumulated buffers.
- start_src(src)
Sets the start source of tProc
- Parameters:
src (str) – start source “internal” or “external”
- start_tproc()
Start the tProc.
If the tProc is configured for external start, this does nothing (the tProc will start on the first start signal it sees after external start is enabled).
- stop_tproc(lazy=False)
Stop the tProc. This is somewhat slow (tens of ms) for tProc v1.
- Parameters:
lazy (bool) – Only stop the tProc if it’s easy (i.e. do nothing for v1)
- property streamer
- property tproc
- tt_arm(blk)
Start data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_config(blk, threshold, wr_smp=32, filt=False, slope=False, invert=False, interp=0, deadtime=5)
Configure the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to flush (index in time_taggers list).
threshold (int) – Tag threshold (-2^15 through 2^15-1).
wr_smp (int) – Number of 8-sample chunks to capture per tag in the SMP memory (1 through 32). If this time tagger has no SMP memory, this is ignored.
filt (bool) – Trigger on signal after a 2-sample smoothing filter.
slope (bool) – Trigger on slope (difference between consecutive samples), not level.
invert (bool) – Trigger on inverted signal.
interp (int) – Number of bits for interpolation (0 through 7).
deadtime (int) – Minimum time (in fabric ticks, 8 samples) between one tag and the next (5 through 255). This should be larger than the expected pulse width, otherwise you will get double-triggering on the same pulse.
- tt_disarm(blk)
Stop data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_readmem(blk, mem)
Read one of the specified time-tagger block’s memories. Reading a time-tagger memory clears it.
- tt_reset(blk)
Reset and flush the memories of the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to reset (index in time_taggers list).
- unfreeze_adc_cals(blocknames)
Unfreeze the calibrations (resume the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- us2cycles(us, gen_ch=None, ro_ch=None, as_float=False)
Converts microseconds to integer number of clock cycles. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- valid_sample_rates(tiletype, tile)
Return an array of valid sample rates. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- Parameters:
- Returns:
Array of sample rates, in Msps
- Return type:
- class qick.rfboard.RFQickSoc111V1(*args: Any, **kwargs: Any)[source]
Bases:
RFQickSoc- rfb_set_lo(f)[source]
Set both of the RF-board local oscillators to the same frequency.
Tile 0 DACs and all RF ADCs are connected to LO[0], tile 1 DACs are connected to LO[1].
- Parameters:
f (float) – Frequency (4000-8000 MHz)
- HAS_LO = True
- __init__(bitfile, clk_output=None, no_tproc=False, **kwargs)
A bitfile must always be provided, since the default bitstream will not work with the RF board.
The ZCU111 RF board takes its LO reference from the ZCU111 clock output. So if clk_output is None, the clocks will be re-initialized every time. This ensures that the LO output to the RF board is enabled.
- adcfreq(f, gen_ch=0, ro_ch=0)
Takes a frequency and trims it to the closest DDS frequency valid for both channels.
- arm_ddr4(ch, nt, force_overwrite=False)
Prepare the DDR4 buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record the specified amount of data. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
nt (int) – Number of data transfers to record; the number of IQ samples/transfer (128 or 256) is printed in the QickSoc config. Note that the amount of useful data is less (see
get_ddr4)force_overwrite (bool) – Allow a DDR4 acqusition that exceeds the DDR4 memory capacity. The memory will be used as a circular buffer: later transfers will wrap around to the beginning of the memory and overwrite older data.
- arm_mr(ch)
Prepare the Multi-Rate buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record until the buffer is filled. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
- calc_fstep(dicts)
Finds the least common multiple of the frequency steps of one or more channels (typically two, a generator and a readout) For proper frequency matching, you should only use frequencies that are evenly divisible by this value. The order of the parameters does not matter.
- calc_fstep_int(dict1, other_dicts)
Finds the multiplier that needs to be applied to a channel’s frequency step size to allow this channel to be frequency-matched with another channel.
- calc_mixer_freq(gen_ch, mixer_freq, nqz, ro_ch)
Set the NCO frequency that will be mixed with the generator output.
The RFdc driver does its own math to convert a frequency to a register value. (see XRFdc_SetMixerSettings in xrfdc_mixer.c, and “NCO Frequency Conversion” in PG269) This is what it does: 1. Add/subtract fs to get the frequency in the range of [-fs/2, fs/2]. 2. If the original frequency was not in [-fs/2, fs/2] and the DAC is configured for 2nd Nyquist zone, multiply by -1. 3. Convert to a 48-bit register value, rounding using C integer casting (i.e. round towards 0).
Step 2 is not desirable for us, so we must undo it.
The rounding gives unexpected results sometimes: it’s hard to tell if a freq will get rounded up or down. This is important if the demanded frequency was rounded to a valid frequency for frequency matching. The safest way to get consistent behavior is to always round to a valid NCO frequency. We are trusting that the floating-point math is exact and a number we rounded here is still a round number in the RFdc driver.
- calc_muxgen_regs(gen_ch, freqs, gains, phases, ro_ch, absolute_freqs, mixer_freq)
Calculate the register values to program into a multiplexed generator. mixer_freq will have been rounded appropriately in declare_gen, and will be 0 if there’s no mixer
- calc_ro_freq(rocfg, ro_pars, ro_regs, absolute_freqs, mixer_freq, flip_freq=False)
Calculate the readout frequency and registers.
- calc_ro_regs(rocfg, phase, sel, ch=None)
Calculate the settings to configure a readout.
- Returns:
settings for QickSoc.config_readout()
- Return type:
- ch_fstep(dict1)
Finds the frequency step size of a single channel (generator or readout).
- check_pfb_collisions(rocfg, cfg1, cfgs)
Check whether the specified PFB config collides or interefers with any others. If this PFB block can’t put two readouts on the same channel, this method will raise an error on collisions. Possible crosstalk will be identified in warnings.
- cleanup_round()
This runs after a program has finished running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- clear_ddr4(length=None)
Clear the DDR4 buffer, filling it with 0’s. This is not necessary (the buffer will overwrite old data), but may be useful for debugging. Clearing the full buffer (4 GB) typically takes 4-5 seconds.
- Parameters:
length (int) – Number of samples to clear (starting at the beginning of the buffer). If None, clear the entire buffer.
- clear_tproc_counter(addr)
Initialize the tProc shot counter. For tProc v1, the data memory at the specified address is zeroed. For tProc v2, the tProc is reset, which zeroes all registers (the address is ignored).
Typical tProc v2 programs will also initialize the counter registers at the beginning of the program, but zeroing the counter now is important to distinguish “program waiting for external start” from “program complete.”
- Parameters:
addr (int) – Counter address
- clocks_locked()
Checks whether the DAC and ADC PLLs are locked. This can only be run after the bitstream has been downloaded. A failure usually means the FPGA is not getting a good reference clock from the on-board clock chips.
- Returns:
clock status
- Return type:
- config_avg(ch, address=0, length=1, edge_counting=False, high_threshold=1000, low_threshold=0)
Configure accumulated buffer; must then enable using enable_buf()
- config_buf(ch, address=0, length=1)
Configure decimated buffer; must then enable using enable_buf()
- config_clocks(force_init_clks, clk_output, external_clk)
Configure PLLs if requested, or if any ADC/DAC is not locked. The ADC/DAC PLL lock status is read through the RFDC IP, so this assumes that the bitstream has already been downloaded. The reference clock frequency must already have been read from the firmware config.
- config_mux_gen(ch, tones)
Set up a list of tones all at once, using raw (integer) units. If the supplied list of tones is shorter than the number supported, the extra tones will have their gains set to 0.
- config_mux_readout(pfbpath, cfgs, sel=None)
Set up a list of readout frequencies all at once, using raw (integer) units.
- configure_readout(ch, ro_regs)
Configure readout channel output style and frequency. This method is only for use with PYNQ-configured readouts.
- cycles2us(cycles, gen_ch=None, ro_ch=None)
Converts clock cycles to microseconds. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- deg2int(deg, thisch)
Converts phase in degrees to integer value suitable for writing to a register. This method works for both generators and readouts.
- deg2reg(deg, gen_ch=0, ro_ch=None)
Converts degrees into phase register values; numbers greater than 360 will effectively be wrapped.
- description()
Generate a printable description of the QICK configuration.
- Returns:
description
- Return type:
- dump_cfg(gen_file_path=None)
Generate a JSON description of the QICK configuration. You can save this string to a file and load it to recreate the QickConfig.
- enable_buf(ch, enable_avg=True, enable_buf=True)
Enable capture of accumulated and/or decimated data for a buffer
- freeze_adc_cals(blocknames)
Freeze the calibrations (stop the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- freq2int(f, thisch, otherch=None)
Converts frequency in MHz to integer value suitable for writing to a register. This method works for both generators and readouts. If a gen will be connected to an RO, the two channels must have exactly the same frequency, and you must supply the config for the other channel.
- freq2reg(f, gen_ch=0, ro_ch=None)
Converts frequency in MHz to tProc generator register value.
- freq2reg_adc(f, ro_ch=0, gen_ch=None)
Converts frequency in MHz to readout register value.
- get_accumulated(ch, address=0, length=None)
Acquires data from the readout accumulated buffer
- get_adc_attenuator(blockname)
Read the RFSoC ADC’s built-in step attenuator.
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- get_cfg()
Return the QICK configuration dictionary. This contains everything you need to recreate the QickConfig.
- Returns:
configuration dictionary
- Return type:
- get_ddr4(nt, start=None)
Get data from the DDR4 buffer. The first samples (typically 401 or 801) of the buffer are always stale data from the previous acquisition.
- Parameters:
nt (int) – Number of data transfers (each transfer is 128 or 256 decimated samples) to retrieve. If start=None, the amount of data will be reduced (see below).
start (int) – Number of samples to skip at the beginning of the buffer. If a value is specified, the end address of the transfer window will also be incremented. If None, the junk at the start of the buffer will be skipped but the end address will not be incremented. This reduces the amount of data, giving you exactly the block of valid data from a DDR4 trigger with the same value of nt.
- get_decimated(ch, address=0, length=None)
Acquires data from the readout decimated buffer
- Parameters:
- Returns:
List of I and Q decimated arrays
- Return type:
- get_maxv(gen_ch)
Convenience method for looking up a generator’s maximum allowed envelope value. The absolute value of the idata/qdata should not exceed this. Typically you will want to normalize your envelope’s maximum range to this value.
- get_mr(start=None)
Get data from the multi-rate buffer. The first 8 samples are always stale data from the previous acquisition. The transfer window always extends to the end of the buffer.
- Parameters:
start (int) – Number of samples to skip at the beginning of the buffer. If None, the junk at the start of the buffer is skipped.
- get_sample_rates()
Produce dictionaries of the current sample rates of the DAC and ADC tiles. A dictionary of this form can be used to configure the sample rates at SoC initialization.
- get_tproc_counter(addr)
Read the tProc shot counter. For tProc V1, this accesses the data memory at the given address. For tProc V2, this accesses one of the two special AXI-readable registers.
- int2deg(r, thisch)
Converts register value to degrees. This method works for both generators and readouts.
- int2freq(r, thisch)
Converts register value to MHz. This method works for both generators and readouts.
- load_bin_program(binprog, load_mem=True)
Write the program to the tProc program memory.
- Parameters:
binprog (numpy.ndarray or dict) – compiled program (format depends on tProc version)
load_mem (bool) – write waveform and data memory now (can do this later with reload_mem())
- load_envelope(ch, data, addr)
Load envelope data into a signal generator.
- Parameters:
ch (int) – Generator channel to configure
data (numpy.ndarray of int16) – Array of (I, Q) values for pulse envelope
addr (int) – Starting address
- load_mem(data, mem_sel='dmem', addr=0)
Write a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
data (numpy.ndarray of int) – Data to be loaded 32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
mem_sel (str) – “pmem”, “dmem”, “wmem”
addr (int) – Starting write address
- load_weights(ch, data, addr=0)
Load weights array to a weighted buffer.
- Parameters:
ch (int) – Readout channel to configure
data (numpy.ndarray of int16) – array of 16-bit (I, Q) values for weights
address (int) – starting address
- map_signal_paths(no_tproc)
Make lists of signal generator, readout, and buffer blocks in the firmware. Also map the switches connecting the generators and buffers to DMA. Fill the config dictionary with parameters of the DAC and ADC channels.
- pl_reset(reinit=True)
Reset all firmware IP blocks. This pulses the pl_resetn0 line from the PS (also known as the “fabric reset” or the “PS-PL reset”). Every firmware block’s reset logic is triggered by this pulse. The main visible effect of this reset is to reset the start times of all the phase-coherent DDS oscillators.
Some firmware blocks have startup code in their __initialize__() to configure the block after the firmware is loaded. That configuration gets wiped out by a PL reset, so this method also re-configures those blocks.
More info on the PL reset: The reset sequence is defined in psu_ps_pl_reset_config_data() in psu_init.c. You can find this in the BSP or the firmware project files. The reset sequence and the memory addresses invovled appear to be the same for all RFSoCs.
https://support.xilinx.com/s/article/68962 https://support.xilinx.com/s/question/0D52E00006lLhBnSAK/zynq-ultrascale-howto-reset-the-pl https://docs.amd.com/r/en-US/ug1137-zynq-ultrascale-mpsoc-swdev/GPIO-Reset-to-PL https://docs.amd.com/r/en-US/pg201-zynq-ultrascale-plus-processing-system/Fabric-Reset-Enable
- Parameters:
reinit (bool) – Reinitialize firmware blocks. False is OK if you haven’t run map_signal_paths() yet (which triggers block initialization).
- poll_data(totaltime=0.1, timeout=None)
Get as much data as possible from the streamer data queue. Stop when any of the following conditions are met: * all the data has been transferred (based on the total_count) * we got data, and it has been totaltime seconds since poll_data was called * timeout is defined, and the timeout expired without getting new data in the queue If there are errors in the error queue, raise the first one.
- prepare_round()
This runs before a program starts running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- read_mem(length, mem_sel='dmem', addr=0)
Read a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
- Returns:
32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
- Return type:
- reg2deg(r, gen_ch=0, ro_ch=None)
Converts phase register values into degrees.
- reg2freq(r, gen_ch=0)
Converts frequency from format readable by generator to MHz.
- reg2freq_adc(r, ro_ch=0)
Converts frequency from format readable by readout to MHz.
- reload_mem()
Reload the waveform and data memory, overwriting any changes made by running the program.
- reset_gens()
Reset the tProc and run a minimal tProc program that drives all signal generators with 0’s. Useful for stopping any periodic or stdysel=”last” outputs that may have been driven by a previous program.
- rfb_get_bias(bias_ch)
Read the voltage setpoint on an RF-board bias output.
- rfb_set_adc_dc(adc_port, gain)
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_adc_rf(adc_port, att)
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- rfb_set_bias(bias_ch, v)
Set a voltage on an RF-board bias output.
- rfb_set_dac_dc(dac_port)
Enable and configure a QICK box or RF board DAC port for DC output.
- Parameters:
dac_port (int) – QICK box or RF board DAC port number (0-15 for ZCU216, 0-7 for ZCU111)
- rfb_set_dac_rf(dac_port, att1, att2)
Enable and configure a QICK box or RF board DAC port for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_gen_dc(gen_ch)
Enable and configure an RF-board output channel for DC output.
- Parameters:
gen_ch (int) – DAC channel (index in ‘gens’ list)
- rfb_set_gen_rf(gen_ch, att1, att2)
Enable and configure an RF-board output channel for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_ro_dc(ro_ch, gain)
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_ro_rf(ro_ch, att)
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- round_sample_rate(tiletype, tile, fs_target)
Return the closest achievable sample rate to the requested value. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- roundfreq(f, dicts)
Round a frequency to the LCM of the frequency steps of one or more channels (typically two, a generator and a readout).
- Parameters:
f (float or numpy.ndarray) – frequency (MHz)
- Returns:
rounded frequency (MHz)
- Return type:
- set_adc_attenuator(blockname, attenuation)
Set the RFSoC ADC’s built-in step attenuator. The requested value will be rounded to the nearest valid value (0-27 dB inclusive, 1 dB steps).
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- Parameters:
- Returns:
The rounded attenuation value that was actually set (dB)
- Return type:
- set_all_clks(clk_output, external_clk)
Resets all the board clocks
- set_iq(ch, f, i, q, ro_ch=None, phase_reset=True)
Set frequency, I, and Q for a constant-IQ output.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – frequency (in MHz)
i (float) – I value (in range -1 to 1)
q (float) – Q value (in range -1 to 1)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
- set_mixer_freq(ch, f, ro_ch=None, phase_reset=True, fullscale=False)
Set mixer frequency for a signal generator. If the generator does not have a mixer, you will get an error.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – Mixer frequency (in MHz)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want mixer freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
fullscale (bool) – use the full DAC output range, disabling the mixer’s default 0.7 scale factor (see https://docs.amd.com/r/en-US/pg269-rf-data-converter/RF-DAC-Numerical-Controlled-Oscillator-and-Mixer, https://docs.amd.com/r/en-US/pg269-rf-data-converter/struct-XRFdc_Mixer_Settings)
- set_nyquist(ch, nqz, force=False)
Sets DAC channel ch to operate in Nyquist zone nqz mode.
- start_readout(total_shots, counter_addr=1, ch_list=None, reads_per_shot=1, stride=None)
Start a streaming readout of the accumulated buffers.
- start_src(src)
Sets the start source of tProc
- Parameters:
src (str) – start source “internal” or “external”
- start_tproc()
Start the tProc.
If the tProc is configured for external start, this does nothing (the tProc will start on the first start signal it sees after external start is enabled).
- stop_tproc(lazy=False)
Stop the tProc. This is somewhat slow (tens of ms) for tProc v1.
- Parameters:
lazy (bool) – Only stop the tProc if it’s easy (i.e. do nothing for v1)
- property streamer
- property tproc
- tt_arm(blk)
Start data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_config(blk, threshold, wr_smp=32, filt=False, slope=False, invert=False, interp=0, deadtime=5)
Configure the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to flush (index in time_taggers list).
threshold (int) – Tag threshold (-2^15 through 2^15-1).
wr_smp (int) – Number of 8-sample chunks to capture per tag in the SMP memory (1 through 32). If this time tagger has no SMP memory, this is ignored.
filt (bool) – Trigger on signal after a 2-sample smoothing filter.
slope (bool) – Trigger on slope (difference between consecutive samples), not level.
invert (bool) – Trigger on inverted signal.
interp (int) – Number of bits for interpolation (0 through 7).
deadtime (int) – Minimum time (in fabric ticks, 8 samples) between one tag and the next (5 through 255). This should be larger than the expected pulse width, otherwise you will get double-triggering on the same pulse.
- tt_disarm(blk)
Stop data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_readmem(blk, mem)
Read one of the specified time-tagger block’s memories. Reading a time-tagger memory clears it.
- tt_reset(blk)
Reset and flush the memories of the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to reset (index in time_taggers list).
- unfreeze_adc_cals(blocknames)
Unfreeze the calibrations (resume the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- us2cycles(us, gen_ch=None, ro_ch=None, as_float=False)
Converts microseconds to integer number of clock cycles. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- valid_sample_rates(tiletype, tile)
Return an array of valid sample rates. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- Parameters:
- Returns:
Array of sample rates, in Msps
- Return type:
- class qick.rfboard.RFQickSoc111V2(*args: Any, **kwargs: Any)[source]
Bases:
RFQickSoc111V1- rfb_set_lo(f, ch=None, verbose=False)[source]
Set RF-board local oscillators.
LO[0]: all RF ADCs LO[1]: RF DACs 0-3 LO[2]: RF DACs 4-7
- rfb_get_lo(gen_ch=None, ro_ch=None)[source]
Get local oscillator frequency for a DAC or ADC channel.
- HAS_LO = True
- __init__(bitfile, clk_output=None, no_tproc=False, **kwargs)
A bitfile must always be provided, since the default bitstream will not work with the RF board.
The ZCU111 RF board takes its LO reference from the ZCU111 clock output. So if clk_output is None, the clocks will be re-initialized every time. This ensures that the LO output to the RF board is enabled.
- adcfreq(f, gen_ch=0, ro_ch=0)
Takes a frequency and trims it to the closest DDS frequency valid for both channels.
- arm_ddr4(ch, nt, force_overwrite=False)
Prepare the DDR4 buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record the specified amount of data. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
nt (int) – Number of data transfers to record; the number of IQ samples/transfer (128 or 256) is printed in the QickSoc config. Note that the amount of useful data is less (see
get_ddr4)force_overwrite (bool) – Allow a DDR4 acqusition that exceeds the DDR4 memory capacity. The memory will be used as a circular buffer: later transfers will wrap around to the beginning of the memory and overwrite older data.
- arm_mr(ch)
Prepare the Multi-Rate buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record until the buffer is filled. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
- calc_fstep(dicts)
Finds the least common multiple of the frequency steps of one or more channels (typically two, a generator and a readout) For proper frequency matching, you should only use frequencies that are evenly divisible by this value. The order of the parameters does not matter.
- calc_fstep_int(dict1, other_dicts)
Finds the multiplier that needs to be applied to a channel’s frequency step size to allow this channel to be frequency-matched with another channel.
- calc_mixer_freq(gen_ch, mixer_freq, nqz, ro_ch)
Set the NCO frequency that will be mixed with the generator output.
The RFdc driver does its own math to convert a frequency to a register value. (see XRFdc_SetMixerSettings in xrfdc_mixer.c, and “NCO Frequency Conversion” in PG269) This is what it does: 1. Add/subtract fs to get the frequency in the range of [-fs/2, fs/2]. 2. If the original frequency was not in [-fs/2, fs/2] and the DAC is configured for 2nd Nyquist zone, multiply by -1. 3. Convert to a 48-bit register value, rounding using C integer casting (i.e. round towards 0).
Step 2 is not desirable for us, so we must undo it.
The rounding gives unexpected results sometimes: it’s hard to tell if a freq will get rounded up or down. This is important if the demanded frequency was rounded to a valid frequency for frequency matching. The safest way to get consistent behavior is to always round to a valid NCO frequency. We are trusting that the floating-point math is exact and a number we rounded here is still a round number in the RFdc driver.
- calc_muxgen_regs(gen_ch, freqs, gains, phases, ro_ch, absolute_freqs, mixer_freq)
Calculate the register values to program into a multiplexed generator. mixer_freq will have been rounded appropriately in declare_gen, and will be 0 if there’s no mixer
- calc_ro_freq(rocfg, ro_pars, ro_regs, absolute_freqs, mixer_freq, flip_freq=False)
Calculate the readout frequency and registers.
- calc_ro_regs(rocfg, phase, sel, ch=None)
Calculate the settings to configure a readout.
- Returns:
settings for QickSoc.config_readout()
- Return type:
- ch_fstep(dict1)
Finds the frequency step size of a single channel (generator or readout).
- check_pfb_collisions(rocfg, cfg1, cfgs)
Check whether the specified PFB config collides or interefers with any others. If this PFB block can’t put two readouts on the same channel, this method will raise an error on collisions. Possible crosstalk will be identified in warnings.
- cleanup_round()
This runs after a program has finished running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- clear_ddr4(length=None)
Clear the DDR4 buffer, filling it with 0’s. This is not necessary (the buffer will overwrite old data), but may be useful for debugging. Clearing the full buffer (4 GB) typically takes 4-5 seconds.
- Parameters:
length (int) – Number of samples to clear (starting at the beginning of the buffer). If None, clear the entire buffer.
- clear_tproc_counter(addr)
Initialize the tProc shot counter. For tProc v1, the data memory at the specified address is zeroed. For tProc v2, the tProc is reset, which zeroes all registers (the address is ignored).
Typical tProc v2 programs will also initialize the counter registers at the beginning of the program, but zeroing the counter now is important to distinguish “program waiting for external start” from “program complete.”
- Parameters:
addr (int) – Counter address
- clocks_locked()
Checks whether the DAC and ADC PLLs are locked. This can only be run after the bitstream has been downloaded. A failure usually means the FPGA is not getting a good reference clock from the on-board clock chips.
- Returns:
clock status
- Return type:
- config_avg(ch, address=0, length=1, edge_counting=False, high_threshold=1000, low_threshold=0)
Configure accumulated buffer; must then enable using enable_buf()
- config_buf(ch, address=0, length=1)
Configure decimated buffer; must then enable using enable_buf()
- config_clocks(force_init_clks, clk_output, external_clk)
Configure PLLs if requested, or if any ADC/DAC is not locked. The ADC/DAC PLL lock status is read through the RFDC IP, so this assumes that the bitstream has already been downloaded. The reference clock frequency must already have been read from the firmware config.
- config_mux_gen(ch, tones)
Set up a list of tones all at once, using raw (integer) units. If the supplied list of tones is shorter than the number supported, the extra tones will have their gains set to 0.
- config_mux_readout(pfbpath, cfgs, sel=None)
Set up a list of readout frequencies all at once, using raw (integer) units.
- configure_readout(ch, ro_regs)
Configure readout channel output style and frequency. This method is only for use with PYNQ-configured readouts.
- cycles2us(cycles, gen_ch=None, ro_ch=None)
Converts clock cycles to microseconds. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- deg2int(deg, thisch)
Converts phase in degrees to integer value suitable for writing to a register. This method works for both generators and readouts.
- deg2reg(deg, gen_ch=0, ro_ch=None)
Converts degrees into phase register values; numbers greater than 360 will effectively be wrapped.
- description()
Generate a printable description of the QICK configuration.
- Returns:
description
- Return type:
- dump_cfg(gen_file_path=None)
Generate a JSON description of the QICK configuration. You can save this string to a file and load it to recreate the QickConfig.
- enable_buf(ch, enable_avg=True, enable_buf=True)
Enable capture of accumulated and/or decimated data for a buffer
- freeze_adc_cals(blocknames)
Freeze the calibrations (stop the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- freq2int(f, thisch, otherch=None)
Converts frequency in MHz to integer value suitable for writing to a register. This method works for both generators and readouts. If a gen will be connected to an RO, the two channels must have exactly the same frequency, and you must supply the config for the other channel.
- freq2reg(f, gen_ch=0, ro_ch=None)
Converts frequency in MHz to tProc generator register value.
- freq2reg_adc(f, ro_ch=0, gen_ch=None)
Converts frequency in MHz to readout register value.
- get_accumulated(ch, address=0, length=None)
Acquires data from the readout accumulated buffer
- get_adc_attenuator(blockname)
Read the RFSoC ADC’s built-in step attenuator.
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- get_cfg()
Return the QICK configuration dictionary. This contains everything you need to recreate the QickConfig.
- Returns:
configuration dictionary
- Return type:
- get_ddr4(nt, start=None)
Get data from the DDR4 buffer. The first samples (typically 401 or 801) of the buffer are always stale data from the previous acquisition.
- Parameters:
nt (int) – Number of data transfers (each transfer is 128 or 256 decimated samples) to retrieve. If start=None, the amount of data will be reduced (see below).
start (int) – Number of samples to skip at the beginning of the buffer. If a value is specified, the end address of the transfer window will also be incremented. If None, the junk at the start of the buffer will be skipped but the end address will not be incremented. This reduces the amount of data, giving you exactly the block of valid data from a DDR4 trigger with the same value of nt.
- get_decimated(ch, address=0, length=None)
Acquires data from the readout decimated buffer
- Parameters:
- Returns:
List of I and Q decimated arrays
- Return type:
- get_maxv(gen_ch)
Convenience method for looking up a generator’s maximum allowed envelope value. The absolute value of the idata/qdata should not exceed this. Typically you will want to normalize your envelope’s maximum range to this value.
- get_mr(start=None)
Get data from the multi-rate buffer. The first 8 samples are always stale data from the previous acquisition. The transfer window always extends to the end of the buffer.
- Parameters:
start (int) – Number of samples to skip at the beginning of the buffer. If None, the junk at the start of the buffer is skipped.
- get_sample_rates()
Produce dictionaries of the current sample rates of the DAC and ADC tiles. A dictionary of this form can be used to configure the sample rates at SoC initialization.
- get_tproc_counter(addr)
Read the tProc shot counter. For tProc V1, this accesses the data memory at the given address. For tProc V2, this accesses one of the two special AXI-readable registers.
- int2deg(r, thisch)
Converts register value to degrees. This method works for both generators and readouts.
- int2freq(r, thisch)
Converts register value to MHz. This method works for both generators and readouts.
- load_bin_program(binprog, load_mem=True)
Write the program to the tProc program memory.
- Parameters:
binprog (numpy.ndarray or dict) – compiled program (format depends on tProc version)
load_mem (bool) – write waveform and data memory now (can do this later with reload_mem())
- load_envelope(ch, data, addr)
Load envelope data into a signal generator.
- Parameters:
ch (int) – Generator channel to configure
data (numpy.ndarray of int16) – Array of (I, Q) values for pulse envelope
addr (int) – Starting address
- load_mem(data, mem_sel='dmem', addr=0)
Write a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
data (numpy.ndarray of int) – Data to be loaded 32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
mem_sel (str) – “pmem”, “dmem”, “wmem”
addr (int) – Starting write address
- load_weights(ch, data, addr=0)
Load weights array to a weighted buffer.
- Parameters:
ch (int) – Readout channel to configure
data (numpy.ndarray of int16) – array of 16-bit (I, Q) values for weights
address (int) – starting address
- map_signal_paths(no_tproc)
Make lists of signal generator, readout, and buffer blocks in the firmware. Also map the switches connecting the generators and buffers to DMA. Fill the config dictionary with parameters of the DAC and ADC channels.
- pl_reset(reinit=True)
Reset all firmware IP blocks. This pulses the pl_resetn0 line from the PS (also known as the “fabric reset” or the “PS-PL reset”). Every firmware block’s reset logic is triggered by this pulse. The main visible effect of this reset is to reset the start times of all the phase-coherent DDS oscillators.
Some firmware blocks have startup code in their __initialize__() to configure the block after the firmware is loaded. That configuration gets wiped out by a PL reset, so this method also re-configures those blocks.
More info on the PL reset: The reset sequence is defined in psu_ps_pl_reset_config_data() in psu_init.c. You can find this in the BSP or the firmware project files. The reset sequence and the memory addresses invovled appear to be the same for all RFSoCs.
https://support.xilinx.com/s/article/68962 https://support.xilinx.com/s/question/0D52E00006lLhBnSAK/zynq-ultrascale-howto-reset-the-pl https://docs.amd.com/r/en-US/ug1137-zynq-ultrascale-mpsoc-swdev/GPIO-Reset-to-PL https://docs.amd.com/r/en-US/pg201-zynq-ultrascale-plus-processing-system/Fabric-Reset-Enable
- Parameters:
reinit (bool) – Reinitialize firmware blocks. False is OK if you haven’t run map_signal_paths() yet (which triggers block initialization).
- poll_data(totaltime=0.1, timeout=None)
Get as much data as possible from the streamer data queue. Stop when any of the following conditions are met: * all the data has been transferred (based on the total_count) * we got data, and it has been totaltime seconds since poll_data was called * timeout is defined, and the timeout expired without getting new data in the queue If there are errors in the error queue, raise the first one.
- prepare_round()
This runs before a program starts running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- read_mem(length, mem_sel='dmem', addr=0)
Read a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
- Returns:
32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
- Return type:
- reg2deg(r, gen_ch=0, ro_ch=None)
Converts phase register values into degrees.
- reg2freq(r, gen_ch=0)
Converts frequency from format readable by generator to MHz.
- reg2freq_adc(r, ro_ch=0)
Converts frequency from format readable by readout to MHz.
- reload_mem()
Reload the waveform and data memory, overwriting any changes made by running the program.
- reset_gens()
Reset the tProc and run a minimal tProc program that drives all signal generators with 0’s. Useful for stopping any periodic or stdysel=”last” outputs that may have been driven by a previous program.
- rfb_config(no_tproc)
Configure the SPI interfaces to the RF board.
- rfb_get_bias(bias_ch)
Read the voltage setpoint on an RF-board bias output.
- rfb_set_adc_dc(adc_port, gain)
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_adc_rf(adc_port, att)
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- rfb_set_bias(bias_ch, v)
Set a voltage on an RF-board bias output.
- rfb_set_dac_dc(dac_port)
Enable and configure a QICK box or RF board DAC port for DC output.
- Parameters:
dac_port (int) – QICK box or RF board DAC port number (0-15 for ZCU216, 0-7 for ZCU111)
- rfb_set_dac_rf(dac_port, att1, att2)
Enable and configure a QICK box or RF board DAC port for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_gen_dc(gen_ch)
Enable and configure an RF-board output channel for DC output.
- Parameters:
gen_ch (int) – DAC channel (index in ‘gens’ list)
- rfb_set_gen_rf(gen_ch, att1, att2)
Enable and configure an RF-board output channel for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_ro_dc(ro_ch, gain)
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_ro_rf(ro_ch, att)
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- round_sample_rate(tiletype, tile, fs_target)
Return the closest achievable sample rate to the requested value. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- roundfreq(f, dicts)
Round a frequency to the LCM of the frequency steps of one or more channels (typically two, a generator and a readout).
- Parameters:
f (float or numpy.ndarray) – frequency (MHz)
- Returns:
rounded frequency (MHz)
- Return type:
- set_adc_attenuator(blockname, attenuation)
Set the RFSoC ADC’s built-in step attenuator. The requested value will be rounded to the nearest valid value (0-27 dB inclusive, 1 dB steps).
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- Parameters:
- Returns:
The rounded attenuation value that was actually set (dB)
- Return type:
- set_all_clks(clk_output, external_clk)
Resets all the board clocks
- set_iq(ch, f, i, q, ro_ch=None, phase_reset=True)
Set frequency, I, and Q for a constant-IQ output.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – frequency (in MHz)
i (float) – I value (in range -1 to 1)
q (float) – Q value (in range -1 to 1)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
- set_mixer_freq(ch, f, ro_ch=None, phase_reset=True, fullscale=False)
Set mixer frequency for a signal generator. If the generator does not have a mixer, you will get an error.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – Mixer frequency (in MHz)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want mixer freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
fullscale (bool) – use the full DAC output range, disabling the mixer’s default 0.7 scale factor (see https://docs.amd.com/r/en-US/pg269-rf-data-converter/RF-DAC-Numerical-Controlled-Oscillator-and-Mixer, https://docs.amd.com/r/en-US/pg269-rf-data-converter/struct-XRFdc_Mixer_Settings)
- set_nyquist(ch, nqz, force=False)
Sets DAC channel ch to operate in Nyquist zone nqz mode.
- start_readout(total_shots, counter_addr=1, ch_list=None, reads_per_shot=1, stride=None)
Start a streaming readout of the accumulated buffers.
- start_src(src)
Sets the start source of tProc
- Parameters:
src (str) – start source “internal” or “external”
- start_tproc()
Start the tProc.
If the tProc is configured for external start, this does nothing (the tProc will start on the first start signal it sees after external start is enabled).
- stop_tproc(lazy=False)
Stop the tProc. This is somewhat slow (tens of ms) for tProc v1.
- Parameters:
lazy (bool) – Only stop the tProc if it’s easy (i.e. do nothing for v1)
- property streamer
- property tproc
- tt_arm(blk)
Start data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_config(blk, threshold, wr_smp=32, filt=False, slope=False, invert=False, interp=0, deadtime=5)
Configure the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to flush (index in time_taggers list).
threshold (int) – Tag threshold (-2^15 through 2^15-1).
wr_smp (int) – Number of 8-sample chunks to capture per tag in the SMP memory (1 through 32). If this time tagger has no SMP memory, this is ignored.
filt (bool) – Trigger on signal after a 2-sample smoothing filter.
slope (bool) – Trigger on slope (difference between consecutive samples), not level.
invert (bool) – Trigger on inverted signal.
interp (int) – Number of bits for interpolation (0 through 7).
deadtime (int) – Minimum time (in fabric ticks, 8 samples) between one tag and the next (5 through 255). This should be larger than the expected pulse width, otherwise you will get double-triggering on the same pulse.
- tt_disarm(blk)
Stop data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_readmem(blk, mem)
Read one of the specified time-tagger block’s memories. Reading a time-tagger memory clears it.
- tt_reset(blk)
Reset and flush the memories of the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to reset (index in time_taggers list).
- unfreeze_adc_cals(blocknames)
Unfreeze the calibrations (resume the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- us2cycles(us, gen_ch=None, ro_ch=None, as_float=False)
Converts microseconds to integer number of clock cycles. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- valid_sample_rates(tiletype, tile)
Return an array of valid sample rates. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- Parameters:
- Returns:
Array of sample rates, in Msps
- Return type:
- qick.rfboard.RFQickSocV2
alias of
RFQickSoc111V2
- class qick.rfboard.RFQickSoc216V1(*args: Any, **kwargs: Any)[source]
Bases:
RFQickSoc- HAS_LO = False
- __init__(bitfile, **kwargs)[source]
A bitfile must always be provided, since the default bitstream will not work with the RF board.
The ZCU111 RF board takes its LO reference from the ZCU111 clock output. So if clk_output is None, the clocks will be re-initialized every time. This ensures that the LO output to the RF board is enabled.
- rfb_enable_bias()[source]
Enable all eight main-board bias outputs (by turning on DAC_BIAS_SWEN).
This is normally run during board initialization, so you should not need to run it yourself.
- rfb_disable_bias()[source]
Disable all eight main-board bias outputs (by turning off DAC_BIAS_SWEN).
- rfb_set_gen_filter(gen_ch, fc, bw=1, ftype='bandpass')[source]
Set the programmable analog filter of the QICK box DAC port connected to a specified generator.
- rfb_set_ro_filter(ro_ch, fc, bw=1, ftype='bandpass')[source]
Set the programmable analog filter of the QICK box ADC port connected to a specified readout channel.
- rfb_set_dac_filter(dac_port, fc, bw=1, ftype='bandpass')[source]
Set the programmable analog filter of the specified QICK box DAC port.
- rfb_set_adc_filter(adc_port, fc, bw=1, ftype='bandpass')[source]
Set the programmable analog filter of the specified QICK box ADC port.
- rfb_set_dac_filter_raw(dac_port, hpf=-1, lpf=-1)[source]
Set the programmable analog filter of the specified QICK box DAC port. Filter cutoffs are specified in terms of filter steps.
- rfb_set_adc_filter_raw(adc_port, hpf=-1, lpf=-1)[source]
Set the programmable analog filter of the specified QICK box ADC port. Filter cutoffs are specified in terms of filter steps.
- rfb_set_rfadc_attenuator(adc_port, att)[source]
Set the programmable attenuator of the RFSoC RF-ADC connected to the specified QICK box ADC port.
- clear_interrupts(max_attempts=5, error_on_interrupt=False, error_on_persist=True)[source]
Check all ADCs for interrupts, and attempt to clear them.
https://docs.amd.com/r/en-US/pg269-rf-data-converter/XRFdc_IntrEnable https://docs.amd.com/r/en-US/pg269-rf-data-converter/Interrupt-Handling https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/rfdc/src/xrfdc_hw.h
- Parameters:
- Returns:
True if all interrupts were successfully cleared
- Return type:
- adcfreq(f, gen_ch=0, ro_ch=0)
Takes a frequency and trims it to the closest DDS frequency valid for both channels.
- arm_ddr4(ch, nt, force_overwrite=False)
Prepare the DDR4 buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record the specified amount of data. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
nt (int) – Number of data transfers to record; the number of IQ samples/transfer (128 or 256) is printed in the QickSoc config. Note that the amount of useful data is less (see
get_ddr4)force_overwrite (bool) – Allow a DDR4 acqusition that exceeds the DDR4 memory capacity. The memory will be used as a circular buffer: later transfers will wrap around to the beginning of the memory and overwrite older data.
- arm_mr(ch)
Prepare the Multi-Rate buffer to take data. This must be called before starting a program that triggers the buffer. Once the buffer is armed, the first trigger it receives will cause the buffer to record until the buffer is filled. Later triggers will have no effect.
- Parameters:
ch (int) – The readout channel to record (index in ‘readouts’ list).
- calc_fstep(dicts)
Finds the least common multiple of the frequency steps of one or more channels (typically two, a generator and a readout) For proper frequency matching, you should only use frequencies that are evenly divisible by this value. The order of the parameters does not matter.
- calc_fstep_int(dict1, other_dicts)
Finds the multiplier that needs to be applied to a channel’s frequency step size to allow this channel to be frequency-matched with another channel.
- calc_mixer_freq(gen_ch, mixer_freq, nqz, ro_ch)
Set the NCO frequency that will be mixed with the generator output.
The RFdc driver does its own math to convert a frequency to a register value. (see XRFdc_SetMixerSettings in xrfdc_mixer.c, and “NCO Frequency Conversion” in PG269) This is what it does: 1. Add/subtract fs to get the frequency in the range of [-fs/2, fs/2]. 2. If the original frequency was not in [-fs/2, fs/2] and the DAC is configured for 2nd Nyquist zone, multiply by -1. 3. Convert to a 48-bit register value, rounding using C integer casting (i.e. round towards 0).
Step 2 is not desirable for us, so we must undo it.
The rounding gives unexpected results sometimes: it’s hard to tell if a freq will get rounded up or down. This is important if the demanded frequency was rounded to a valid frequency for frequency matching. The safest way to get consistent behavior is to always round to a valid NCO frequency. We are trusting that the floating-point math is exact and a number we rounded here is still a round number in the RFdc driver.
- calc_muxgen_regs(gen_ch, freqs, gains, phases, ro_ch, absolute_freqs, mixer_freq)
Calculate the register values to program into a multiplexed generator. mixer_freq will have been rounded appropriately in declare_gen, and will be 0 if there’s no mixer
- calc_ro_freq(rocfg, ro_pars, ro_regs, absolute_freqs, mixer_freq, flip_freq=False)
Calculate the readout frequency and registers.
- calc_ro_regs(rocfg, phase, sel, ch=None)
Calculate the settings to configure a readout.
- Returns:
settings for QickSoc.config_readout()
- Return type:
- ch_fstep(dict1)
Finds the frequency step size of a single channel (generator or readout).
- check_pfb_collisions(rocfg, cfg1, cfgs)
Check whether the specified PFB config collides or interefers with any others. If this PFB block can’t put two readouts on the same channel, this method will raise an error on collisions. Possible crosstalk will be identified in warnings.
- clear_ddr4(length=None)
Clear the DDR4 buffer, filling it with 0’s. This is not necessary (the buffer will overwrite old data), but may be useful for debugging. Clearing the full buffer (4 GB) typically takes 4-5 seconds.
- Parameters:
length (int) – Number of samples to clear (starting at the beginning of the buffer). If None, clear the entire buffer.
- clear_tproc_counter(addr)
Initialize the tProc shot counter. For tProc v1, the data memory at the specified address is zeroed. For tProc v2, the tProc is reset, which zeroes all registers (the address is ignored).
Typical tProc v2 programs will also initialize the counter registers at the beginning of the program, but zeroing the counter now is important to distinguish “program waiting for external start” from “program complete.”
- Parameters:
addr (int) – Counter address
- clocks_locked()
Checks whether the DAC and ADC PLLs are locked. This can only be run after the bitstream has been downloaded. A failure usually means the FPGA is not getting a good reference clock from the on-board clock chips.
- Returns:
clock status
- Return type:
- config_avg(ch, address=0, length=1, edge_counting=False, high_threshold=1000, low_threshold=0)
Configure accumulated buffer; must then enable using enable_buf()
- config_buf(ch, address=0, length=1)
Configure decimated buffer; must then enable using enable_buf()
- config_clocks(force_init_clks, clk_output, external_clk)
Configure PLLs if requested, or if any ADC/DAC is not locked. The ADC/DAC PLL lock status is read through the RFDC IP, so this assumes that the bitstream has already been downloaded. The reference clock frequency must already have been read from the firmware config.
- config_mux_gen(ch, tones)
Set up a list of tones all at once, using raw (integer) units. If the supplied list of tones is shorter than the number supported, the extra tones will have their gains set to 0.
- config_mux_readout(pfbpath, cfgs, sel=None)
Set up a list of readout frequencies all at once, using raw (integer) units.
- configure_readout(ch, ro_regs)
Configure readout channel output style and frequency. This method is only for use with PYNQ-configured readouts.
- cycles2us(cycles, gen_ch=None, ro_ch=None)
Converts clock cycles to microseconds. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- deg2int(deg, thisch)
Converts phase in degrees to integer value suitable for writing to a register. This method works for both generators and readouts.
- deg2reg(deg, gen_ch=0, ro_ch=None)
Converts degrees into phase register values; numbers greater than 360 will effectively be wrapped.
- description()
Generate a printable description of the QICK configuration.
- Returns:
description
- Return type:
- dump_cfg(gen_file_path=None)
Generate a JSON description of the QICK configuration. You can save this string to a file and load it to recreate the QickConfig.
- enable_buf(ch, enable_avg=True, enable_buf=True)
Enable capture of accumulated and/or decimated data for a buffer
- freeze_adc_cals(blocknames)
Freeze the calibrations (stop the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- freq2int(f, thisch, otherch=None)
Converts frequency in MHz to integer value suitable for writing to a register. This method works for both generators and readouts. If a gen will be connected to an RO, the two channels must have exactly the same frequency, and you must supply the config for the other channel.
- freq2reg(f, gen_ch=0, ro_ch=None)
Converts frequency in MHz to tProc generator register value.
- freq2reg_adc(f, ro_ch=0, gen_ch=None)
Converts frequency in MHz to readout register value.
- get_accumulated(ch, address=0, length=None)
Acquires data from the readout accumulated buffer
- get_adc_attenuator(blockname)
Read the RFSoC ADC’s built-in step attenuator.
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- get_cfg()
Return the QICK configuration dictionary. This contains everything you need to recreate the QickConfig.
- Returns:
configuration dictionary
- Return type:
- get_ddr4(nt, start=None)
Get data from the DDR4 buffer. The first samples (typically 401 or 801) of the buffer are always stale data from the previous acquisition.
- Parameters:
nt (int) – Number of data transfers (each transfer is 128 or 256 decimated samples) to retrieve. If start=None, the amount of data will be reduced (see below).
start (int) – Number of samples to skip at the beginning of the buffer. If a value is specified, the end address of the transfer window will also be incremented. If None, the junk at the start of the buffer will be skipped but the end address will not be incremented. This reduces the amount of data, giving you exactly the block of valid data from a DDR4 trigger with the same value of nt.
- get_decimated(ch, address=0, length=None)
Acquires data from the readout decimated buffer
- Parameters:
- Returns:
List of I and Q decimated arrays
- Return type:
- get_maxv(gen_ch)
Convenience method for looking up a generator’s maximum allowed envelope value. The absolute value of the idata/qdata should not exceed this. Typically you will want to normalize your envelope’s maximum range to this value.
- get_mr(start=None)
Get data from the multi-rate buffer. The first 8 samples are always stale data from the previous acquisition. The transfer window always extends to the end of the buffer.
- Parameters:
start (int) – Number of samples to skip at the beginning of the buffer. If None, the junk at the start of the buffer is skipped.
- get_sample_rates()
Produce dictionaries of the current sample rates of the DAC and ADC tiles. A dictionary of this form can be used to configure the sample rates at SoC initialization.
- get_tproc_counter(addr)
Read the tProc shot counter. For tProc V1, this accesses the data memory at the given address. For tProc V2, this accesses one of the two special AXI-readable registers.
- int2deg(r, thisch)
Converts register value to degrees. This method works for both generators and readouts.
- int2freq(r, thisch)
Converts register value to MHz. This method works for both generators and readouts.
- load_bin_program(binprog, load_mem=True)
Write the program to the tProc program memory.
- Parameters:
binprog (numpy.ndarray or dict) – compiled program (format depends on tProc version)
load_mem (bool) – write waveform and data memory now (can do this later with reload_mem())
- load_envelope(ch, data, addr)
Load envelope data into a signal generator.
- Parameters:
ch (int) – Generator channel to configure
data (numpy.ndarray of int16) – Array of (I, Q) values for pulse envelope
addr (int) – Starting address
- load_mem(data, mem_sel='dmem', addr=0)
Write a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
data (numpy.ndarray of int) – Data to be loaded 32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
mem_sel (str) – “pmem”, “dmem”, “wmem”
addr (int) – Starting write address
- load_weights(ch, data, addr=0)
Load weights array to a weighted buffer.
- Parameters:
ch (int) – Readout channel to configure
data (numpy.ndarray of int16) – array of 16-bit (I, Q) values for weights
address (int) – starting address
- map_signal_paths(no_tproc)
Make lists of signal generator, readout, and buffer blocks in the firmware. Also map the switches connecting the generators and buffers to DMA. Fill the config dictionary with parameters of the DAC and ADC channels.
- pl_reset(reinit=True)
Reset all firmware IP blocks. This pulses the pl_resetn0 line from the PS (also known as the “fabric reset” or the “PS-PL reset”). Every firmware block’s reset logic is triggered by this pulse. The main visible effect of this reset is to reset the start times of all the phase-coherent DDS oscillators.
Some firmware blocks have startup code in their __initialize__() to configure the block after the firmware is loaded. That configuration gets wiped out by a PL reset, so this method also re-configures those blocks.
More info on the PL reset: The reset sequence is defined in psu_ps_pl_reset_config_data() in psu_init.c. You can find this in the BSP or the firmware project files. The reset sequence and the memory addresses invovled appear to be the same for all RFSoCs.
https://support.xilinx.com/s/article/68962 https://support.xilinx.com/s/question/0D52E00006lLhBnSAK/zynq-ultrascale-howto-reset-the-pl https://docs.amd.com/r/en-US/ug1137-zynq-ultrascale-mpsoc-swdev/GPIO-Reset-to-PL https://docs.amd.com/r/en-US/pg201-zynq-ultrascale-plus-processing-system/Fabric-Reset-Enable
- Parameters:
reinit (bool) – Reinitialize firmware blocks. False is OK if you haven’t run map_signal_paths() yet (which triggers block initialization).
- poll_data(totaltime=0.1, timeout=None)
Get as much data as possible from the streamer data queue. Stop when any of the following conditions are met: * all the data has been transferred (based on the total_count) * we got data, and it has been totaltime seconds since poll_data was called * timeout is defined, and the timeout expired without getting new data in the queue If there are errors in the error queue, raise the first one.
- prepare_round()[source]
This runs before a program starts running. This is called by acquire/acquire_decimated/run_rounds; user code should not call it.
By default this does nothing, but a subclass of QickSoc may override this.
- read_mem(length, mem_sel='dmem', addr=0)
Read a block of the selected tProc memory. For tProc v1 only the data memory (“dmem”) is valid. For tProc v2 the program, data, and waveform memory are all accessible.
- Parameters:
- Returns:
32-bit array of shape (n, 8) for pmem and wmem, (n) for dmem
- Return type:
- reg2deg(r, gen_ch=0, ro_ch=None)
Converts phase register values into degrees.
- reg2freq(r, gen_ch=0)
Converts frequency from format readable by generator to MHz.
- reg2freq_adc(r, ro_ch=0)
Converts frequency from format readable by readout to MHz.
- reload_mem()
Reload the waveform and data memory, overwriting any changes made by running the program.
- reset_gens()
Reset the tProc and run a minimal tProc program that drives all signal generators with 0’s. Useful for stopping any periodic or stdysel=”last” outputs that may have been driven by a previous program.
- rfb_get_bias(bias_ch)
Read the voltage setpoint on an RF-board bias output.
- rfb_set_adc_dc(adc_port, gain)
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_adc_rf(adc_port, att)
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- rfb_set_bias(bias_ch, v)
Set a voltage on an RF-board bias output.
- rfb_set_dac_dc(dac_port)
Enable and configure a QICK box or RF board DAC port for DC output.
- Parameters:
dac_port (int) – QICK box or RF board DAC port number (0-15 for ZCU216, 0-7 for ZCU111)
- rfb_set_dac_rf(dac_port, att1, att2)
Enable and configure a QICK box or RF board DAC port for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_gen_dc(gen_ch)
Enable and configure an RF-board output channel for DC output.
- Parameters:
gen_ch (int) – DAC channel (index in ‘gens’ list)
- rfb_set_gen_rf(gen_ch, att1, att2)
Enable and configure an RF-board output channel for RF output.
- Parameters:
- Returns:
float – actual (rounded) att1 value that was set
float – actual (rounded) att2 value that was set
- rfb_set_ro_dc(ro_ch, gain)
Enable and configure an RF-board DC input channel. Will fail if this is not a DC input.
- rfb_set_ro_rf(ro_ch, att)
Enable and configure an RF-board RF input channel. Will fail if this is not an RF input.
- round_sample_rate(tiletype, tile, fs_target)
Return the closest achievable sample rate to the requested value. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- roundfreq(f, dicts)
Round a frequency to the LCM of the frequency steps of one or more channels (typically two, a generator and a readout).
- Parameters:
f (float or numpy.ndarray) – frequency (MHz)
- Returns:
rounded frequency (MHz)
- Return type:
- set_adc_attenuator(blockname, attenuation)
Set the RFSoC ADC’s built-in step attenuator. The requested value will be rounded to the nearest valid value (0-27 dB inclusive, 1 dB steps).
Only available for RFSoC Gen 3 (ZCU216, RFSoC4x2, RFSoC2x4). See https://docs.amd.com/r/en-US/pg269-rf-data-converter/Digital-Step-Attenuator-Gen-3/DFE.
- Parameters:
- Returns:
The rounded attenuation value that was actually set (dB)
- Return type:
- set_all_clks(clk_output, external_clk)
Resets all the board clocks
- set_iq(ch, f, i, q, ro_ch=None, phase_reset=True)
Set frequency, I, and Q for a constant-IQ output.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – frequency (in MHz)
i (float) – I value (in range -1 to 1)
q (float) – Q value (in range -1 to 1)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
- set_mixer_freq(ch, f, ro_ch=None, phase_reset=True, fullscale=False)
Set mixer frequency for a signal generator. If the generator does not have a mixer, you will get an error.
- Parameters:
ch (int) – DAC channel (index in ‘gens’ list)
f (float) – Mixer frequency (in MHz)
ro_ch (int) – readout channel (index in ‘readouts’ list) for frequency matching use None if you don’t want mixer freq to be rounded to a valid readout frequency
phase_reset (bool) – if this changes the frequency, also reset the phase (so if we go to freq=0, we end up on the real axis)
fullscale (bool) – use the full DAC output range, disabling the mixer’s default 0.7 scale factor (see https://docs.amd.com/r/en-US/pg269-rf-data-converter/RF-DAC-Numerical-Controlled-Oscillator-and-Mixer, https://docs.amd.com/r/en-US/pg269-rf-data-converter/struct-XRFdc_Mixer_Settings)
- set_nyquist(ch, nqz, force=False)
Sets DAC channel ch to operate in Nyquist zone nqz mode.
- start_readout(total_shots, counter_addr=1, ch_list=None, reads_per_shot=1, stride=None)
Start a streaming readout of the accumulated buffers.
- start_src(src)
Sets the start source of tProc
- Parameters:
src (str) – start source “internal” or “external”
- start_tproc()
Start the tProc.
If the tProc is configured for external start, this does nothing (the tProc will start on the first start signal it sees after external start is enabled).
- stop_tproc(lazy=False)
Stop the tProc. This is somewhat slow (tens of ms) for tProc v1.
- Parameters:
lazy (bool) – Only stop the tProc if it’s easy (i.e. do nothing for v1)
- property streamer
- property tproc
- tt_arm(blk)
Start data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_config(blk, threshold, wr_smp=32, filt=False, slope=False, invert=False, interp=0, deadtime=5)
Configure the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to flush (index in time_taggers list).
threshold (int) – Tag threshold (-2^15 through 2^15-1).
wr_smp (int) – Number of 8-sample chunks to capture per tag in the SMP memory (1 through 32). If this time tagger has no SMP memory, this is ignored.
filt (bool) – Trigger on signal after a 2-sample smoothing filter.
slope (bool) – Trigger on slope (difference between consecutive samples), not level.
invert (bool) – Trigger on inverted signal.
interp (int) – Number of bits for interpolation (0 through 7).
deadtime (int) – Minimum time (in fabric ticks, 8 samples) between one tag and the next (5 through 255). This should be larger than the expected pulse width, otherwise you will get double-triggering on the same pulse.
- tt_disarm(blk)
Stop data capture on the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to arm (index in time_taggers list).
- tt_readmem(blk, mem)
Read one of the specified time-tagger block’s memories. Reading a time-tagger memory clears it.
- tt_reset(blk)
Reset and flush the memories of the specified time-tagger block.
- Parameters:
blk (int) – The time tagger block to reset (index in time_taggers list).
- unfreeze_adc_cals(blocknames)
Unfreeze the calibrations (resume the background calibration) of a list of RFSoC ADCs.
See the Xilinx documentation:
https://docs.amd.com/r/en-US/pg269-rf-data-converter/Background-Calibration-Process
- us2cycles(us, gen_ch=None, ro_ch=None, as_float=False)
Converts microseconds to integer number of clock cycles. Uses tProc clock frequency by default. If gen_ch or ro_ch is specified, uses that generator/readout channel’s fabric clock.
- valid_sample_rates(tiletype, tile)
Return an array of valid sample rates. This does not account for dependencies due to clock groups, or the restriction that you’re not allowed to raise the sample rate.
- Parameters:
- Returns:
Array of sample rates, in Msps
- Return type: