コード例 #1
0
        if "trace-filter" in opt:
            trace_filter = []
            for trace in opt["trace-filter"].split():
                trace_filter.append(trace.split(","))
            opt["trace-filter"] = trace_filter
        else:
            opt["trace-filter"] = None

    except getopt.GetoptError as err:
        print(err)
        sys.exit(2)

    modelfile = args[0]

    pta = PTA.from_file(modelfile)

    enum = dict()
    if ".json" not in modelfile:
        with open(modelfile, "r") as f:
            driver_definition = yaml.safe_load(f)
        if "dummygen" in driver_definition and "enum" in driver_definition[
                "dummygen"]:
            enum = driver_definition["dummygen"]["enum"]

    pta.set_random_energy_model()

    runs = list(
        pta.dfs(
            opt["depth"],
            with_arguments=True,
コード例 #2
0
ファイル: workload.py プロジェクト: derf/dfatool
        if result.energy_mae:
            print(u"    ± {}  /  {:.0f}%".format(
                human_readable(result.energy_mae, "J"), result.energy_mape))
        print("    Mean Power: " + human_readable(result.mean_power, "W"))
        print("")

        prev_state = result.end_state
        prev_param = result.parameters

    return ret


for i in range(len(args) // 2):
    ptafile, raw_word = args[i * 2], args[i * 2 + 1]
    ptafiles.append(ptafile)
    pta = PTA.from_file(ptafile)
    timedword = TimedSequence(raw_word)
    print("Input: {}\n".format(timedword))
    loops[ptafile] = simulate_word(timedword)

for loop_name in sorted(loop_names):
    result_set = list()
    total_power = 0
    for ptafile in sorted(ptafiles):
        if loop_name in loops[ptafile]:
            result_set.append(loops[ptafile][loop_name])
            total_power += loops[ptafile][loop_name].mean_power
    print("{}: total mean power is {}".format(loop_name,
                                              human_readable(total_power,
                                                             "W")))
    for i, result in enumerate(result_set):
コード例 #3
0
ファイル: analyze-archive.py プロジェクト: derf/dfatool
    show_models = args.show_models
    show_quality = args.show_quality

    if args.filter_param:
        args.filter_param = list(
            map(lambda x: x.split("="), args.filter_param.split(","))
        )
    else:
        args.filter_param = list()

    if args.with_safe_functions is not None:
        safe_functions_enabled = True

    if args.hwmodel:
        pta = PTA.from_file(args.hwmodel)

    raw_data = RawData(
        args.measurement,
        with_traces=(
            args.export_traces is not None
            or args.plot_traces is not None
            or args.with_substates is not None
        ),
        skip_cache=args.no_cache,
    )

    if args.info:
        print(" ".join(raw_data.filenames) + ":")
        data_source = "???"
        if raw_data.ptalog:
コード例 #4
0
ファイル: dfa-to-dot.py プロジェクト: derf/dfatool
def main(filename):
    pta = PTA.from_file(filename)
    print(pta.to_dot())