On Fri, Oct 22, 2010 at 3:12 PM, nathan binkert <[email protected]> wrote:
>> So I guess the upshot is that if there are complex Ruby types (not
>> just typedefs of builtin types) that want to have standard ways of
>> printing themselves out, that's kind of inconsistent with M5 right
>> there :-), but if you want to keep that behavior then overloading
>> operator<< is the way to do it.
>
> Gabe is adding a PC type though and I believe he's overloading
> operator<<.  I generally think that this is a pretty nice thing to do.
>  It's more or less analagous to implementing __str__ in python which
> is a pretty nice thing to have, so I'd say that Ruby is pushing a good
> idea into M5.

Yea, I didn't mean to imply that M5's way was better, just that Brad's
observation of Ruby's inconsistency with M5 was maybe focused on a
symptom and not on the cause.  There probably are places where M5's
debug output could be improved by using operator<<,  for example it
would be nice to standardize on whether we print 0x in front of
addresses in cache traces.  Ruby's practice of always printing both
the byte address and the block address is also interesting, though
personally I find that pretty redundant and I've become practiced at
creating regexes that can capture all the byte addresses within a
block so it's pretty easy to egrep out the trace entries that relate
to a particular block.

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

Reply via email to