Ejemplo n.º 1
0
    def _analyse_ifu_errinfo(self: any) -> str:
        regexp = self.ifu_key + r"=(\S+)"
        ret = re.findall(regexp, self.extra_info, re.M)
        if len(ret) == 0:
            return "No IFU_ERR_INFO found"

        errinfo = ret[0]
        # ifu_err_type
        code = utils.get_01_from_hexstr(ret[0], 50, 48)
        self.ifu_err_type = code

        if code in Constant.SOC_ERR_INFO_DICT:
            info = Constant.SOC_ERR_INFO_DICT.get(code)
        else:
            info = "NA"
        errinfo += "\n    ifu_err_type bit[50:48]=%s  meaning:%s" % (
            code, info)

        # ifu_err_addr
        code = utils.get_01_from_hexstr(ret[0], 47, 2)
        info = "IFU Error Address [47:2]"
        # 补2位0,猜测值
        approximate = hex(int(code + "00", 2))
        errinfo += "\n    ifu_err_addr bit[47:2]=%s  meaning:%s  " \
                   "approximate:%s" % (code, info, approximate)
        return errinfo
Ejemplo n.º 2
0
    def _analyse_vec_errinfo(self: any) -> str:
        regexp = self.vec_key + r"=(\S+)"
        ret = re.findall(regexp, self.extra_info, re.M)
        if len(ret) == 0:
            return "No VEC_ERR_INFO found"

        errinfo = ret[0]
        # vec_err_addr
        code = utils.get_01_from_hexstr(ret[0], 28, 16)
        info = "VEC Error Address [17:5]"
        # 补5位0,猜测值
        approximate = hex(int(code + "00000", 2))
        errinfo += "\n    vec_err_addr bit[28:16]=%s  meaning:%s  " \
                   "approximate:%s" % (code, info, approximate)

        # vec_err_rcnt
        code = utils.get_01_from_hexstr(ret[0], 15, 8)
        info = "VEC Error repeat count [7:0]"
        repeats = str(int(code, 2))
        errinfo += "\n    vec_err_rcnt bit[15:8]=%s  meaning:%s  " \
                   "repeats:%s" % (code, info, repeats)
        return errinfo
Ejemplo n.º 3
0
    def _analyse_biu_errinfo(self: any) -> str:
        regexp = self.biu_key + r"=(\S+)"
        ret = re.findall(regexp, self.extra_info, re.M)
        if len(ret) == 0:
            return "No BIU_ERR_INFO found"

        errinfo = ret[0]
        # biu_err_addr
        code = utils.get_01_from_hexstr(ret[0], 24, 0)
        approximate = hex(int(code, 2))
        errinfo += "\n    biu_err_addr bit[24:0]=%s  in hex:%s" % (
            code, approximate)
        return errinfo
Ejemplo n.º 4
0
    def _analyse_mte_errinfo(self: any, err_bit: any) -> str:
        regexp = self.mte_key + r"=(\S+)"
        ret = re.findall(regexp, self.extra_info, re.M)
        if len(ret) == 0:
            return "No MTE_ERR_INFO found"

        errinfo = ret[0]
        # mte_err_type
        code = utils.get_01_from_hexstr(ret[0], 26, 24)
        self.mte_err_type = code

        if err_bit == 46:
            mte_dict = Constant.UNZIP_ERR_INFO_DICT
        elif err_bit == 34:
            mte_dict = Constant.FMC_ERR_INFO_DICT
        elif err_bit == 25:
            mte_dict = Constant.FMD_ERR_INFO_DICT
        elif err_bit == 23:
            mte_dict = Constant.SOC_ERR_INFO_DICT
        elif err_bit == 21:
            mte_dict = Constant.AIPP_ERR_INFO_DICT
        else:
            mte_dict = {}

        if code in mte_dict:
            info = mte_dict.get(code)
        else:
            info = "NA"
        errinfo += "\n    mte_err_type bit[26:24]=%s  meaning:%s" % (
            code, info)

        # mte_err_addr
        code = utils.get_01_from_hexstr(ret[0], 22, 8)
        info = "MTE Error Address [19:5]"
        # 补5位0,猜测值
        approximate = hex(int(code + "00000", 2))
        errinfo += "\n    mte_err_addr bit[22:8]=%s  meaning:%s " \
                   " approximate:%s" % (code, info, approximate)
        return errinfo
