示例#1
0
    def prepare(self):

        if self.root.startswith("$(") and self.root.endswith(")"):
            self.root = PathUtils.exclude_trailing_path_delimiter(
                SysUtils.envar(self.root[2:-1], None))

        self.default_fsdb_do = PathUtils.append_path(self.root,
                                                     self.default_fsdb_do)

        if self.regr.startswith("$(") and self.regr.endswith(")"):
            self.regr = PathUtils.exclude_trailing_path_delimiter(
                SysUtils.envar(self.regr[2:-1], "logs"))
        else:
            self.regr = "logs"

        if self.cfg.startswith("$(") and self.cfg.endswith(")"):
            self.cfg = PathUtils.exclude_trailing_path_delimiter(
                SysUtils.envar(self.cfg[2:-1], "target_config"))
        else:
            self.cfg = "config_name"

        if self.name.startswith("$(") and self.name.endswith(")"):
            self.name = PathUtils.exclude_trailing_path_delimiter(
                SysUtils.envar(self.name[2:-1], "uvm_simv_opt"))
        else:
            self.cfg = "uvm_simv_opt"

        self.path = PathUtils.exclude_trailing_path_delimiter(self.path)
        self.tgt = PathUtils.exclude_trailing_path_delimiter(self.tgt)

        self._debug_command = self.cmd % (self.root, self.path, self.regr,
                                          self.tgt, self.debug_cfg,
                                          self.debug_name)
示例#2
0
    def locate_directory( self, arg_cmd_switch, arg_envar, arg_default ):

        Msg.dbg( "arg_cmd_switch[%s], arg_envar[%s], arg_default[%s]" % (str(arg_cmd_switch), str(arg_envar), arg_default))
        my_tmp = self.option_def( arg_cmd_switch, None)
        # Msg.user( "Result Path: %s" % ( str( my_tmp )))

        if my_tmp is None:
            if arg_envar is not None:
                # Not passed on the command line check for envar and the default
                my_tmp = SysUtils.envar( arg_envar, arg_default, False )
            else:
                my_tmp = arg_default
            # If a relative path has been provided either in the environmental var or as the default that path needs
            # to be appended to the module path. Since all full paths begin with a path delimiter this is a valid test
            if my_tmp[0] != "/":
                my_tmp = PathUtils.include_trailing_path_delimiter( self.module_dir ) + my_tmp

        # OK here is where it gets a bit tricky, when passed on the command line the path is calculated from the
        # current directory, in all other cases from the module path. Since the app should be in the initial directory
        # calculating the real path should resolve to a fully qualified path. To remove all indirection use real path
        my_tmp = PathUtils.real_path( my_tmp )

        # At this point the path should be a fully qualified path
        # Msg.user( "Result Path: %s" % ( str( my_tmp )))
        #
        Msg.user( "Result Path: %s" % ( str( my_tmp )))
        if not PathUtils.valid_path( my_tmp ):
            raise FileNotFoundError( "Initial Directory for %s Resolution Failed[%s] could not be located" % ( arg_cmd_switch, my_tmp ))

        if not PathUtils.check_exe( my_tmp ):
            my_tmp = PathUtils.include_trailing_path_delimiter( my_tmp )

        return my_tmp
示例#3
0
    def check_simulator(self):
        if SysUtils.check_host("SAN"):
            Msg.dbg("System is in Green Zone .....")
            my_gcc_path = "/project/software/public/gcc/5.1/centos6.6/lib64"
            my_lib_path = SysUtils.envar("LD_LIBRARY_PATH", None)

            if not my_lib_path:
                SysUtils.envar_set("LD_LIBRARY_PATH", my_gcc_path)
            elif my_lib_path.find(my_gcc_path) < 0:
                SysUtils.envar_set("LD_LIBRARY_PATH",
                                   "%s:%s" % (my_gcc_path, my_lib_path))

            Msg.dbg("LD_LIB_PATH: %s " % (str(my_lib_path)))
            Msg.dbg('"LD_LIBRARY_PATH" = %s' %
                    (str(SysUtils.envar("LD_LIBRARY_PATH", None))))

        else:
            Msg.dbg("System is Red Zone or Yellow Zone")

        return True