From f7b26d5e1640090dfe07069a9a1f6d5402370b06 Mon Sep 17 00:00:00 2001 From: JanLJL Date: Fri, 3 May 2019 10:44:54 +0200 Subject: [PATCH] enabled instruction forms without any operands --- osaca/eu_sched.py | 7 +++++-- osaca/testcase.py | 28 ++++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/osaca/eu_sched.py b/osaca/eu_sched.py index 765d7ab..81c279e 100755 --- a/osaca/eu_sched.py +++ b/osaca/eu_sched.py @@ -89,7 +89,7 @@ class Scheduler(object): # Check if there's a port occupation stored in the CSV, otherwise leave the # occ_port list item empty for i, instrForm in enumerate(self.instrList): - search_string = instrForm[0] + '-' + self.get_operand_suffix(instrForm) + search_string = instrForm[0] + self.get_operand_suffix(instrForm) try: entry = self.df.loc[lambda df, sStr=search_string: df.instr == sStr] tup = entry.ports.values[0] @@ -426,6 +426,9 @@ class Scheduler(object): Operand suffix for searching in data file """ op_ext = [] + operands = '' + if len(instr_form) > 2: + operands = '-' for i in range(1, len(instr_form) - 1): if isinstance(instr_form[i], Register) and instr_form[i].reg_type == 'GPR': optmp = 'r' + str(instr_form[i].size) @@ -434,7 +437,7 @@ class Scheduler(object): else: optmp = str(instr_form[i]).lower() op_ext.append(optmp) - operands = '_'.join(op_ext) + operands += '_'.join(op_ext) return operands diff --git a/osaca/testcase.py b/osaca/testcase.py index 4e85613..06395e4 100755 --- a/osaca/testcase.py +++ b/osaca/testcase.py @@ -78,9 +78,10 @@ class Testcase(object): self.loop_lat = self.__define_loop_lat() self.loop_thrpt = self.__define_loop_thrpt() # Create extension for testcase name + sep0 = '-' if (self.num_operands > 0) else '' sep1 = '_' if (self.num_operands > 1) else '' sep2 = '_' if (self.num_operands > 2) else '' - self.extension = ('-' + (self.op_a if ('gpr' not in self.op_a) else 'r' + self.op_a[3:]) + self.extension = (sep0 + (self.op_a if ('gpr' not in self.op_a) else 'r' + self.op_a[3:]) + sep1 + (self.op_b if ('gpr' not in self.op_b) else 'r' + self.op_b[3:]) + sep2 + (self.op_c if ('gpr' not in self.op_c) else 'r' + self.op_c[3:])) @@ -131,15 +132,16 @@ class Testcase(object): operands = self.param_list op_a, op_b, op_c = ('', '', '') gpr_push, gpr_pop, zero_gpr = ('', '', '') - if isinstance(operands[0], Register): - op_a = operands[0].reg_type.lower() - elif isinstance(operands[0], MemAddr): - op_a = 'mem' - elif isinstance(operands[0], Parameter) and str(operands[0]) == 'IMD': - op_a = 'imd' - if op_a == 'gpr': - gpr_push, gpr_pop, zero_gpr = self.__initialise_gprs() - op_a += str(operands[0].size) + if len(operands) > 0: + if isinstance(operands[0], Register): + op_a = operands[0].reg_type.lower() + elif isinstance(operands[0], MemAddr): + op_a = 'mem' + elif isinstance(operands[0], Parameter) and str(operands[0]) == 'IMD': + op_a = 'imd' + if op_a == 'gpr': + gpr_push, gpr_pop, zero_gpr = self.__initialise_gprs() + op_a += str(operands[0].size) if len(operands) > 1: if isinstance(operands[1], Register): op_b = operands[1].reg_type.lower() @@ -301,6 +303,9 @@ class Testcase(object): """ loop_lat = ('loop:\n' '\t\tinc i\n') + if self.num_operands == 0: + for i in range(0, int(self.num_instr)): + loop_lat += '\t\tINSTR\n' if self.num_operands == 1: for i in range(0, int(self.num_instr)): loop_lat += '\t\tINSTR {}\n'.format(self.ops[self.op_a][0]) @@ -356,6 +361,9 @@ class Testcase(object): ext1 = True ext2 = True for i in range(0, int(self.num_instr)): + if self.num_operands == 0: + loop_thrpt += '\t\tINSTR\n' + continue if ext1: ext = ', {}'.format(self.ops[self.op_b][i % 3]) if ext2: