Ejemplo n.º 1
0
    def AddAdditionalOptions(self, parser):
        """Add any additional options besides the default for all *_dir.py scripts."""

        cmd_options.processor(parser, '')
        cmd_options.simhome(parser, '')
        cmd_options.sim_options(parser, '')
        cmd_options.verify(parser, '')
Ejemplo n.º 2
0
    def AddVerifyOptions(self, parser):
        """
        Add the options which used for LIT file verification.

        @param parser Optparse object

        @return No return value
        """

        # Top level command line options which only apply to the LIT file verification phase.
        #
        verify_LIT_group = cmd_options.VerifyLITPhaseGroup(parser)

        # cmd_options.archsim_cf_file(parser, verify_LIT_group)
        cmd_options.archsim_config_dir(parser, verify_LIT_group)
        cmd_options.simhome(parser, verify_LIT_group)
        cmd_options.sim_options(parser, verify_LIT_group)
        cmd_options.processor(parser, verify_LIT_group)

        parser.add_option_group(verify_LIT_group)
Ejemplo n.º 3
0
    def ParseCommandLine(self):
        """
        Process command line arguments. Generate pin and tool options, and their paths.
        """

        # import pdb;  pdb.set_trace()
        version = '$Revision: 1.14 $'
        version = version.replace(' ', '')
        ver = version.replace(' $', '')
        us = '%prog [options] trace_basename \nVersion: ' + ver
        desc = 'Run a simulator on a trace.'
        util.CheckNonPrintChar(sys.argv)
        parser = optparse.OptionParser(usage=us, version=ver, description=desc)

        # Define the command line options which control the behavior of the
        # script.
        #
        # Some of these methods take a 2nd argument which is the empty string
        # ''.  If this script used option groups, then the 2nd parameter would
        # be the group.  However, this script does not use option groups, so
        # the argument is empty.
        #
        cmd_options.config_file(parser)
        cmd_options.debug(parser)
        cmd_options.global_file(parser)
        cmd_options.list(parser, '')
        cmd_options.processor(parser, '')
        cmd_options.save_global(parser)
        cmd_options.simhome(parser, '')
        cmd_options.sim_options(parser, '')
        cmd_options.trace_basename(parser)
        cmd_options.verbose(parser)
        cmd_options.verify(parser, '')

        self.AddAdditionalCmdOptions(parser)

        # import pdb;  pdb.set_trace()
        (options, args) = parser.parse_args()

        # Check to make sure the trace basename has been given as an argument.
        #
        # import pdb;  pdb.set_trace()
        if len(sys.argv) == 1 or len(args) == 0:
            msg.PrintMsg(
                "ERROR: Must have a trace basename on the command line.\n"
                "Usage: %s [options] trace_basename" %
                os.path.basename(sys.argv[0]))
            util.CheckResult(-1, options, 'Checking command line options')
        options.trace_basename = args[0]

        # Read in optional configuration files and set global variables.
        #
        config_obj = config.ConfigClass()
        config_obj.GetCfgGlobals(options,
                                 False)  # Don't need all 4 required parameters

        # Just need this parameter.
        #
        self.Config.CheckRequiredParameter('processor')

        # Initialize the kit after reading in parameters, in case the user
        # specified anything which is used to intialize the kit.
        #
        self.kit = self.GetKit()

        return options