This is the convention I've been using:
  (1) To maintain instance variable naming conventions, I have named the
stats variables using lowerCamelCase.
  (2) For stat string output printed to stats.txt, I've used
lower_underscore.

It looks like the majority of stats.txt output strings are in
lower_underscore currently.  It's much easier to change instance variable
names than stats.txt output strings, so I'm hoping that this convention is
acceptable (I'm adding a bunch of stats for coordination with McPAT).

  Joel


On Thu, Nov 4, 2010 at 7:32 PM, nathan binkert <[email protected]> wrote:

> > 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.
> True.
>
> > 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.
>
> I have a slight preference to come up with some way to differentiate
> state vars from regular member vars.  The reason is that people try to
> use stats like normal vars and are confused when it doesn't work.
> Perhaps this is no big deal though.  Changing names might not be so
> nice because of scripts, but it'd be nice to get consistent (and do it
> once.)
>
> One inconsistency we also have is that most objects in config files
> are lower_with_under, and having stat vars match that means that
> foo.bar_blah.stat_with_under looks a bit better than
> foo.bar_blah.statCamelCase.  One thing I feel strongly about is that
> stat names and variable names should be valid identifiers in both
> python and C++.  We currently have some stats with :: in them and
> that's no good.
>
>  Nate
>
>  Nate
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
>



-- 
  Joel Hestness
  PhD Student, Computer Architecture
  Dept. of Computer Science, University of Texas - Austin
  http://www.cs.utexas.edu/~hestness
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to