mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2026-01-04 18:20:09 +01:00
updated for pep8 conformity
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/apps/python/3.5-anaconda/bin/python
|
#!/apps/python/3.5-anaconda/bin/python
|
||||||
import sys, os, re
|
import os, re
|
||||||
import argparse
|
import argparse
|
||||||
from testcase import Testcase
|
from testcase import Testcase
|
||||||
from param import Register, MemAddr, Parameter
|
from param import Register, MemAddr, Parameter
|
||||||
@@ -14,7 +14,6 @@ class Instr_extractor(object):
|
|||||||
db = {}
|
db = {}
|
||||||
sorted_db = []
|
sorted_db = []
|
||||||
lncnt = 1
|
lncnt = 1
|
||||||
fname = ''
|
|
||||||
cntChar = ''
|
cntChar = ''
|
||||||
first = True
|
first = True
|
||||||
# Constant variables
|
# Constant variables
|
||||||
@@ -38,7 +37,6 @@ class Instr_extractor(object):
|
|||||||
|
|
||||||
|
|
||||||
def extract_instr(self, asmFile):
|
def extract_instr(self, asmFile):
|
||||||
fname = asmFile
|
|
||||||
# Check if parameter is in the correct file format
|
# Check if parameter is in the correct file format
|
||||||
if(not self.is_elffile(asmFile)):
|
if(not self.is_elffile(asmFile)):
|
||||||
print('Invalid argument')
|
print('Invalid argument')
|
||||||
@@ -170,7 +168,7 @@ class Instr_extractor(object):
|
|||||||
|
|
||||||
|
|
||||||
def sort_db(self):
|
def sort_db(self):
|
||||||
self.sorted_db=sorted(self.db.items(), key=lambda x:x[1], reverse=True)
|
self.sorted_db=sorted(self.db.items(), key=lambda x:x[1], reverse=True)
|
||||||
|
|
||||||
|
|
||||||
def print_sorted_db(self):
|
def print_sorted_db(self):
|
||||||
@@ -185,10 +183,10 @@ class Instr_extractor(object):
|
|||||||
|
|
||||||
|
|
||||||
def save_db(self):
|
def save_db(self):
|
||||||
file = open('.cnt_asm_ops.db','w')
|
file = open('.cnt_asm_ops.db','w')
|
||||||
for i in self.db.items():
|
for i in self.db.items():
|
||||||
file.write(i[0]+'\t'+str(i[1])+'\n')
|
file.write(i[0]+'\t'+str(i[1])+'\n')
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
def load_db(self):
|
def load_db(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user