def get_msm_jtag_dict_from_file_impl(msmid, msm_jtag_mapping_file, file_type="xml"): msmid_jtagid_dict = {} if not os.path.isfile(msm_jtag_mapping_file): raise RuntimeError, "gensecimage_builder_wrapper: msm to jtag mapping file %s does not exist!" % msm_jtag_mapping_file if file_type.lower() == "txt": file = open(msm_jtag_mapping_file) for line in file: (key, val) = line.split() msmid_jtagid_dict[key] = val file.close() elif file_type.lower() == "xml": try: import msmjtagid_parse msmid_jtagid_dict = msmjtagid_parse.get_jtag_dict_from_msmid(msmid, msm_jtag_mapping_file) except Exception, e: err_str = "msmid %s cannot be mapped into a valid JTAG ID. Please update %s.\n" % (msmid, msm_jtag_mapping_file) err_str = err_str + str(e) raise RuntimeError, err_str
def _get_msm_jtag_dict_from_file_impl(msmid, msm_jtag_mapping_file, file_type="xml"): msmid_jtagid_dict = {} if not os.path.isfile(msm_jtag_mapping_file): #raise RuntimeError, "sectools_builder: msm to jtag mapping file %s does not exist!" % msm_jtag_mapping_file return DEFAULT_MSM_JTAG_DICT if file_type.lower() == "txt": fp = open(msm_jtag_mapping_file) for line in fp: (key, val) = line.split() msmid_jtagid_dict[key] = val fp.close() elif file_type.lower() == "xml": try: msmid_jtagid_dict = msm_jtag_parser.get_jtag_dict_from_msmid(msmid, msm_jtag_mapping_file) except Exception, e: err_str = "msmid %s cannot be mapped into a valid JTAG ID. Please update %s.\n" % (msmid, msm_jtag_mapping_file) err_str = err_str + str(e) raise RuntimeError, err_str