DiCarloLab-Delft / PycQED_py3

Python3 version of PycQED using QCoDeS as backend
MIT License
67 stars 40 forks source link

CC driver functions checking DIO calibration are broken #702

Closed wvlothuizen closed 2 years ago

wvlothuizen commented 2 years ago

During debugging by ZI, it appeared that the following functions in CCCore.py are broken:

They ignore the ccio parameter, and when that's fixed, give erroneous results. The previous method of using debug_get_ccio_reg() does seem to work correctly (but the register indices may change with firmware versions)

wvlothuizen commented 2 years ago

Apart from the driver fixes referred to above, the CC doesn't return the 'boolean' success in get_calibrate_dio_success(), but instead returns a status word consisting of the following flags (taken from CCCore.py):

    # stat_ques_diocal : DIO timing calibration status (CCIO only)
    SQD_NO_SIGNAL               = 0x0001
    SQD_INSUF_TIMING_MARGIN     = 0x0002
    SQD_BITS_INACTIVE           = 0x0004
    SQD_NOT_CALIBRATED          = 0x0008
    SQD_TIMING_ERROR            = 0x0010

    _cc_stat_ques_diocal_lookup = [
        (SQD_NO_SIGNAL, "No signal detected during DIO timing calibration"),
        (SQD_INSUF_TIMING_MARGIN, "Insufficient timing margin during DIO timing calibration"),
        (SQD_BITS_INACTIVE, "Required bits were inactive during DIO timing calibration"),
        (SQD_NOT_CALIBRATED, "DIO timing calibration not yet performed (successfully)"),
        (SQD_TIMING_ERROR, "Runtime DIO timing violation found")
    ]

This is the same result as provided by get_status_questionable_instrument_idetail_diocal(), which is meant to return the flags.

@martinr-zi