api to get ratio of unmatched instructions

This commit is contained in:
Julian Hammer
2019-01-18 14:19:39 +01:00
parent 64de49d497
commit bac3104c0a
2 changed files with 12 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ class Scheduler(object):
'HSW': ['0DV'], 'BDW': ['0DV'],
'SKL': ['0DV'], 'SKX': ['0DV'],
'KBL': ['0DV'], 'CFL': ['0DV'],
'ZEN': ['0DV'],}
'ZEN': ['3DV'],}
# content of most inner list in instrList: instr, operand(s), instr form
df = None # type: DataFrame
# for parallel ld/st in archs with 1 st/cy and >1 ld/cy, able to do 1 st and 1 ld in 1cy
@@ -107,13 +107,14 @@ class Scheduler(object):
p_flg = ''
if self.en_par_ldst:
# Check for ld
# FIXME remove special load handling from here and place in machine model
if (isinstance(instrForm[-2], MemAddr) or
(len(instrForm) > 4 and isinstance(instrForm[2], MemAddr))):
if par_ldst > 0:
par_ldst -= 1
p_flg = 'P '
for port in self.ld_ports:
occ_ports[i][port] = '(' + str(occ_ports[i][port]) + ')'
occ_ports[i][port] = 0.0 # '(' + str(occ_ports[i][port]) + ')'
# Write schedule line
if len(p_flg) > 0:
sched += self.format_port_occupation_line(occ_ports[i], p_flg + instrForm[-1])

View File

@@ -561,6 +561,15 @@ class OSACA(object):
(port_name, port_binding[i])
for i, port_name in enumerate(self.schedule.get_port_naming())])
def get_unmatched_instruction_ratio(self):
"""
Calculate ratio of unmatched vs total instructions
:return: float
"""
sched_output, port_binding = self.schedule.new_schedule()
return sched_output.count('| X ') / len(self.instr_forms)
def get_total_throughput(self):
"""
Return total cycles estimated per block execution. Including (potential) penalties.