def gen_lists(app, countList, inj_mode): if inj_mode == cp.RF_MODE: # RF injection list total_count = cf.get_total_insts(countList, True) if inj_mode == cp.RF_MODE else cf.get_total_insts(countList, False) for bfm in sp.rf_bfm_list: write_injection_list_file(app, inj_mode, "rf", bfm, MAX_INJ, total_count, countList) elif inj_mode == cp.INST_VALUE_MODE: # instruction value injections total_icounts = cf.get_total_counts(countList) for igid in sp.inst_value_igid_bfm_map: for bfm in sp.inst_value_igid_bfm_map[igid]: write_injection_list_file(app, inj_mode, igid, bfm, MAX_INJ, total_icounts[igid], countList) elif inj_mode == cp.INST_ADDRESS_MODE: # instruction value injections total_icounts = cf.get_total_counts(countList) for igid in sp.inst_address_igid_bfm_map: for bfm in sp.inst_address_igid_bfm_map[igid]: write_injection_list_file(app, inj_mode, igid, bfm, MAX_INJ, total_icounts[igid], countList)
def populate_inst_fraction(): global inst_fraction for app in results_app_table: inst_counts = cf.get_total_counts(cf.read_inst_counts(sp.app_dir[app], app)) total = cf.get_total_insts(cf.read_inst_counts(sp.app_dir[app], app), False) inst_fraction[app] = [total] + [1.0*i/total for i in inst_counts] inst_count[app] = inst_counts
def gen_lists(app, countList, inj_mode): if inj_mode == cp.RF_MODE: # RF injection list total_count = cf.get_total_insts( countList, True) if inj_mode == cp.RF_MODE else cf.get_total_insts( countList, False) for bfm in sp.rf_bfm_list: write_injection_list_file(app, inj_mode, "rf", bfm, MAX_INJ, total_count, countList) elif inj_mode == cp.INST_VALUE_MODE: # instruction value injections total_icounts = cf.get_total_counts(countList) for igid in sp.inst_value_igid_bfm_map: for bfm in sp.inst_value_igid_bfm_map[igid]: write_injection_list_file(app, inj_mode, igid, bfm, MAX_INJ, total_icounts[igid], countList) elif inj_mode == cp.INST_ADDRESS_MODE: # instruction value injections total_icounts = cf.get_total_counts(countList) for igid in sp.inst_address_igid_bfm_map: for bfm in sp.inst_address_igid_bfm_map[igid]: write_injection_list_file(app, inj_mode, igid, bfm, MAX_INJ, total_icounts[igid], countList)