Re: [m5-dev] Statistics Output Conventions

2010-11-11 Thread nathan binkert
 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).

That's more or less what I've always been using.  I think that we
should either stick to it, or if we change something, change #1 to
match #2.

  Nate
___
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev


Re: [m5-dev] Statistics Output Conventions

2010-11-11 Thread Steve Reinhardt
On Thu, Nov 11, 2010 at 7:29 PM, nathan binkert n...@binkert.org wrote:

  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).

 That's more or less what I've always been using.  I think that we
 should either stick to it, or if we change something, change #1 to
 match #2.


I'd be happy if we made this approach the official one.

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


[m5-dev] Statistics Output Conventions

2010-11-04 Thread Joel Hestness
Hi,
  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.
  Thanks,
  Joel

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


Re: [m5-dev] Statistics Output Conventions

2010-11-04 Thread Steve Reinhardt
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


Re: [m5-dev] Statistics Output Conventions

2010-11-04 Thread nathan binkert
 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
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev