def process_result( self ): Msg.info( "HiMutex: Process Test Result ..." )
def on_before_unsignal( self, arg_sender ): if type( arg_sender ) is not HiEvent: raise EIncompatableTypeError( "Event Notification Contained Incompatable Type" ) Msg.info( "Event[%s] is about to be unsignaled ... " % ( arg_sender.name ))
def process_summary_totals(self, arg_ofile, arg_instr_count, arg_cycle_count): Msg.blank("info") # generator totals my_gfails = self.gen_total - self.gen_passed my_lines = "\nGenerate : %3d\n" % (self.gen_total) my_lines += "Generate Fails: %3d\n" % (my_gfails) my_lines += "Generate Success Rate : %5.2f%%\n" % ( SysUtils.percent(self.gen_passed, self.gen_total) ) my_lines += "\n" my_sfails = 0 if self.iss_total > 0: # ISS sim totals my_sfails = self.iss_total - self.iss_passed my_lines += "ISS Sim : %3d\n" % (self.iss_total) my_lines += "ISS Sim Fails: %3d\n" % (my_sfails) my_lines += "ISS Sim Success Rate : %5.2f%%\n" % ( SysUtils.percent(self.iss_passed, self.iss_total) ) my_lines += "\n" my_lines += "Total Instructions Emulated: %3d\n" % (arg_instr_count) my_lines += "\n" my_rfails = 0 if self.rtl_total > 0: # RTL sim totals my_rfails = self.rtl_total - self.rtl_passed my_lines += "RTL Sim : %3d\n" % (self.rtl_total) my_lines += "RTL Sim Fails: %3d\n" % (my_rfails) my_lines += "RTL Sim Success Rate : %5.2f%%\n" % ( SysUtils.percent(self.rtl_passed, self.rtl_total) ) my_lines += "\n" my_lines += "Total Cycle Count: %3d\n" % (arg_cycle_count) my_lines += "\n" my_cfails = 0 if self.trace_cmp_total > 0: # simulation totals my_cfails = self.trace_cmp_total - self.trace_cmp_passed my_lines += "Compared : %3d\n" % (self.trace_cmp_total) my_lines += "Compare Fails: %3d\n" % (my_cfails) my_lines += "Compare Success Rate : %5.2f%%\n" % ( SysUtils.percent(self.trace_cmp_passed, self.trace_cmp_total) ) my_lines += "\n" # task totals my_task_total = self.task_total my_total_fails = my_gfails + my_sfails + my_cfails + my_rfails my_lines += "Total Tasks : %3d\n" % (my_task_total) my_lines += "Task Fails : %3d\n" % (my_total_fails) my_lines += "Task Success Rate: %5.2f%%\n" % ( SysUtils.percent(my_task_total - my_total_fails, (my_task_total)) ) my_lines += "\n" my_lines += "Total Run Time: %0.5f Seconds" % (DateTime.Time() - self.start_time) Msg.blank("info") Msg.info(my_lines) Msg.blank("info") arg_ofile.write(my_lines)
def thread_finished( self ): Msg.info( "UnitTest_NoLoopThread >> Exiting .... " ) if self.finished_event is not None: self.finished_event.Signaled() self.finished_event.Signal() self.finished_event.Signaled( True )
def process_result( self ): Msg.info( "HiThread(NoLoop): Process Test Results... " )
def thread_done ( self ): Msg.info( "UnitTest_LoopThread << Execute Done .... " ) Msg.blank()
def thread_start( self ): Msg.info( "UnitTest_NoLoopThread >> Started .... " ) if self.start_event is not None: self.start_event.Signaled() self.start_event.Signal() self.start_event.Signaled( True )
def process_result( self ): Msg.info( "HiCriticalSection: Process Test Result ..." )
def run_test(self): Msg.info("HiStack: Start Unit Test ...")
def process_result(self): Msg.info("HiSemaphore: Process Test Result ...")
def _getWorkflow(self, aConfigPath): # Check workflow in config file first try: Msg.info('Using workflow from: %s' % aConfigPath) config_module = SourceFileLoader('config', aConfigPath).load_module() return (config_module.single_run_app_opts, config_module.sequence_app_opts) except AttributeError: # aConfigPath is None or the specified config file does not contain workflow if aConfigPath: Msg.info('Workflow improperly defined in %s' % aConfigPath) else: Msg.info('Config not specified.') # Check environment variable next try: Msg.info( 'Attempting to use MASTER_RUN_CONFIG environment variable.') config_module = SourceFileLoader( 'config', os.environ.get('MASTER_RUN_CONFIG')).load_module() return (config_module.single_run_app_opts, config_module.sequence_app_opts) except AttributeError: if os.environ.get('MASTER_RUN_CONFIG'): Msg.info( 'Workflow improperly defined in MASTER_RUN_CONFIG: %s' % os.environ.get('MASTER_RUN_CONFIG')) else: Msg.info('MASTER_RUN_CONFIG environment variable is not set.') except FileNotFoundError: # MASTER_RUN_CONFIG environment variable is set, but cannot be found Msg.err( 'MASTER_RUN_CONFIG is currently set to %s. Please ensure that it exists.' % os.environ.get('MASTER_RUN_CONFIG')) sys.exit(1) # Assume typo so quit # Use default last try: default_config_file = '%s/config/%s' % (sys.path[0], Defaults.fcfg_name) Msg.info('Using workflow from default config file: %s' % default_config_file) config_module = SourceFileLoader( 'config', default_config_file).load_module() return (config_module.single_run_app_opts, config_module.sequence_app_opts) except FileNotFoundError: # default config file cannot be found Msg.err('Please ensure the default config file exists.') sys.exit(1) # Assume typo so quit
def run_test(self): Msg.info("HiSemaphore: Start Unit Test ...")
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]))
def run_test(self): Msg.info("HiThread: Start all Thread Unit Tests ... ") UnitTest_NoLoopThread().run() UnitTest_LoopThread().run()
def thread_start( self ): Msg.info( "UnitTest_LoopThread >> Started .... " )
def process_result(self): Msg.info("HiStack: Process Test Result ...")
def thread_execute( self ): Msg.info( "UnitTest_LoopThread << Executing .... " )
def report(self): if self.default is None: self.default = 0 if self.secondary is None: self.secondary = 0 if self.total is None: self.total = 0 Msg.info("Task Id: %s, Task Index: %d" % (self.task_id, self.task_index)) my_msg = "Process Log Contains " if (self.detail_flags & SummaryDetail.AnyDetail == SummaryDetail.Nothing): my_msg = "Process No Found or is Empty" else: if (self.detail_flags & SummaryDetail.GenCmd == SummaryDetail.GenCmd): my_msg += "GenCmd, " if (self.detail_flags & SummaryDetail.GenResult == SummaryDetail.GenResult): my_msg += "GenResult, " if (self.detail_flags & SummaryDetail.IssCmd == SummaryDetail.IssCmd): my_msg += "IssCommand, " if (self.detail_flags & SummaryDetail.IssResult == SummaryDetail.IssResult): my_msg += "IssResult, " if (self.detail_flags & SummaryDetail.TraceCmpCmd == SummaryDetail.TraceCmpCmd): my_msg += "TraceCmpCommand, " if (self.detail_flags & SummaryDetail.TraceCmpResult == SummaryDetail.TraceCmpResult): my_msg += "TraceCmpResult, " # remove the trailing comma my_msg = my_msg[:-2] Msg.user(my_msg, "SUM-RPT") Msg.user("Force Return Code: %s" % (str(self.force_retcode)), "SUM-RPT") # Msg.trace() # Msg.info( "Originating Control File: %s" % ( self.parent_fctrl )) # Msg.info( "Control File Item: %s" % ( str( self.fctrl_item ))) 2 # Msg.info( "F-Run Control File: %s" % ( self.frun_path )) Msg.dbg("Force Ret Code: %s" % (str(self.force_retcode))) if SysUtils.success(self.force_retcode): Msg.info("[SUCCESS] Generate Command: %s" % (str(self.force_cmd))) Msg.info("Instructions Generated - " "Default: %d, Secondary: %d, Total: %d" % (self.default, self.secondary, self.total)) elif self.signal_id is not None: Msg.info("[INCOMPLETE] Generate Command: %s" % (str(self.force_cmd))) Msg.info("No Instructions Generated") else: Msg.info("[FAILED] Generate Command: %s" % (str(self.force_cmd))) Msg.info("No Instructions Generated") if self.iss_cmd is not None: if self.iss_success(): Msg.info("[SUCCESS] ISS Command: %s" % (str(self.iss_cmd))) elif self.signal_id is not None: Msg.info("[INCOMPLETE] ISS Command: %s" % (str(self.iss_cmd))) else: Msg.info("[FAILED] ISS Command: %s" % (str(self.iss_cmd))) # Msg.fout( self.iss_log, "user" ) if self.rtl_cmd is not None: if SysUtils.success(self.rtl_retcode): Msg.info("[SUCCESS] RTL Command: %s" % (str(self.rtl_cmd))) Msg.info("Cycle count : %d" % (self.cycle_count)) elif self.signal_id is not None: Msg.info("[INCOMPLETE] RTL Command: %s" % (str(self.rtl_cmd))) else: Msg.info("[FAILED] RTL Command: %s" % (str(self.rtl_cmd))) if (self.detail_flags & SummaryDetail.TraceCmpCmd == SummaryDetail.TraceCmpCmd): Msg.info("Comparing Simulation output .... ") if SysUtils.success(self.trace_cmp_retcode): Msg.info("[SUCCESS] Trace Compare Command: %s" % (str(self.trace_cmp_cmd))) elif self.signal_id is not None: Msg.info("[INCOMPLETE] Trace Compare Command: %s" % (str(self.trace_cmp_cmd))) else: Msg.info("[FAILED] Trace Compare Command: %s" % (str(self.trace_cmp_cmd))) Msg.blank()
def run_thread( self ): Msg.info( "UnitTest_HiEvent >> Initializing Thread ... " ) self.thread.start_thread() # wait for thread to terminate self.thread.wait_for() Msg.info( "UnitTest_HiEvent >> Thread Completed ... " )
def execute(self): Msg.info("Begin: NoLoopThread::execute()") for i in range(5): Msg.info("Thread Work: %d" % (i)) Msg.info("End: NoLoopThread::execute()")
def thread_done ( self ): Msg.info( "UnitTest_NoLoopThread << Execute Done .... " ) if self.done_event is not None: self.done_event.Signaled() self.done_event.Signal() self.done_event.Signaled( True )
def _getWorkflow(self, aConfigPath): """Retrieve workflow from the provided path to add to aSysArgs to parse when building mCmdLineOpts later""" # Check workflow in config file first try: Msg.info("Using workflow from: %s" % aConfigPath) config_module = SourceFileLoader("config", aConfigPath).load_module() return ( config_module.single_run_app_opts, config_module.sequence_app_opts, ) except AttributeError: # aConfigPath is None or the specified config file does not # contain workflow if aConfigPath: Msg.info("Workflow improperly defined in %s" % aConfigPath) else: Msg.info("Config not specified.") # Check environment variable next try: Msg.info("Attempting to use MASTER_RUN_CONFIG environment variable.") config_module = SourceFileLoader( "config", os.environ.get("MASTER_RUN_CONFIG") ).load_module() return ( config_module.single_run_app_opts, config_module.sequence_app_opts, ) except AttributeError: if os.environ.get("MASTER_RUN_CONFIG"): Msg.info( "Workflow improperly defined in MASTER_RUN_CONFIG: " "%s" % os.environ.get("MASTER_RUN_CONFIG") ) else: Msg.info("MASTER_RUN_CONFIG environment variable is not set.") except FileNotFoundError: # MASTER_RUN_CONFIG environment variable # is set, but cannot be found Msg.err( "MASTER_RUN_CONFIG is currently set to %s. " "Please ensure that it exists." % os.environ.get("MASTER_RUN_CONFIG") ) sys.exit(1) # Assume typo so quit # Use default last try: default_config_file = "%s/config/%s" % ( sys.path[0], Defaults.fcfg_name, ) Msg.info("Using workflow from default config file: %s" % default_config_file) config_module = SourceFileLoader("config", default_config_file).load_module() return ( config_module.single_run_app_opts, config_module.sequence_app_opts, ) except FileNotFoundError: # default config file cannot be found Msg.err("Please ensure the default config file exists.") sys.exit(1) # Assume typo so quit
def run_test( self ): Msg.info( "HiEvent: Start Unit Test ..." ) my_wrapper = ThreadWrapper() my_wrapper.run_thread()
def run_test( self ): Msg.info( "HiThread: Start all Thread Unit Tests ... " ) with UnitTest_NoLoopThread(): pass with UnitTest_LoopThread(): pass
def process_result( self ): Msg.info( "HiEvent: Process Test Result ..." )
def process_result( self ): Msg.info( "HiThread: Process All Thread Test Results ... " )
def on_after_unsignal( self, arg_sender ): if type( arg_sender ) is not HiEvent: raise EIncompatableTypeError( "Event Notification Contained Incompatable Type" ) Msg.info( "Event[%s] has been unsignaled ... " % ( arg_sender.name ))
def thread_finished( self ): Msg.info( "UnitTest_NoLoopThread >> Exiting .... " )
def run_test(self): Msg.info("HiCriticalSection: Start Unit Test ...")
def run_test( self ): Msg.info( "HiMutex: Start Unit Test ..." ) # test with construct! self.with_test()