Пример #1
0
def test_create_schedule():
    Component.reset_ids()
    base_path = "./test_dfgs"
    file_path = f"{base_path}/linear_dfg.json"

    with open('config.json') as config_file:
        data = json.load(config_file)

    new_arch = TablaTemplate(data)
    test_sched = Schedule()
    test_sched.load_dfg(file_path)
    test_sched.schedule_graph(new_arch)
    validate_graph(test_sched, new_arch)
Пример #2
0
def test_reco():
    Component.reset_ids()
    base_path = "./test_dfgs"
    dfg_name = "reco_dfg.json"
    file_path = f"{base_path}/{dfg_name}"

    with open('config.json') as config_file:
        data = json.load(config_file)

    new_arch = TablaTemplate(data)
    test_sched = Schedule()
    test_sched.load_dfg(file_path)
    test_sched.schedule_graph(new_arch)
    test_sched.print_schedule_graph(f"./test_outputs/schedule_{dfg_name}")
    validate_graph(test_sched, new_arch)
    print(f"Graph width: {test_sched.get_max_width()}\nAverage pe utilization: {new_arch.pe_utilization()}")
    pprint.pprint(new_arch.pu_utilization())