summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2009-03-18 17:30:42 -0400
committerMac Mollison <mollison@cs.unc.edu>2009-03-18 17:30:42 -0400
commitd0ea73e7d76b47c3b441320f5618c21590fb06a6 (patch)
tree75cea1fb0448b27f15bc260818cba444985fb8ca
parentc7236d456eb90166fe1ee835684ef86845bc8c36 (diff)
Created new directories for trace analyzer and test driver
-rw-r--r--trace_analyzer/README (renamed from README)0
-rwxr-xr-xtrace_analyzer/run.py (renamed from run.py)14
-rwxr-xr-xtrace_analyzer/sta.py (renamed from sta.py)10
3 files changed, 22 insertions, 2 deletions
diff --git a/README b/trace_analyzer/README
index 16450df..16450df 100644
--- a/README
+++ b/trace_analyzer/README
diff --git a/run.py b/trace_analyzer/run.py
index 52f0e27..80ae257 100755
--- a/run.py
+++ b/trace_analyzer/run.py
@@ -6,7 +6,8 @@ import sta
6###################################### 6######################################
7 7
8def main(): 8def main():
9 myEDF() 9 #myEDF()
10 macTrace()
10 #myTrace() 11 #myTrace()
11 #switchToTrace() 12 #switchToTrace()
12 #releaseTrace() 13 #releaseTrace()
@@ -20,7 +21,7 @@ def oneCPU():
20 trace.print_records() 21 trace.print_records()
21 22
22def myEDF(): 23def myEDF():
23 test = sta.EDF(g6_list,hooks=[37917307040912]) 24 test = sta.EDF(g6_list,hooks=[37917786934190])
24 #test = sta.EDF(g6_list) 25 #test = sta.EDF(g6_list)
25 test.run_test() 26 test.run_test()
26 27
@@ -31,6 +32,12 @@ def myTrace():
31 trace.print_count(True) 32 trace.print_count(True)
32 trace.print_records() 33 trace.print_records()
33 34
35def macTrace():
36 trace = sta.Trace(mac2_list)
37 trace.sort('when',alt='release_time')
38 trace.print_count(True)
39 trace.print_records()
40
34def switchToTrace(): 41def switchToTrace():
35 events_trace = sta.Trace(g6_list) 42 events_trace = sta.Trace(g6_list)
36 events_trace.filter('type==5') 43 events_trace.filter('type==5')
@@ -79,6 +86,9 @@ path + 'st-x19-1.bin',
79path + 'st-x19-2.bin', 86path + 'st-x19-2.bin',
80path + 'st-x19-3.bin'] 87path + 'st-x19-3.bin']
81 88
89mac2_list = [
90path + 'st-mac2-0.bin']
91
82 92
83 93
84############## 94##############
diff --git a/sta.py b/trace_analyzer/sta.py
index 08992d1..4269037 100755
--- a/sta.py
+++ b/trace_analyzer/sta.py
@@ -219,6 +219,8 @@ class EDF:
219 if job.running == False: 219 if job.running == False:
220 if job.inversion_start_time==0: 220 if job.inversion_start_time==0:
221 job.inversion_start_time=self.now 221 job.inversion_start_time=self.now
222 if self.check_tie(job):
223 job.inversion_start_time=0
222 elif job.running == True: 224 elif job.running == True:
223 if job.inversion_start_time > 0: 225 if job.inversion_start_time > 0:
224 self.check_error(job) 226 self.check_error(job)
@@ -253,6 +255,14 @@ class EDF:
253 return True 255 return True
254 return False 256 return False
255 257
258 def check_tie(self, job):
259 """Returns True if there is another job with the same deadline that is
260 running"""
261 for x in self.jobs:
262 if x.deadline == job.deadline and x.running == True:
263 return True
264 return False
265
256 class Job: 266 class Job:
257 def __init__(self): 267 def __init__(self):
258 self.release_time = 0 268 self.release_time = 0