Пример #1
0
    def test_overlapping_freq_doms(self):
        """Can't build an EM with energy nodes overlapping freq domains"""

        # To make this easy we'll just use a single active state everywhere, and
        # no idle states
        active_states = {10000: ActiveState(capacity=1024, power=100)}

        def cpu_node(cpu):
            return EnergyModelNode(cpu=cpu,
                                   active_states=active_states,
                                   idle_states=[])

        root_node = EnergyModelRoot(children=[
            EnergyModelNode(name='cluster1',
                            active_states=active_states,
                            idle_states=[],
                            children=[cpu_node(0), cpu_node(1)])
        ])

        def cpu_pd(cpu):
            return PowerDomain(idle_states=[], cpu=cpu)

        with self.assertRaises(ValueError):
            EnergyModel(root_node=root_node,
                        root_power_domain=PowerDomain(
                            idle_states=[], children=[cpu_pd(0),
                                                      cpu_pd(1)]),
                        freq_domains=[[0], [1]]),
Пример #2
0
def big_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=big_cpu_active_states,
                           idle_states=big_cpu_idle_states)
Пример #3
0
def little_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=little_cpu_active_states,
                           idle_states=little_cpu_idle_states)
Пример #4
0
 def cpu_node(cpu):
     return EnergyModelNode(cpu=cpu,
                            active_states=active_states,
                            idle_states=[])
Пример #5
0
])

bigs = [2, 3]


def big_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=big_cpu_active_states,
                           idle_states=big_cpu_idle_states)


em = EnergyModel(
    root_node=EnergyModelRoot(children=[
        EnergyModelNode(name='cluster_little',
                        active_states=little_cluster_active_states,
                        idle_states=little_cluster_idle_states,
                        children=[little_cpu_node(0),
                                  little_cpu_node(1)]),
        EnergyModelNode(name='cluster_big',
                        active_states=big_cluster_active_states,
                        idle_states=big_cluster_idle_states,
                        children=[big_cpu_node(2),
                                  big_cpu_node(3)])
    ]),
    root_power_domain=PowerDomain(
        idle_states=[],
        children=[
            PowerDomain(idle_states=['cluster-sleep-0'],
                        children=[
                            PowerDomain(idle_states=['WFI', 'cpu-sleep-0'],
                                        cpu=c) for c in littles
Пример #6
0
def gold_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=gold_cpu_active_states,
                           idle_states=cpu_idle_states)
Пример #7
0
def silver_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=silver_cpu_active_states,
                           idle_states=cpu_idle_states)
Пример #8
0
def silver_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=silver_cpu_active_states,
                           idle_states=cpu_idle_states)

def gold_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=gold_cpu_active_states,
                           idle_states=cpu_idle_states)

def cpu_pd(cpu):
    return PowerDomain(cpu=cpu, idle_states=["WFI", "cpu-sleep-0"])

op3_energy = EnergyModel(
    root_node=EnergyModelRoot(children=[
        EnergyModelNode(name='cluster_silver',
                        children=[silver_cpu_node(c) for c in silvers],
                        active_states=silver_cluster_active_states,
                        idle_states=cluster_idle_states),
        EnergyModelNode(name='cluster_gold',
                        children=[gold_cpu_node(c) for c in golds],
                        active_states=gold_cluster_active_states,
                        idle_states=cluster_idle_states)]),
    root_power_domain=PowerDomain(idle_states=[], children=[
        PowerDomain(idle_states=['cluster-sleep-0'], children=[
            cpu_pd(c) for c in silvers]),
        PowerDomain(idle_states=['cluster-sleep-0'], children=[
            cpu_pd(c) for c in golds])]),
    freq_domains=[silvers, golds])
Пример #9
0
    ("cluster-sleep-0", 0),
])

a57s = [1, 2]


def a57_cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=a57_cpu_active_states,
                           idle_states=a57_cpu_idle_states)


juno_r0_energy = EnergyModel(
    root_node=EnergyModelRoot(children=[
        EnergyModelNode(name="cluster_a53",
                        active_states=a53_cluster_active_states,
                        idle_states=a53_cluster_idle_states,
                        children=[a53_cpu_node(c) for c in a53s]),
        EnergyModelNode(name="cluster_a57",
                        active_states=a57_cluster_active_states,
                        idle_states=a57_cluster_idle_states,
                        children=[a57_cpu_node(c) for c in a57s])
    ]),
    root_power_domain=PowerDomain(
        idle_states=[],
        children=[
            PowerDomain(idle_states=["cluster-sleep-0"],
                        children=[
                            PowerDomain(idle_states=["WFI", "cpu-sleep-0"],
                                        cpu=c) for c in a57s
                        ]),
            PowerDomain(idle_states=["cluster-sleep-0"],
Пример #10
0

def cpu_pd(cpu):
    return PowerDomain(cpu=cpu, idle_states=['WFI', 'cpu-sleep'])


def cpu_node(cpu):
    return EnergyModelNode(cpu=cpu,
                           active_states=cpu_active_states,
                           idle_states=cpu_idle_states)


hikey_energy = EnergyModel(
    root_node=EnergyModelRoot(children=[
        EnergyModelNode(name='cluster0',
                        children=[cpu_node(c) for c in [0, 1, 2, 3]],
                        active_states=cluster_active_states,
                        idle_states=cluster_idle_states),
        EnergyModelNode(name='cluster1',
                        children=[cpu_node(c) for c in [4, 5, 6, 7]],
                        active_states=cluster_active_states,
                        idle_states=cluster_idle_states)
    ]),
    root_power_domain=PowerDomain(
        idle_states=[],
        children=[
            PowerDomain(idle_states=["cluster-sleep"],
                        children=[cpu_pd(c) for c in [0, 1, 2, 3]]),
            PowerDomain(idle_states=["cluster-sleep"],
                        children=[cpu_pd(c) for c in [4, 5, 6, 7]])
        ]),
    freq_domains=[[0, 1, 2, 3, 4, 5, 6, 7]])