-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfiguration.py
66 lines (48 loc) · 1.35 KB
/
configuration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import math
import utils
class Configuration:
def __init__ (self):
self . machine_count = 0
self . input_magnitude = 0
self . output_magnitude = 0
self . power_magnitude = 0
self . somersloops_slotted = 0
def add_corner_machines (self, interpreted_corner):
self . machine_count += interpreted_corner . machine_count
self . input_magnitude += interpreted_corner . input_magnitude ()
self . output_magnitude += interpreted_corner . output_magnitude ()
self . power_magnitude += interpreted_corner . power_magnitude ()
def get_report (
self,
somersloop_factor,
machine_supports_overclocking,
precision
):
report = dict ()
if machine_supports_overclocking:
integer_machine_count = math . ceil (
utils . interpret_approximate (
self . machine_count,
precision
)
)
report ['machine_count'] = utils . format_value (
integer_machine_count,
0
)
clock_speed_setting = self . input_magnitude / integer_machine_count
report ['clock_speed_setting'] = utils . format_value (
clock_speed_setting,
6
)
else:
report ['machine_count'] = utils . format_value (
self . machine_count,
precision
)
if utils . interpret_approximate (somersloop_factor, 0) != 0:
report ['somersloops_slotted_per_machine'] = utils . format_value (
somersloop_factor,
0
)
return report