hardware module

Hardware configuration common to all modes of operation.

Detailed information is provided in the documentation for each class:

Hardware

Interface to the Vivace/Presto hardware.

AdcMode

Configuration for analog-to-digital converters (ADC), i.e. input channels.

DacMode

Configuration for digital-to-analog converters (DAC), i.e. output channels.

AdcFSample

Sampling rate setting for analog-to-digital converters (ADC), i.e. input channels.

DacFSample

Sampling rate setting for digital-to-analog converters (DAC), i.e. output channels.


Advanced tile configuration

It is possible to specify different converter modes and converter rates on groups (tiles) of different input/output ports, depending on the available hardware. The tiles configurations are as follows:

Tile

8-channels Vivace

8-channel Presto

16-channel Presto

ADC0

input ports 1-2

input ports 1-2

input ports 1-4

ADC1

input ports 3-4

input ports 3-4

input ports 5-8

ADC2

input ports 5-6

input ports 5-6

input ports 9-12

ADC3

input ports 7-8

input ports 7-8

input ports 13-16

DAC0

output ports 1-4

output ports 1-2

output ports 1-4

DAC1

output ports 5-8

output ports 3-4

output ports 5-8

DAC2

output ports 5-6

output ports 9-12

DAC3

output ports 7-8

output ports 13-16

For example, on an 8-channel Presto hardware setting the parameters:
adc_mode=AdcMode.Direct
adc_fsample=[AdcFSample.G4, AdcFSample.G2, AdcFSample.G2, AdcFSample.G2]
dac_mode=[DacMode.Mixed42, DacMode.Mixed42, DacMode.Mixed02, DacMode.Mixed02]
dac_fsample=DacFSample.G6
will configure:
all the input ports in direct mode;
input ports 1-2 to sample at 4 GS/s and ports 3-8 at 2 GS/s;
output ports 1-4 to use the Mixed42 mode and ports 5-8 the Mixed02 mode;
all output ports to synthesize at 6 GS/s.

Hardware class

class presto.hardware.Hardware(address=None, port=None, dry_run=False)

Interface to the Vivace/Presto hardware.

This class does not need to be instantiated by the user. It is available as the hardware attribute of instances of Lockin, Pulsed and Test classes.

Examples

Configure digital IQ mixers:

>>> from presto.hardware import AdcMode, DacMode
>>> from presto import lockin
>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=[1, 2],
>>>     )
assert_errors()

Print errors from the hardware and raise an exception if there were any.

Raises

RuntimeError

blank_output(ports, state)

Disable the output port(s). Has no effect on the DC bias.

The new setting is applied immediately.

Parameters
  • ports (int or list of int) – Output ports to enable/disable

  • state (bool) – When True, disable the RF output.

close()

Close the connection to the hardware

This method is called automatically upon exit from a with block

configure_mixer(freq, *, in_ports=None, out_ports=None, in_zone=None, out_zone=None, in_phase=0.0, out_phase=0.0, sync=True)

Configure the NCO for the digital IQ mixers.

Parameters
  • freq (float) – frequency of the numerically-controlled oscillator (NCO) in Hz

  • in_ports (int or list of int) – configure downconversion for ports in in_ports

  • out_ports (int or list of int) – configure upconversion for ports in out_ports

  • in_zone (int, optional) – optimize downconversion mixer for operation in the in_zoneth Nyquist band. If None (default), choose appropriate zone automatically

  • out_zone (int, optional) – optimize upconversion mixer for operation in the out_zoneth Nyquist band. If None (default), choose appropriate zone automatically

  • in_phase (float, optional) – phase of the numerically-controlled oscillator (NCO) in radians for each input port

  • out_phase (float, optional) – phase of the numerically-controlled oscillator (NCO) in radians for each output port

  • sync (bool, optional) – if True (default), issue a sync() event to align the phase of the NCO for in_ports and out_ports. When using multiple calls to configure different NCO frequencies on different ports, set sync=True only on the last call to ensure that all NCO phases align. See Examples section.

Examples

>>> from presto.hardware import AdcMode, DacMode
>>> from presto import lockin
>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=1,
>>>         sync=False,  # sync on last call...
>>>     )
>>>     lck.hardware.configure_mixer(
>>>         freq=3.6e+9,  # 3.6 GHz
>>>         out_ports=2,
>>>         sync=False,  # ...not yet...
>>>     )
>>>     lck.hardware.configure_mixer(
>>>         freq=3.7e+9,  # 3.7 GHz
>>>         out_ports=3,
>>>         sync=True,  # <-- ...here!
>>>     )
get_errors()

Get error messages, if any, from the hardware.

Returns

Return type

list of str

print_errors()

Print error messages, if any, from the hardware.

Returns

whether there were any errors

Return type

bool

restore_cal_coeff()

Restore previously saved coefficients for the background calibration of the input ports (ADC)

save_cal_coeff()

Save the current coefficients for the background calibration of the input ports (ADC)

set_adc_attenuation(ports, attenuation)

Set the attenuation of the input ports (ADC)

Results in changing the analog range of the input. Only on Presto hardware.

