Example #1
0
def main():
    args = Args()
    args.parse()

    hists = []
    for file_name in args.i_file_names:
        h = Hist()
        h.load(file_name)
        hists.append(Cdf(h.dict))

    plot(hists, args.o_file_name)
Example #2
0
def share_hist(hist1, cpi1, cpi2, inst_mix1, inst_mix2):
    dict_ = {}
    for rdist1, count1 in hist1:
        cycles = (rdist1 * cpi1) / inst_mix1
        rdist2 = (cycles / cpi2) * inst_mix2
        dict_[my_round(rdist1 + rdist2)] = count1
    return Hist(dict_)
Example #3
0
def parse_usf(usf_file):
    dict_ = {}
    for event in usf_file:
        if event.type == pyusf.USF_EVENT_SAMPLE:
            rdist = event.end.time - event.begin.time - 1
        elif event.type == pyusf.USF_EVENT_DANGLING:
            rdist = sys.maxint
        else:
            continue

        if dict_.has_key(rdist):
            dict_[rdist] += 1
        else:
            dict_[rdist] = 1

    return Hist(dict_)
Example #4
0
 def __init__(self, dict_):
     _Hist.__init__(self, dict_)
Example #5
0
def read_hist(file_name1, file_name2, file_type):
    if file_type == "usf":
        try:
            usf_file1 = pyusf.Usf(file_name1)
            usf_file2 = pyusf.Usf(file_name2)
        except IOError, e:
            print_and_exit(str(e))

        hist1 = parse_usf(usf_file1)
        hist2 = parse_usf(usf_file2)

        usf_file1.close()
        usf_file2.close()
    elif file_type == "hist":
        hist1 = Hist()
        hist2 = Hist()

        hist1.load(file_name1)
        hist2.load(file_name2)
    else:
        print_and_exit("XXX")

    return hist1, hist2

def main():
    args = Args()
    args.parse()

    hist1, hist2 = read_hist(args.i_file_name1, args.i_file_name2, args.file_type)
Example #6
0
def read_hist(file_name1, file_name2, file_type):
    if file_type == "usf":
        try:
            usf_file1 = pyusf.Usf(file_name1)
            usf_file2 = pyusf.Usf(file_name2)
        except IOError, e:
            print_and_exit(str(e))

        hist1 = parse_usf(usf_file1)
        hist2 = parse_usf(usf_file2)

        usf_file1.close()
        usf_file2.close()
    elif file_type == "hist":
        hist1 = Hist()
        hist2 = Hist()

        hist1.load(file_name1)
        hist2.load(file_name2)
    else:
        print_and_exit("XXX")

    return hist1, hist2


def main():
    args = Args()
    args.parse()

    hist1, hist2 = read_hist(args.i_file_name1, args.i_file_name2, args.file_type)
Example #7
0
 def __init__(self, dict_):
     _Hist.__init__(self, dict_)