On Thu, Nov 4, 2010 at 12:21 PM, nathan binkert <n...@binkert.org> wrote:

> >   I'm currently trying to leverage a Python script and McPAT to consume
> M5
> > statistics (stats.txt) and calculate power estimates for a simulated
> system.
> >  Stats variables in the SimObjects are lowerCamelCase according to the
> > coding style, but it looks like the names output to the stats.txt file
> are
> > mixed, either lowerCamelCase or lower_case_with_underscores.  I'm
> wondering
> > if there is a convention for statistic names that are output to the
> > stats.txt that I (we) can be aiming for.
>
> I don't think we have the convention written down, but I'd prefer that
> the names of the stats match their output.  I'd prefer if stats names
> were all lower_with_underscore since it would easily differentiate a
> stat from a regular variable.
>
> Anyone else have an opinion?
>
>
I think the current situation is basically historical... the stats names
with underscores were inherited from SimpleScalar, and then we we went with
camelCase for variable names there was an inherent mismatch that has at
times been perpetuated and at other times ignored.

It would be nice to have an official policy and to follow it for new stats,
and also go back and fix up existing stats to be consistent with that
policy.  I'm not a big fan of having stats variables be
lower_with_underscores since we already are supposed to be using that to
distinguish local variables from class members (though we're not very
consistent about that either).  If there's a desire to make the stats vars
consistent with the stats names, my preference would be to make the stats
names camelCase, but I can see where that could cause a lot of work for
people who have scripts that process stats.txt.

Steve
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to