def test_calculate_platform_symmetries(datadir, small_platform):
    file_name = f"{small_platform}.autgrp.json"
    out_file = os.path.join(datadir, file_name)

    subprocess.check_call(
        [
            "mocasin",
            "calculate_platform_symmetries",
            f"platform={small_platform}",
            f"out_file={out_file}",
        ],
        cwd=datadir,
    )

    # ideally we would call hydra.instantiate here,
    # but I don't know how to do this in pytest.
    processor0 = genericProcessor("proc_type_0", 2000000000)
    processor1 = genericProcessor("proc_type_1", 3000000000)
    processor2 = genericProcessor("proc_type_2", 4000000000)
    processor3 = genericProcessor("proc_type_3", 5000000000)

    if small_platform == "multi_cluster":
        platform = DesignerPlatformMultiCluster(processor0, processor1)
    elif small_platform == "generic_mesh":
        platform = DesignerPlatformMesh(processor0, processor1)
    elif small_platform == "generic_bus":
        platform = DesignerPlatformBus(processor0)
    elif small_platform == "exynos990":
        platform = DesignerPlatformExynos990(processor0, processor1,
                                             processor2, processor3)
    elif small_platform == "odroid":
        platform = DesignerPlatformOdroid(processor0, processor1)

    ag = mpsym.ArchGraphSystem.from_json_file(out_file)
    assert checkSymmetries(platform.to_adjacency_dict(), ag.automorphisms())
Example #2
0
def platform_power():
    pe_little = genericProcessor("proc_type_0",
                                 static_power=1,
                                 dynamic_power=3)
    pe_big = genericProcessor("proc_type_1", static_power=2, dynamic_power=7)
    p = DesignerPlatformOdroid(pe_little, pe_big)
    return p
Example #3
0
def platform(request):
    processor0 = genericProcessor("proc_type_0")
    processor1 = genericProcessor("proc_type_1")
    processor2 = genericProcessor("proc_type_2")
    processor3 = genericProcessor("proc_type_3")

    if request.param == "exynos990":
        return DesignerPlatformExynos990(
            processor0, processor1, processor2, processor3
        )
    elif request.param == "odroid":
        return DesignerPlatformOdroid(processor0, processor1)
    elif request.param == "generic_bus":
        return DesignerPlatformBus(processor0)
    elif request.param == "generic_mesh":
        return DesignerPlatformMesh(processor0, processor1)
    elif request.param == "multi_cluster":
        return DesignerPlatformMultiCluster(processor0, processor1)
    elif request.param == "haec":
        return DesignerPlatformHAEC(processor0)
    elif request.param == "coolidge":
        return DesignerPlatformCoolidge(processor0, processor1)
    else:
        assert False, "wrong parameter"
Example #4
0
def platform():
    pe_little = genericProcessor("proc_type_0")
    pe_big = genericProcessor("proc_type_1")
    p = DesignerPlatformOdroid(pe_little, pe_big)
    return p
Example #5
0
def platform_odroid():
    pe_little = genericProcessor("ARM_CORTEX_A7")
    pe_big = genericProcessor("ARM_CORTEX_A15")
    p = DesignerPlatformOdroid(pe_little, pe_big)
    return p