def execute(self): # super().execute() # Msg.dbg("ExecuteController::exec_gen(%s)" % (arg_task_file)) # NOTE: Do not change force_cmd may need to reuse!! my_log = "gen.log" # arg_testname.replace(".py", ".gen.log") my_elog = "gen.err" # arg_testname.replace(".py", ".gen.log") my_cmd = self.force_cmd % (self.task_file) # , my_log) # Msg.info("ForceCommand = " + str({ GenerateKeys.gen_cmd: my_cmd, GenerateKeys.gen_log: my_log, GenerateKeys.gen_elog: my_elog }), True) Msg.info( "GenCmd = " + str({ GenerateKeys.gen_app: "force", GenerateKeys.gen_cmd: my_cmd, GenerateKeys.gen_log: my_log, GenerateKeys.gen_elog: my_elog, "max-instr": self.ctrl_item.max_instr, "min-instr": self.ctrl_item.min_instr }), True) my_return = SysUtils.exec_process(my_cmd, my_log, my_elog, self.ctrl_item.timeout, True) # the return from exec_process is a tuple, see generate_executor.py, retcode, stdout, stderr, start-time, end-time my_results = self.extract_results(my_return, "./" + my_log, "./" + my_elog) Msg.info("GenResult = " + str(my_results)) Msg.flush() return SysUtils.success(int(my_return[GenerateResult.process_retcode]))
def execute( self ): my_result = None test_passed = True try: self.build_cmd() self.copyWavesFsdbDoFile() self.outputRerunScript() # report the command line Msg.info( "RTLCommand = " + str( { "rtl-command": self.rtl_cmd } )) # execute the simulation my_result = SysUtils.exec_process( self.rtl_cmd, self.rtl_log, self.rtl_log, self.ctrl_item.timeout, True ) Msg.user( "Results: %s" % ( str( my_result )), "RTLEX-RESULT" "") my_extract_results = self.extract_results( my_result, "./" + self.rtl_log, None ) # report the results Msg.info( "RTLResult = " + str( my_extract_results )) except Exception as arg_ex: Msg.error_trace( "RTL Process Failure" ) Msg.err( "RTL did not properly execute, Reason: %s" % ( str( arg_ex ))) return False finally: pass #return SysUtils.success( int(my_result[ RtlResult.process_retcode ]) ) return test_passed
def execute(self): if not PathUtils.check_file("./_def_frun.py"): Msg.user( "[FrunToCtrlExecutor::skip] skipping since no _def_frun.py found" ) return True my_cmd = self.mFrunToCtrlCmd if my_cmd is None: Msg.user( "[FrunToCtrlExecutor::skip] skipping since no path was given") return True Msg.user("FrunToCtrlCommand = " + str({"frun-to-ctrl-cmd": my_cmd})) Msg.flush() self.log = "frun_to_ctrl_result.log" self.elog = "frun_to_ctrl_result.err" my_result = SysUtils.exec_process(my_cmd, self.log, self.elog, self.ctrl_item.timeout, True) Msg.user("FrunToCtrlResult = " + str(my_result)) Msg.flush() return SysUtils.success(int(my_result[0]))
def post(self): if self.ctrl_item.compile.get('mp'): lsu_folder = PathUtils.real_path('%s/../../../rtl/lsu' % self.mMakefilePath) cmd = 'svn revert %s/lsu_scb_retire_ctrl.vp %s/lsu_scb_sca_array.vp %s/lsu_scb_scd_array.vp' % (lsu_folder, lsu_folder, lsu_folder) Msg.user('MP post-compile command = %s' % cmd) result = SysUtils.exec_process(cmd, self.log, self.elog, self.ctrl_item.timeout, True) Msg.user('MP post-compile command = %s' % str(result))
def launch(self): self.process_cmd, my_process_log = self.build() my_timeout = self.timeout # cif not self.red_zone else None self.process_result = SysUtils.exec_process(self.process_cmd, my_process_log, my_process_log, my_timeout) Msg.user("Process Results: %s" % (str(self.process_result)), "LSF-LAUNCHER")
def execute(self): if not PathUtils.check_file("sim.log"): Msg.info( "[TracediffRiscVExecutor::skip] skipping since no sim.log found" ) return True if not PathUtils.check_file("fpix_sim.log"): Msg.info( "[TracediffRiscVExecutor::skip] skipping since fpx_sim.log not found" ) return True my_cmd = "diff -y fpix_sim.log sim.log | grep -ve \"---\" | grep -vie \"exi\" | grep -vie \"exe\" | grep -ve \"_t\"" self.log = "tracediff_result.log" # arg_testname.replace( ".py", ".pgen.log" ) self.elog = "tracediff_result.err" # arg_testname.replace( ".py", ".gen.log" ) my_result = SysUtils.exec_process(my_cmd, self.log, self.elog, self.ctrl_item.timeout, True) my_use_result = None vbar_symbol_count = 0 exception_count = 0 success = False with open(self.log, 'r') as results_file: for line in results_file: vbar_symbol_count += line.count('|') if "Excpt ID 0x2" in line: exception_count = exception_count + 1 if vbar_symbol_count == 0 and exception_count == 0: success = True my_use_result = list(my_result) my_use_result[0] = int( not success ) #This inversion is necessary because int 0 means success to the Summary class. with open(self.log, 'a') as out_file: if success == False: out_file.write( "tracediff_riscv.log fail, look for | symbols or 'Excpt ID 0x2'; " + str(vbar_symbol_count) + " mismatches, and up to " + str(exception_count) + " suspicious exceptions.") else: out_file.write( "tracediff_riscv.log success, only bootcode difference between standalone and interactive as expected." ) Msg.info("CMPCommand = " + str({"trace-cmp-cmd": my_cmd})) my_extract_results = self.extract_results(my_use_result, "./" + self.log, None) Msg.info("CMPResult = " + str(my_extract_results)) Msg.flush() #return SysUtils.success(0) #[0,1,2] #Doesn't seem to really matter what this is, the Summary system needs fixing. return SysUtils.success(int(my_result[ToolResult.process_retcode]))
def launch( self ): Msg.user( "Timeout: %s" % ( str( self.timeout )), "STD-LAUNCHER" ) self.process_cmd, self.process_log = self.build() Msg.user( "Process Cmd: %s, Process Log: %s" % ( str( self.process_cmd ), str( self.process_log )), "STD-LAUNCHER" ) Msg.user( "Launcher Id 1: %s" % ( str( id( self ))), "STD-LAUNCHER" ) # enable timeout but only trigger shutdown of spawned process allow that process to kill the child processes. self.process_result = SysUtils.exec_process( self.process_cmd, self.process_log, self.process_log, self.timeout, False, self.set_process ) Msg.user( "Launcher Id 2: %s" % ( str( id( self ))), "STD-LAUNCHER" ) Msg.user( "Process Results: %s" % ( str( self.process_result )), "STD-LAUNCHER" )
def post(self): if self.ctrl_item.compile_rtl.get("mp"): lsu_folder = PathUtils.real_path("%s/../../../rtl/lsu" % self.mMakefilePath) cmd = ("svn revert %s/lsu_scb_retire_ctrl.vp " "%s/lsu_scb_sca_array.vp %s/lsu_scb_scd_array.vp" % (lsu_folder, lsu_folder, lsu_folder)) Msg.user("MP post-compile command = %s" % cmd) result = SysUtils.exec_process(cmd, self.log, self.elog, self.ctrl_item.timeout, True) Msg.user("MP post-compile command = %s" % str(result))
def pre(self): if self.ctrl_item.compile_rtl.get("mp"): cmd = "%s/script/lsu_resize.py -scd_num %d -sca_num %d -scb_starve %d" % ( self.mMakefilePath, randint(1, 16), randint(1, 12), randint(0, 1), ) Msg.user("MP pre-compile command = %s" % cmd) result = SysUtils.exec_process(cmd, self.log, self.elog, self.ctrl_item.timeout, True) Msg.user("MP pre-compile command result = %s" % str(result))
def execute(self): try: cmd = 'make compile -C %s %s' % (self.mMakefilePath, self.mOptions) Msg.user('Compile command = ' + str({'compile-cmd':cmd})) result = SysUtils.exec_process(cmd, self.log, self.elog, self.ctrl_item.timeout, True) Msg.user('Compile result = ' + str(result)) except: print('[CompileExecutor] problem in execute method: ', sys.exc_info()[0]) raise return SysUtils.success(int(result[0]))
def execute(self): try: cmd = "make compile -C %s %s" % (self.mMakefilePath, self.mOptions) Msg.user("Compile command = " + str({"compile-cmd": cmd})) result = SysUtils.exec_process(cmd, self.log, self.elog, self.ctrl_item.timeout, True) Msg.user("Compile result = " + str(result)) except BaseException: print( "[CompileExecutor] problem in execute method: ", sys.exc_info()[0], ) raise return SysUtils.success(int(result[0]))
def execute(self): my_result = None try: if self.ctrl_item.suffix is not None: my_task_name = self.task_name.replace( "_force", "_%s_force" % (str(self.ctrl_item.suffix))) else: my_task_name = self.task_name my_elf = self.locate_test_case("*.Default.ELF", my_task_name) my_log = self.sim_log my_elog = self.sim_log if 'cfg' not in self.ctrl_item.fpix_riscv.keys(): Msg.err( "Fpix_ISS did not properly execute, Reason: Fpix config was not specified" ) return False if 'fpix_path' not in self.ctrl_item.fpix_riscv.keys(): Msg.err( "FpixExecutor::execute: did not recieve a path to Fpix application fpix_path." ) raise else: self.mFpixPath = self.ctrl_item.fpix_riscv['fpix_path'] #build the sim_cmd now that we have full information available self.sim_cmd = "%s --railhouse %s --cluster_num %d --core_num %d --threads_per_cpu %d -i %d --cfg %s" % ( self.mFpixPath, self.MY_RAILHOUSE_LOG, self.ctrl_item.num_chips, self.ctrl_item.num_cores, self.ctrl_item.num_threads, self.ctrl_item.max_instr, self.ctrl_item.fpix_riscv['cfg']) #if not self.ctrl_item.fpix_riscv is None and type( self.ctrl_item.fpix_riscv) is dict: # self.sim_cmd += self.addDictOptions(self.ctrl_item.fpix_riscv, ['fpix_path', 'skip']) #self.sim_cmd += self.addDefaultOptions(self.sim_cmd, self.cDefaultOptions) # add default options if not already there. self.sim_cmd += " %s" # initalize the iss summary my_cmd = self.sim_cmd % (my_elf) # report the command line Msg.info("ISSCommand = " + str({"command": my_cmd})) # execute the simulation my_result = SysUtils.exec_process(my_cmd, my_log, my_elog, self.ctrl_item.timeout, True) my_extract_results = self.extract_results(my_result, my_log, my_elog) # report the results Msg.info("ISSResult = " + str(my_extract_results)) # Fpix riscv is not made to provide the sort of information that the message system expects. # Almost anything here will cause the next app not to run. #Msg.info( "Fpix_ISSResult = " ) except Exception as arg_ex: Msg.error_trace("Fpix_ISS Execute Failure") Msg.err("Fpix_ISS did not properly execute, Reason: %s" % (str(arg_ex))) return False finally: pass return SysUtils.success(int(my_result[IssResult.process_retcode]))