-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (37 loc) · 1.19 KB
/
main.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
import sys
from simso.core import Model
from simso.configuration import Configuration
from interval import *
from ss_conf_table import *
#from ss_offline_phase import gen_slotshift_table
def main():
remote = reciever("/tmp/ss_parser")
configuration = Configuration()
if remote == None:
print "remote is none"
#todo: this number should be generated randomly
table = gen_slotshift_table(1, 10, 10, 10, .10)
if table:
remote = local_table(table[0], table[1],
table[2], table[3])
else:
print "Cant Run because task set not generated"
return
else:
remote.recieve_table()
associate = association(remote)
interval = associate.create_def_intr_list(associate)
run_time = associate.get_running_time(interval)
associate.create_relation_window(associate, interval)
while 1:
j = associate.create_tsk(associate, interval, configuration)
if(j != 0):
break
configuration.duration = run_time * configuration.cycles_per_ms
configuration.add_processor(name="CPU 1", identifier=1)
configuration.scheduler_info.filename = "./SlotShifting.py"
configuration.scheduler_info.data = interval
configuration.check_all()
model = Model(configuration)
model.run_model()
main()