Example #1
0
    def index(self):
        # see if a rollback is needed, the except block
        try:
            d.find_chip(111)
        except:
            d.session.rollback()

        #TODO format this as a Json
        # get all JJ measurements
        meas = d.show_all_JJ_measurements()
        meas[:] = [x.toJson() for x in meas]
        return self.render('JJ_meas_custom.html',
                           meas=meas)  #, test_data=json.dump(meas[-4:]))
Example #2
0
def device_detail():

    # comes from the hidden forms on html for custom JJ page
    chip_name = str(request.form.get('chip_name'))
    dev_name = str(request.form.get('dev_name'))
    dir_name = str(request.form.get('dir_name'))

    # find objects
    chip = d.find_chip(chip_name)
    dev = [d.find_device(dev_name, chip.design_id)]

    # get data from files
    ic_data = wpg.get_rawdata(chip, dev, given_dir=dir_name)
    rn_data = wpg.get_rawdata(chip, dev, given_dir=dir_name, rn=True)

    return render_template('device_detail.html',
                           chip_name=chip_name,
                           dev_name=dev_name,
                           dir_name=dir_name,
                           ic_data=ic_data,
                           rn_data=rn_data)
def get_data_SQUID(chip_name):
    chip = d.find_chip(chip_name)
    SQUID_measurements = chip.squid_measurements

    full_pass = []

    for meas in SQUID_measurements:
        if meas.Ic_pos != None and meas.Iret_neg != None:
            Ic = round(1000 * np.mean([meas.Ic_pos, abs(meas.Iret_neg)]), 7)
        else:
            Ic = None

        if meas.Iflux_period != None:
            period = round(1000 * meas.Iflux_period, 5)
        else:
            period = None

        if meas.Rn != None:
            Rn = round(meas.Rn, 5)
        else:
            Rn = None

        if meas.I_LC_step != None:
            Vresstep = round(meas.I_LC_step, 9)
        else:
            Vresstep = None

        current_pass = {
            "device_name": meas.device_name,
            "Ic": Ic,
            "Rn": Rn,
            "Period": period,
            "Vresstep": Vresstep
        }
        full_pass.append(current_pass)

    return full_pass
def chip_report():
    import re
    from flask import request

    chip_name = 0

    dev_filter = request.form.get('filter_dev')
    chip_id = request.form.get('chip_select')
    #    chip_id = 112

    if dev_filter is not None:
        post_params = re.split('//', str(dev_filter))
        chip_name = post_params[0]
        dev_filter = post_params[1]
        if dev_filter == "All":
            dev_filter = 0

    #Find the correct chip
    if chip_name == 0:
        try:
            chip = d.find_chip(int(chip_id))
        except:
            d.session.rollback()
    else:
        try:
            chip = d.find_chip(chip_name)
        except:
            d.session.rollback()

    #Find the associated wafer
    wafer = d.find_wafer(chip.wafer_id)
    comment = wafer.comment

    #For other types of chips
    if ("PCM3B" in d.find_design(chip.design_id).name):
        pcm3b_data = wpg.get_data_pcm3b(chip.name)
        SQUID_data = wpg.get_data_SQUID(chip.name)
    elif ("SQUID Chip" in d.find_design(chip.design_id).name):
        SQUID_data = wpg.get_data_SQUID(chip.name)
    elif ("PCMRS" in d.find_design(chip.design_id).name):
        pcmrs_data = wpg.get_data_PCMRS(chip.name)

    if chip is None:
        return "Error! Known bug due to A/B in wafer name!"

    devices = d.show_devices_from_chip(chip.id)

    design = ""
    try:
        design = d.find_design(chip.design_id).name
    except:
        pass

    device_types = []

    for dev in devices:
        if dev.device_type not in device_types:
            device_types.append(dev.device_type)

    device_type_filtered = "All"
    if dev_filter in device_types:
        device_type_filtered = dev_filter
        devices = [x for x in devices if x.device_type == dev_filter]
        device_types = [dev_filter]

    data = wpg.get_data(chip, devices)

    other_chips = d.show_chips_from_wafer(chip.wafer_id)

    if ("Singles" in d.find_design(chip.design_id).name):
        return render_template('single_chip_report2.html',
                               chip=chip,
                               other_chips=other_chips,
                               data=data,
                               device_types=device_types,
                               device_type_filtered=device_type_filtered,
                               design=design,
                               test=d.find_design(chip.design_id).name.lower())
    elif ("PCM3B" in d.find_design(chip.design_id).name):
        return render_template('pcm3b_report.html',
                               chip=chip,
                               other_chips=other_chips,
                               pcm3b_data=pcm3b_data,
                               SQUID_data=SQUID_data,
                               design=design,
                               comment=comment)
    elif ("SQUID Chip" in d.find_design(chip.design_id).name):
        return render_template('SQUID_report.html',
                               chip=chip,
                               other_chips=other_chips,
                               SQUID_data=SQUID_data,
                               design=design,
                               comment=comment)
    elif ("PCMRS" in d.find_design(chip.design_id).name):
        return render_template('pcmrs_report.html',
                               chip=chip,
                               other_chips=other_chips,
                               pcmrs_data=pcmrs_data,
                               design=design,
                               comment=comment)
    else:
        return render_template('chip_report_format.html',
                               chip=chip,
                               other_chips=other_chips,
                               data=data,
                               device_types=device_types,
                               device_type_filtered=device_type_filtered,
                               design=design,
                               comment=comment,
                               test=d.find_design(chip.design_id).name.upper())
