Exemplo n.º 1
0
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 
Exemplo n.º 2
0
def main():
    if len(sys.argv) == 2:
        inj_mode = sys.argv[1]  # rf or inst_value or inst_address
    else:
        print "Usage: ./script-name <rf or inst>"
        print "There are two modes to conduct error injections"
        print "rf: tries to randomly pick a register and inject a bit flip in it (tries to model particle strikes in register file)"
        print "inst: tries to randomly pick a dynamic instruction and inject error in the destimation regsiter"
        exit(1)

    # actual code that generates list per app is here
    for app in sp.apps:
        print "\nCreating list for %s ... " % (app)
        os.system(
            "mkdir -p %s/injection-list" %
            sp.app_log_dir[app])  # create directory to store injection list

        countList = cf.read_inst_counts(sp.app_dir[app], app)
        total_count = cf.get_total_insts(
            countList, True) if inj_mode == cp.RF_MODE else cf.get_total_insts(
                countList, False)
        if total_count == 0:
            print "Something is not right. Total instruction count = 0\n"
            sys.exit(-1)

        gen_lists(app, countList, inj_mode)
        print "Output: Check %s" % (sp.app_log_dir[app] + "/injection-list/")
Exemplo n.º 3
0
def main():
    # if len(sys.argv) == 2:
    # 	inj_mode = sys.argv[1] # rf or inst_value or inst_address
    # else:
    # 	print ("Usage: ./script-name <rf or inst>")
    # 	print ("Only one mode is currently supported: inst_value")
    # 	exit(1)
    inj_mode = "inst_value"  # we only support inst_value mode in NVBitFI as of now (March 25, 2020)

    # actual code that generates list per app is here
    for app in p.apps:
        print("\nCreating list for %s ... " % (app))
        os.system(
            "mkdir -p %s/injection-list" %
            p.app_log_dir[app])  # create directory to store injection list

        countList = cf.read_inst_counts(p.app_log_dir[app], app)
        total_count = cf.get_total_insts(
            countList, True) if inj_mode == p.RF_MODE else cf.get_total_insts(
                countList, False)
        if total_count == 0:
            print("Something is not right. Total instruction count = 0\n")
            sys.exit(-1)

        gen_lists(app, countList, inj_mode)
        print("Output: Check %s" % (p.app_log_dir[app] + "/injection-list/"))
Exemplo n.º 4
0
def main():
	if len(sys.argv) == 2: 
		inj_mode = sys.argv[1] # rf or inst_value or inst_address
	else:
		print "Usage: ./script-name <rf or inst>"
		print "There are two modes to conduct error injections"
		print "rf: tries to randomly pick a register and inject a bit flip in it (tries to model particle strikes in register file)"
		print "inst: tries to randomly pick a dynamic instruction and inject error in the destimation regsiter" 
		exit(1)
	
	# actual code that generates list per app is here
	for app in sp.apps:
		print "\nCreating list for %s ... " %(app)
		os.system("mkdir -p %s/injection-list" %sp.app_log_dir[app]) # create directory to store injection list
	
		countList =  cf.read_inst_counts(sp.app_dir[app], app)
		total_count = cf.get_total_insts(countList, True) if inj_mode == cp.RF_MODE else cf.get_total_insts(countList, False)
		if total_count == 0:
			print "Something is not right. Total instruction count = 0\n";
			sys.exit(-1);
	
		gen_lists(app, countList, inj_mode)
		print "Output: Check %s" %(sp.app_log_dir[app] + "/injection-list/")