Ejemplo n.º 5
0
    def _get_op_and_args_addr(self: any, pc_start: str) -> tuple:
        # pc_start低48位有效
        code = utils.get_01_from_hexstr(pc_start, 47, 0)
        op_addr = hex(int(code, 2))
        match_pattern = "ToCommandBody: funcAddr=%s" % (str(op_addr).upper())

        cmd = [
            'grep', match_pattern, '-nr', self.collection.collect_applog_path
        ]
        _, data = utils.execute_command(cmd)
        regexp = r"(\d+-\d+-\d+-\d+:\d+:\d+\.\d+\.\d+).+?funcAddr=([\da-zA-Z]+).+?args=([\da-zA-Z]+)"
        ret = re.findall(regexp, data, re.M)
        args_addr_late, multi_args_addr = self._get_args_addr_late(
            op_addr, ret)
        return op_addr, args_addr_late, multi_args_addr
Ejemplo n.º 6
0
    def _analyse_cube_errinfo(self: any) -> str:
        regexp = self.cube_key + r"=(\S+)"
        ret = re.findall(regexp, self.extra_info, re.M)
        if len(ret) == 0:
            return "No CUBE_ERR_INFO found"

        errinfo = ret[0]
        # cube_err_addr
        code = utils.get_01_from_hexstr(ret[0], 16, 8)
        info = "CUBE Error Address [17:9]"
        # 补9位0,猜测值
        approximate = hex(int(code + "000000000", 2))
        errinfo += "\n    cube_err_addr bit[16:8]=%s  meaning:%s  " \
                   "approximate:%s" % (code, info, approximate)
        return errinfo
Ejemplo n.º 7
0
 def _get_addr_overflow_diff_incorrect_device(self: any) -> list:
     cmd = [
         'grep', 'devmm_svm_get_vaflgs_by_pid', '-nr',
         self.collection.collect_slog_path
     ]
     _, data = utils.execute_command(cmd)
     regexp = r"(\d+-\d+-\d+-\d+:\d+:\d+\.\d+\.\d+).+?addr is mapped.+va=" \
              r"([\da-zA-Z]+).devid=(\d+),bitmap=([\da-zA-Z]+)"
     ret = re.findall(regexp, data, re.M)
     for i, (time_str, value, devid, bitmap) in enumerate(ret):
         # bitmap 的  【31:26】 标明 该地址在哪个device上分配
         code = utils.get_01_from_hexstr(bitmap, 31, 26)
         allocated_dev_id = str(int(code, 2))
         ret[i] = "%s %s, allocated for device %s, is visited on wrong " \
                  "device whose id is %s" % (
                      time_str, value, allocated_dev_id, devid)
     return ret
Ejemplo n.º 8
0
    def find_extra_pc(self: any) -> str:
        """
        find extra pc
        """
        ret = utils.hexstr_to_list_bin(self.aic_error)
        extra_err_key = ""
        key_map = {"vec": self.vec_key,
                   "mte": self.mte_key,
                   "cube": self.cube_key,
                   "ccu": self.ccu_key}
        for ret_a in ret:
            error_info = Constant.AIC_ERROR_INFO_DICT.get(ret_a)
            err_type = error_info.split('_')[0].lower()
            if err_type in key_map.keys():
                extra_err_key = key_map.get(err_type)
                break

        if extra_err_key == "":
            return ""
        regexp = extra_err_key + r"=(\S+)"
        ret = re.findall(regexp, self.extra_info, re.M)
        if len(ret) == 0:
            return ""
        return utils.get_01_from_hexstr(ret[0], 7, 0)