def get_data_PCMRS(chip_name):
    chip = d.find_chip(chip_name)
    wafer = d.find_wafer(chip.wafer_id)
    measurements = chip.resistor_measurements

    table1_rows = []
    table2_rows = []
    table3_rows = []
    table4_rows = []
    table5_rows = []
    table6_rows = []

    vias1 = [
        '1 x 1', '1 x 1', '1 x 2', '1 x 3', '1 x 4', '1 x 5', '1 x 6', '1 x 7',
        '1 x 8'
    ]
    vias2 = [
        '1 x 1', '1 x 1', '1 x 1', '1 x 1', '1 x 1', '1 x 1', '1 x 1', '1 x 1',
        '1 x 1'
    ]

    missing = wafer.missing_width  #Needs to be changed later

    for meas in measurements:
        if '180' in meas.device_name:
            idx = meas.device_name.index('x')
            R4K = meas.R_4k_1000uA
            sq = 179 / (int(meas.device_name[:2].replace('x', '')) - missing)
            row = [
                meas.device_name[:idx] + ' x ' + meas.device_name[idx + 1:],
                vias1[int(meas.device_name[:2].replace('x', '')) - 2],
                round(R4K, 3),
                round(sq, 3),
                round(R4K / sq, 3)
            ]
            table1_rows.append(row)
        elif '90' in meas.device_name:
            idx = meas.device_name.index('x')
            R4K = meas.R_4k_1000uA
            sq = 89 / (int(meas.device_name[:2].replace('x', '')) - missing)
            row = [
                meas.device_name[:idx] + ' x ' + meas.device_name[idx + 1:],
                vias1[int(meas.device_name[:2].replace('x', '')) - 2],
                round(R4K, 3),
                round(sq, 3),
                round(R4K / sq, 3)
            ]
            table2_rows.append(row)
        elif '40' in meas.device_name:
            idx = meas.device_name.index('x')
            R4K = meas.R_4k_1000uA
            sq = 39 / (int(meas.device_name[:2].replace('x', '')) - missing)
            row = [
                meas.device_name[:idx] + ' x ' + meas.device_name[idx + 1:],
                vias1[int(meas.device_name[:2].replace('x', '')) - 2],
                round(R4K, 3),
                round(sq, 3),
                round(R4K / sq, 3)
            ]
            table3_rows.append(row)
        elif '20' in meas.device_name:
            idx = meas.device_name.index('x')
            R4K = meas.R_4k_1000uA
            sq = 19 / (int(meas.device_name[:2].replace('x', '')) - missing)
            row = [
                meas.device_name[:idx] + ' x ' + meas.device_name[idx + 1:],
                vias1[int(meas.device_name[:2].replace('x', '')) - 2],
                round(R4K, 3),
                round(sq, 3),
                round(R4K / sq, 3)
            ]
            table4_rows.append(row)
        elif '10-1' in meas.device_name:
            idx = meas.device_name.index('x')
            R4K = meas.R_4k_1000uA
            sq = 9 / (int(meas.device_name[:2].replace('x', '')) - missing)
            row = [
                meas.device_name[:idx] + ' x ' + meas.device_name[idx + 1:],
                vias2[int(meas.device_name[:2].replace('x', '')) - 2],
                round(R4K, 3),
                round(sq, 3),
                round(R4K / sq, 3)
            ]
            table6_rows.append(row)
        else:
            idx = meas.device_name.index('x')
            R4K = meas.R_4k_1000uA
            sq = 9 / (int(meas.device_name[:2].replace('x', '')) - missing)
            row = [
                meas.device_name[:idx] + ' x ' + meas.device_name[idx + 1:],
                vias1[int(meas.device_name[:2].replace('x', '')) - 2],
                round(R4K, 3),
                round(sq, 3),
                round(R4K / sq, 3)
            ]
            table5_rows.append(row)

    full_pass = {
        'table1': table1_rows,
        'table2': table2_rows,
        'table3': table3_rows,
        'table4': table4_rows,
        'table5': table5_rows,
        'table6': table6_rows
    }

    return full_pass
