Example #1
0
    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]))
Example #2
0
    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]))
Example #3
0
def convert_meta_args(aConversionParms):
    if aConversionParms.meta_args is None:
        if (aConversionParms.plusargs is not None) and len(
                aConversionParms.cmp_plusargs):
            pass
        else:
            print('Meta args not specified.')
            sys.exit(1)

    meta_args = aConversionParms.meta_args

    if aConversionParms.rtl_root is None:
        rtl_root = os.environ.get("PROJ_ROOT", None)
        if rtl_root is None:
            print('No RTL root defined.')
            sys.exit(1)
    else:
        rtl_root = aConversionParms.rtl_root

    if not PathUtils.check_dir(rtl_root):
        print("RTL root does not exist or is not a directory: %s" % rtl_root)
        sys.exit(1)

    script_dir, script_name = PathUtils.split_path(
        PathUtils.real_path(sys.argv[0]))
    make_file_path = PathUtils.include_trailing_path_delimiter(
        script_dir) + "applications/rtl/MetaArgs.make"
    if not PathUtils.check_file(make_file_path):
        print("File not exist: %s" % make_file_path)
        sys.exit(1)

    #print("meta args %s, rtl root %s, make file: %s" % (meta_args, rtl_root, make_file_path))

    meta_args_conv = MetaArgsConversion(rtl_root, make_file_path)
    if aConversionParms.net:
        conversion_result = meta_args_conv.convertNetResult(meta_args)
    elif len(aConversionParms.cmp_plusargs):
        if (aConversionParms.plusargs
                is not None) and len(aConversionParms.plusargs) > 0:
            conversion_result = meta_args_conv.comparePlusAndPlus(
                aConversionParms.plusargs, aConversionParms.cmp_plusargs)
        else:
            conversion_result = meta_args_conv.compareMetaAndPlus(
                meta_args, aConversionParms.cmp_plusargs)
    else:
        conversion_result = meta_args_conv.convertRawResult(meta_args, True)
    print(conversion_result)
Example #4
0
    def __init__(self, aCmdLineOptions):
        super().__init__(CompileCmdLineOptions.cOptions, aCmdLineOptions)

        default_path = '$PROJ_ROOT/verif/top/sim'
        if self.mAppParameters.parameter(
                'compile') or self.mAppParameters.parameter(
                    'compile.options') or self.mAppParameters.parameter(
                        'compile.path') != default_path:
            compile_path = self.mAppParameters.parameter('compile.path')
            compile_path = PathUtils.expandVars(compile_path)
            compile_makefile = PathUtils.include_trailing_path_delimiter(
                compile_path) + 'Makefile'

            if not PathUtils.check_file(compile_makefile):
                raise Exception(compile_makefile + ' does not exist.')

            self.mAppParameters.setParameter('compile.path', compile_path)
            self.mAppParameters.setParameter(
                'compile.options',
                PathUtils.expandVars(
                    self.mAppParameters.parameter('compile.options')))
Example #5
0
    def __init__(self, aCmdLineOptions):
        super().__init__(CompileCmdLineOptions.cOptions, aCmdLineOptions)

        default_path = "$PROJ_ROOT/verif/top/sim"
        if (self.mAppParameters.parameter("compile")
                or self.mAppParameters.parameter("compile.options") or
                self.mAppParameters.parameter("compile.path") != default_path):
            compile_path = self.mAppParameters.parameter("compile.path")
            compile_path = PathUtils.expandVars(compile_path)
            compile_makefile = PathUtils.include_trailing_path_delimiter(
                compile_path) + "Makefile"

            if not PathUtils.check_file(compile_makefile):
                raise Exception(compile_makefile + " does not exist.")

            self.mAppParameters.setParameter("compile.path", compile_path)
            self.mAppParameters.setParameter(
                "compile.options",
                PathUtils.expandVars(
                    self.mAppParameters.parameter("compile.options")),
            )