On Wed, 6 Jul 2011, Steve Reinhardt wrote:

Can't we just resolve whatever the conflicts are?

Or we could go back to having a ruby_se.py, but have it be a link to se.py,
and use sys.argv[0] to decide whether to look for the ruby args?  (Not
pretty, but sort of backwards compatible without duplicating code.)

I don't fully understand the problem, which can actually be somewhat
liberating when it comes to proposing solutions :-).


I am not in favor of having a separate script for using ruby. I was looking at fs.py and ruby_fs.py on Sunday, at least one option (--kernel) available with fs in not available with ruby_fs. There might be more. Similarly, there are separate functions for creating full systems for Alpha architecture that use classic and ruby memory systems respectively.

Here is a piece of code from se.py --

(options, args) = parser.parse_args()

if options.ruby:
    Ruby.define_options(parser)
    (options, args) = parser.parse_args()


My understanding is that we are looking if ruby has been specified as an option. If yes, then we add all options that Ruby provides and parse the arguments again.

The problem is that if ruby and any options provided by ruby are specified, the script ends in an error with the message that the option, other than ruby, is not available. For example
         se.py --ruby --topology Crossbar
would result in an error, which I think should work correctly.

We want that certain options be enabled only if ruby has been specified.
From the documentation of optparser and argparser, the solutions that I
think will work --
* positional arguments (which Steve suggests above),
 * callback on all ruby options,
 * sub-parser for ruby options (only available from python 2.7 onwards).

--
Nilay

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to