def get_data_pcm3b(chip_name):
    chip = d.find_chip(chip_name)
    resistor_measurements = chip.resistor_measurements
    via_measurements = chip.via_measurements
    crossbar_measurements = chip.crossbar_measurements

    #Initialize data arrays for crossbars
    RL_RT = [None, None, None, None, None]
    Rcross_RT = [None, None, None, None, None]
    Rsq_RT = [None, None, None, None, None]  #calculated
    Width_RT = [None, None, None, None, None]  #calculated
    RL_10K = [None, None, None, None, None]
    Rcross_10K = [None, None, None, None, None]
    Rsq_10K = [None, None, None, None, None]  #calculated
    Width_10K = [None, None, None, None, None]  #calculated
    RRR = [None, None, None, None, None]  #calculated
    Tc = [None, None, None, None, None]
    Tcsum = [0, 0, 0, 0, 0]
    Tccount = [0, 0, 0, 0, 0]

    for meas in crossbar_measurements:
        if meas.device_name == 'RS RL':
            RL_RT[0] = meas.R_RT
            RL_10K[0] = meas.R_10K
            if meas.Tc != None:
                Tcsum[0] += meas.Tc
                Tccount[0] += 1
        elif meas.device_name == 'M0 RL':
            RL_RT[1] = meas.R_RT
            RL_10K[1] = meas.R_10K
            if meas.Tc != None:
                Tcsum[1] += meas.Tc
                Tccount[1] += 1
        elif meas.device_name == 'M1 RL':
            RL_RT[2] = meas.R_RT
            RL_10K[2] = meas.R_10K
            if meas.Tc != None:
                Tcsum[2] += meas.Tc
                Tccount[2] += 1
        elif meas.device_name == 'M2 RL':
            RL_RT[3] = meas.R_RT
            RL_10K[3] = meas.R_10K
            if meas.Tc != None:
                Tcsum[3] += meas.Tc
                Tccount[3] += 1
        elif meas.device_name == 'M3 RL':
            RL_RT[4] = meas.R_RT
            RL_10K[4] = meas.R_10K
            if meas.Tc != None:
                Tcsum[4] += meas.Tc
                Tccount[4] += 1
        elif meas.device_name == 'RS Rsq':
            Rcross_RT[0] = meas.R_RT
            Rcross_10K[0] = meas.R_10K
            if meas.Tc != None:
                Tcsum[0] += meas.Tc
                Tccount[0] += 1
        elif meas.device_name == 'M0 Rsq':
            Rcross_RT[1] = meas.R_RT
            Rcross_10K[1] = meas.R_10K
            if meas.Tc != None:
                Tcsum[1] += meas.Tc
                Tccount[1] += 1
        elif meas.device_name == 'M1 Rsq':
            Rcross_RT[2] = meas.R_RT
            Rcross_10K[2] = meas.R_10K
            if meas.Tc != None:
                Tcsum[2] += meas.Tc
                Tccount[2] += 1
        elif meas.device_name == 'M2 Rsq':
            Rcross_RT[3] = meas.R_RT
            Rcross_10K[3] = meas.R_10K
            if meas.Tc != None:
                Tcsum[3] += meas.Tc
                Tccount[3] += 1
        elif meas.device_name == 'M3 Rsq':
            Rcross_RT[4] = meas.R_RT
            Rcross_10K[4] = meas.R_10K
            if meas.Tc != None:
                Tcsum[4] += meas.Tc
                Tccount[4] += 1

    #Calculate the apropriate values for Rsq, Width, and RRR
    for c in range(0, 5):
        if Rcross_RT[c] is not None:
            Rsq_RT[c] = round((math.pi / math.log(2)) * Rcross_RT[c], 3)
        if Rcross_10K[c] is not None:
            Rsq_10K[c] = round((math.pi / math.log(2)) * Rcross_10K[c], 3)
        if Rsq_RT[c] is not None and RL_RT[c] is not None:
            Width_RT[c] = round(200 * (Rsq_RT[c] / RL_RT[c]), 3)
        if Rsq_10K[c] is not None and RL_10K[c] is not None:
            Width_10K[c] = round(200 * (Rsq_10K[c] / RL_10K[c]), 3)
        if RL_RT[c] is not None and RL_10K[c] is not None:
            RRR[c] = round(RL_RT[c] / RL_10K[c], 3)
        if Tccount[c] != 0:
            Tc[c] = Tcsum[c] / Tccount[c]

    crossbar_pass = {
        "RL_RT": RL_RT,
        "Rsq_RT": Rsq_RT,
        "Width_RT": Width_RT,
        "RL_10K": RL_10K,
        "Rsq_10K": Rsq_10K,
        "Width_10K": Width_10K,
        "RRR": RRR,
        "Tc": Tc
    }

    #Initialize data arrays for RS arrays
    R_RT = [None, None]
    R_4K = [None, None, None, None, None, None]
    R_256 = [None, None, None, None, None, None]  #calculated
    R_27 = [None, None, None, None, None, None]  #calculated

    for meas in resistor_measurements:
        if meas.device_name == 'RA750':
            R_RT[0] = meas.R_RT_IV
            R_4K[0] = meas.R_4k_2000uA
            R_4K[1] = meas.R_4k_1000uA
            R_4K[2] = meas.R_4k_500uA
        elif meas.device_name == 'RA1000':
            R_RT[1] = meas.R_RT_IV
            R_4K[3] = meas.R_4k_2000uA
            R_4K[4] = meas.R_4k_1000uA
            R_4K[5] = meas.R_4k_500uA

    for c in range(0, 6):
        if R_4K[c] is not None:
            R_256[c] = round(R_4K[c] / 256, 3)
        if R_256[c] is not None:
            R_27[c] = round(R_256[c] / 2.7, 3)

    resistor_pass = {"R_RT": R_RT, "R_4K": R_4K, "R_256": R_256, "R_27": R_27}

    #Initialize data arrays for Via measurements
    R_4K_vias = [None, None, None, None, None]
    Imax = [None, None, None, None, None]

    for meas in via_measurements:
        if meas.device_name == 'M2_I2_M3-1':
            R_4K_vias[4] = meas.R_4k
            Imax[4] = meas.Imax
        elif meas.device_name == 'M1_I0_M0-1':
            R_4K_vias[3] = meas.R_4k
            Imax[3] = meas.Imax
        elif meas.device_name == 'M1_I0_M0-0.75':
            R_4K_vias[2] = meas.R_4k
            Imax[2] = meas.Imax
        elif meas.device_name == 'M1_I1_M2-1':
            R_4K_vias[1] = meas.R_4k
            Imax[1] = meas.Imax
        elif meas.device_name == 'M1_I0_M0-0.75':
            R_4K_vias[0] = meas.R_4k
            Imax[0] = meas.Imax

    via_pass = {"R_4K_vias": R_4K_vias, "Imax": Imax}

    full_pass = {
        "crossbar_data": crossbar_pass,
        "resistor_data": resistor_pass,
        "via_data": via_pass
    }

    return full_pass