Parameters
  • ports (int or list of int) –

  • attenuation (float) – attenuation in dB, valid values are between 0.0 and 11.0 in steps of 0.5 dB

set_cal_freeze(freeze)

Freeze/unfreeze the background calibration of the input ports (ADC)

Parameters

freeze (bool) – set to True to freeze (stop) the background calibration; set to False to unfreeze

set_dac_current(ports, current_ua)

Set the full-scale current of the output ports (DAC)

Results in changing the analog range of the output.

Parameters
  • ports (int or list of int) –

  • current_ua (int) – full-scale current in μA, see Notes for valid values

Notes

On Vivace hardware, valid values for current_ua are 20_000 (20 mA) and 32_000 (32 mA). On Presto hardware, valid values range from 6_425 (6.425 mA) to 32_000 (32 mA) in steps of 25 (25 μA).

set_dc_bias(bias, port=None)

Set a DC bias on the output ports.

The new setting is applied immediately.

Parameters
  • bias (float) – DC bias with +/- 1.0 being full scale.

  • port (int or array_like, optional) – Output port, if None set DC bias for all ports. Valid ports are in the interval [1, 8].

Raises

ValueError – If bias or port are outside valid range.

set_inv_sinc(ports, mode)

Enable/disable the inverse-sinc FIR filter on the output ports (DAC)

Parameters
  • ports (int or list of int) –

  • mode (int) – which FIR filter to use: 0 disables correction; 1 for operation in 1st Nyquist zone; 2 for operation in 2nd Nyquist zone (only on Presto hardware)

Notes

Using the inverse-sinc correction can improve gain flatness over frequency, but can cause clipping of the output when used at full-scale amplitude. To avoid clipping, it is recommended to not drive above -3.5 dBFS when mode=1, and -1.0 dBFS when mode=2.

set_lmx(freq, pwr)

Configure the clock chip on Presto hardware to use as RF source.

Parameters
  • freq (float) – frequency in Hz between <~ 10 MHz and 15 GHz

  • pwr (int) – power setting in [0, 47]

sleep(secs, wait=True)

Tell the hardware to sleep for secs seconds.

Like time.sleep(), except the sleep is done on the hardware rather than on the local computer.

Parameters
  • secs (float) – duration of sleep in seconds

  • wait (bool, optional) – if False, tell the hardware to sleep without waiting for completion. If True (default), block the calling thread on the local computer until the hardware is done sleeping

sync()

Manually issue a command to synchronize the NCO phases.

Can be used after a call to configure_mixer() with sync=False.

Examples

This code:

>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=1,
>>>         sync=False,  # don't sync here...
>>>     )
>>>     lck.hardware.sync()  # <-- sync here!

is equivalent to this code:

>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=1,
>>>         sync=True,  # <-- sync here!
>>>     )

Converter modes

class presto.hardware.AdcMode(value)

Configuration for analog-to-digital converters (ADC), i.e. input channels

Direct = 0

direct mode, i.e. no digital downconversion

Mixed = 1

IQ mixed mode, i.e. with digital downconversion

class presto.hardware.DacMode(value)

Configuration for digital-to-analog converters (DAC), i.e. output channels

Direct = 0

direct mode, i.e. no digital upconversion

Mixed02 = 1

standard IQ mixed mode, i.e. with digital upconversion. Only valid for sampling rates \(f_\mathrm{S} \le 7 \mathrm{GS/s}\)

Mixed04 = 2

IQ mixed mode with \(f_\mathrm{out} \in [0;f_\mathrm{S}/4] \cup [3f_\mathrm{S}/4;f_\mathrm{S}]\). Only valid on Presto hardware

Mixed42 = 3

IQ mixed mode with \(f_\mathrm{out} \in [f_\mathrm{S}/4; 3f_\mathrm{S}/4]\). Only valid on Presto hardware


Converter rates

class presto.hardware.AdcFSample(value)

Sampling rate setting for analog-to-digital converters (ADC), i.e. input channels

G2 = 0

\(f_\mathrm{S} = 2 \mathrm{GS/s}\)

G3_2 = 1

\(f_\mathrm{S} = 3.2 \mathrm{GS/s}\). Only valid on Vivace hardware

G4 = 2

\(f_\mathrm{S} = 4 \mathrm{GS/s}\). Not valid on 16-channel Presto hardware

class presto.hardware.DacFSample(value)

Sampling rate setting for digital-to-analog converters (DAC), i.e. output channels

G10 = 5

\(f_\mathrm{S} = 10 \mathrm{GS/s}\). Only valid on Presto hardware

G2 = 0

\(f_\mathrm{S} = 2 \mathrm{GS/s}\)

G4 = 1

\(f_\mathrm{S} = 4 \mathrm{GS/s}\)

G6 = 2

\(f_\mathrm{S} = 6 \mathrm{GS/s}\). Only valid on Presto hardware

G6_4 = 3

\(f_\mathrm{S} = 6.4 \mathrm{GS/s}\). Only valid on Vivace hardware

G8 = 4

\(f_\mathrm{S} = 8 \mathrm{GS/s}\). Only valid on Presto hardware