diff options
author | Kevin Lim <ktlim@umich.edu> | 2005-01-21 18:31:30 -0500 |
---|---|---|
committer | Kevin Lim <ktlim@umich.edu> | 2005-01-21 18:31:30 -0500 |
commit | e6b99b07684ca465d83a6d9858fe97a1d5a8177f (patch) | |
tree | eb77f23c2c71fd6b8128a945ca1282f2676ea8f0 | |
parent | 6ac7954242abf87252b2927c213e9e95bb0772ce (diff) | |
parent | fa7fa5a90909b79a97aee187aa1de52d96c9dde1 (diff) | |
download | gem5-e6b99b07684ca465d83a6d9858fe97a1d5a8177f.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5-patched/m5-new
--HG--
extra : convert_revision : e802c800a478c297d3aa780a9ea3c6701453d91d
-rw-r--r-- | arch/alpha/pseudo_inst.cc | 2 | ||||
-rw-r--r-- | base/stats/events.cc | 2 | ||||
-rw-r--r-- | base/traceflags.py | 1 | ||||
-rw-r--r-- | dev/ns_gige.cc | 33 | ||||
-rw-r--r-- | dev/ns_gige.hh | 4 | ||||
-rw-r--r-- | dev/pktfifo.cc | 2 | ||||
-rw-r--r-- | dev/sinic.cc | 31 | ||||
-rw-r--r-- | dev/sinic.hh | 4 | ||||
-rw-r--r-- | objects/Root.mpy | 1 | ||||
-rw-r--r-- | sim/pyconfig/m5config.py | 25 | ||||
-rw-r--r-- | util/stats/info.py | 2 | ||||
-rwxr-xr-x | util/stats/stats.py | 88 |
12 files changed, 162 insertions, 33 deletions
diff --git a/arch/alpha/pseudo_inst.cc b/arch/alpha/pseudo_inst.cc index 95c85b45a..22d65638b 100644 --- a/arch/alpha/pseudo_inst.cc +++ b/arch/alpha/pseudo_inst.cc @@ -206,7 +206,7 @@ namespace AlphaPseudo void checkParams(); }; - Context context("PseudoInsts"); + Context context("pseudo_inst"); Param<bool> __quiesce(&context, "quiesce", "enable quiesce instructions", diff --git a/base/stats/events.cc b/base/stats/events.cc index e5efceabe..d716fa4d3 100644 --- a/base/stats/events.cc +++ b/base/stats/events.cc @@ -134,7 +134,7 @@ InsertEvent::insert(const string &stat) first = false; size += sprintf(query + size, "(%u,%u,%llu)", - event, run, curTick); + event, run, (unsigned long long)curTick); } void diff --git a/base/traceflags.py b/base/traceflags.py index 8f20a9692..ef13d9e2a 100644 --- a/base/traceflags.py +++ b/base/traceflags.py @@ -139,6 +139,7 @@ compoundFlagMap = { 'ScsiAll' : [ 'ScsiDisk', 'ScsiCtrl', 'ScsiNone' ], 'DiskImageAll' : [ 'DiskImage', 'DiskImageRead', 'DiskImageWrite' ], 'EthernetAll' : [ 'Ethernet', 'EthernetPIO', 'EthernetDMA', 'EthernetData' , 'EthernetDesc', 'EthernetIntr', 'EthernetSM', 'EthernetCksum' ], + 'EthernetNoData' : [ 'Ethernet', 'EthernetPIO', 'EthernetDesc', 'EthernetIntr', 'EthernetSM', 'EthernetCksum' ], 'IdeAll' : [ 'IdeCtrl', 'IdeDisk' ] } diff --git a/dev/ns_gige.cc b/dev/ns_gige.cc index e799c10d2..db1474d1c 100644 --- a/dev/ns_gige.cc +++ b/dev/ns_gige.cc @@ -244,7 +244,6 @@ NSGigE::regStats() .precision(0) ; - txBandwidth .name(name() + ".txBandwidth") .desc("Transmit Bandwidth (bits/s)") @@ -259,6 +258,34 @@ NSGigE::regStats() .prereq(rxBytes) ; + totBandwidth + .name(name() + ".totBandwidth") + .desc("Total Bandwidth (bits/s)") + .precision(0) + .prereq(totBytes) + ; + + totPackets + .name(name() + ".totPackets") + .desc("Total Packets") + .precision(0) + .prereq(totBytes) + ; + + totBytes + .name(name() + ".totBytes") + .desc("Total Bytes") + .precision(0) + .prereq(totBytes) + ; + + totPacketRate + .name(name() + ".totPPS") + .desc("Total Tranmission Rate (packets/s)") + .precision(0) + .prereq(totBytes) + ; + txPacketRate .name(name() + ".txPPS") .desc("Packet Tranmission Rate (packets/s)") @@ -449,6 +476,10 @@ NSGigE::regStats() txBandwidth = txBytes * Stats::constant(8) / simSeconds; rxBandwidth = rxBytes * Stats::constant(8) / simSeconds; + totBandwidth = txBandwidth + rxBandwidth; + totBytes = txBytes + rxBytes; + totPackets = txPackets + rxPackets; + txPacketRate = txPackets / simSeconds; rxPacketRate = rxPackets / simSeconds; } diff --git a/dev/ns_gige.hh b/dev/ns_gige.hh index 0b62fbdf3..58060edac 100644 --- a/dev/ns_gige.hh +++ b/dev/ns_gige.hh @@ -379,6 +379,10 @@ class NSGigE : public PciDev Stats::Scalar<> descDmaWrites; Stats::Scalar<> descDmaRdBytes; Stats::Scalar<> descDmaWrBytes; + Stats::Formula totBandwidth; + Stats::Formula totPackets; + Stats::Formula totBytes; + Stats::Formula totPacketRate; Stats::Formula txBandwidth; Stats::Formula rxBandwidth; Stats::Formula txPacketRate; diff --git a/dev/pktfifo.cc b/dev/pktfifo.cc index 79a96cc1d..dcb1c4c03 100644 --- a/dev/pktfifo.cc +++ b/dev/pktfifo.cc @@ -54,7 +54,7 @@ PacketFifo::unserialize(const string &base, Checkpoint *cp, const string §ion) { paramIn(cp, section, base + ".size", _size); - paramIn(cp, section, base + ".maxsize", _maxsize); +// paramIn(cp, section, base + ".maxsize", _maxsize); paramIn(cp, section, base + ".reserved", _reserved); int fifosize; paramIn(cp, section, base + ".packets", fifosize); diff --git a/dev/sinic.cc b/dev/sinic.cc index 56782b589..fa4cd570f 100644 --- a/dev/sinic.cc +++ b/dev/sinic.cc @@ -191,6 +191,34 @@ Device::regStats() .prereq(rxBytes) ; + totBandwidth + .name(name() + ".totBandwidth") + .desc("Total Bandwidth (bits/s)") + .precision(0) + .prereq(totBytes) + ; + + totPackets + .name(name() + ".totPackets") + .desc("Total Packets") + .precision(0) + .prereq(totBytes) + ; + + totBytes + .name(name() + ".totBytes") + .desc("Total Bytes") + .precision(0) + .prereq(totBytes) + ; + + totPacketRate + .name(name() + ".totPPS") + .desc("Total Tranmission Rate (packets/s)") + .precision(0) + .prereq(totBytes) + ; + txBytes .name(name() + ".txBytes") .desc("Bytes Transmitted") @@ -258,6 +286,9 @@ Device::regStats() txBandwidth = txBytes * Stats::constant(8) / simSeconds; rxBandwidth = rxBytes * Stats::constant(8) / simSeconds; + totBandwidth = txBandwidth + rxBandwidth; + totBytes = txBytes + rxBytes; + totPackets = txPackets + rxPackets; txPacketRate = txPackets / simSeconds; rxPacketRate = rxPackets / simSeconds; } diff --git a/dev/sinic.hh b/dev/sinic.hh index 9f265b3f6..9b8920f3b 100644 --- a/dev/sinic.hh +++ b/dev/sinic.hh @@ -262,6 +262,10 @@ class Device : public Base Stats::Scalar<> txBytes; Stats::Formula txBandwidth; + Stats::Formula totBandwidth; + Stats::Formula totPackets; + Stats::Formula totBytes; + Stats::Formula totPacketRate; Stats::Scalar<> txPackets; Stats::Formula txPacketRate; Stats::Scalar<> txIpPackets; diff --git a/objects/Root.mpy b/objects/Root.mpy index 2649d59fa..b12771689 100644 --- a/objects/Root.mpy +++ b/objects/Root.mpy @@ -7,3 +7,4 @@ simobj Root(SimObject): "file to dump simulator config to") full_system = Param.Bool("Full system simulation?") hier = HierParams(do_data = false, do_events = true) + checkpoint = Param.String('', "Checkpoint file") diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py index 4e2a377b0..a17732052 100644 --- a/sim/pyconfig/m5config.py +++ b/sim/pyconfig/m5config.py @@ -209,6 +209,13 @@ def isSimObjSequence(value): return True +def isParamContext(value): + try: + return issubclass(value, ParamContext) + except: + return False + + # The metaclass for ConfigNode (and thus for everything that derives # from ConfigNode, including SimObject). This class controls how new # classes that derive from ConfigNode are instantiated, and provides @@ -435,7 +442,7 @@ class MetaConfigNode(type): # Print instance info to .ini file. def instantiate(cls, name, parent = None): - instance = Node(name, cls, cls.type, parent) + instance = Node(name, cls, cls.type, parent, isParamContext(cls)) if hasattr(cls, 'check'): cls.check() @@ -456,7 +463,11 @@ class MetaConfigNode(type): if cls._getdisable(pname): continue - value = cls._getvalue(pname) + try: + value = cls._getvalue(pname) + except: + print 'Error getting %s' % pname + raise if isConfigNode(value): value = instance.child_objects[value] @@ -533,6 +544,9 @@ class ConfigNode(object): # v = param.convert(value) # object.__setattr__(self, attr, v) +class ParamContext(ConfigNode): + pass + # SimObject is a minimal extension of ConfigNode, implementing a # hierarchy node that corresponds to an M5 SimObject. It prints out a # "type=" line to indicate its SimObject class, prints out the @@ -569,7 +583,7 @@ class NodeParam(object): class Node(object): all = {} - def __init__(self, name, realtype, type, parent): + def __init__(self, name, realtype, type, parent, paramcontext): self.name = name self.realtype = realtype self.type = type @@ -580,6 +594,7 @@ class Node(object): self.top_child_names = {} self.params = [] self.param_names = {} + self.paramcontext = paramcontext path = [ self.name ] node = self.parent @@ -678,7 +693,8 @@ class Node(object): # instantiate children in same order they were added for # backward compatibility (else we can end up with cpu1 # before cpu0). - print 'children =', ' '.join([ c.name for c in self.children]) + children = [ c.name for c in self.children if not c.paramcontext] + print 'children =', ' '.join(children) for param in self.params: try: @@ -1202,6 +1218,7 @@ true = True # Some memory range specifications use this as a default upper bound. MAX_ADDR = Addr._max +MaxTick = Tick._max # For power-of-two sizing, e.g. 64*K gives an integer value 65536. K = 1024 diff --git a/util/stats/info.py b/util/stats/info.py index 644c15264..fb46a2d55 100644 --- a/util/stats/info.py +++ b/util/stats/info.py @@ -307,7 +307,7 @@ class Scalar(Statistic,FormulaStat): class Vector(Statistic,FormulaStat): def getValue(self): - return source.data(self, self.bins); + return source.data(self, self.bins, self.ticks); def display(self): import display diff --git a/util/stats/stats.py b/util/stats/stats.py index 892ad143e..c9b7ab2ac 100755 --- a/util/stats/stats.py +++ b/util/stats/stats.py @@ -6,7 +6,19 @@ import re, sys, math def usage(): print '''\ Usage: %s [-E] [-F] [-d <db> ] [-g <get> ] [-h <host>] [-p] - [-s <system>] [-r <runs> ] [-u <username>] <command> [command args] + [-s <system>] [-r <runs> ] [-T <samples>] [-u <username>] + <command> [command args] + + commands extra parameters description + ----------- ------------------ --------------------------------------- + bins [regex] List bins (only matching regex) + formula <formula> Evaluated formula specified + formulas [regex] List formulas (only matching regex) + runs none List all runs in database + samples none List samples present in database + stability <pairnum> <stats> Calculated statistical info about stats + stat <regex> Show stat data (only matching regex) + stats [regex] List all stats (only matching regex) ''' % sys.argv[0] sys.exit(1) @@ -251,18 +263,26 @@ def commands(options, command, args): return if command == 'stability': - stats = info.source.getStat(args[0]) - info.source.get = "avg" + if len(args) < 2: + raise CommandException + + try: + merge = int(args[0]) + except ValueError: + usage() + stats = info.source.getStat(args[1]) + info.source.get = "sum" + #loop through all the stats selected for stat in stats: print "%s:" % stat.name - print "%-20s %12s %12s %4s %5s %5s %5s %6s" % \ + print "%-20s %12s %12s %4s %5s %5s %5s %10s" % \ ("run name", "average", "stdev", ">10%", ">1SDV", ">2SDV", "SAMP", "CV") - print "%-20s %12s %12s %4s %5s %5s %5s %6s" % \ + print "%-20s %12s %12s %4s %5s %5s %5s %10s" % \ ("--------------------", "------------", - "------------", "----", "-----", "-----", "-----", "------") + "------------", "----", "-----", "-----", "-----", "----------") #loop through all the selected runs for run in runs: info.display_run = run.run; @@ -270,38 +290,58 @@ def commands(options, command, args): #throw away the first one, it's 0 runTicks.pop(0) info.globalTicks = runTicks - avg = float(stat) + avg = 0 stdev = 0 numoutsideavg = 0 numoutside1std = 0 numoutside2std = 0 - + pairRunTicks = [] + if float(stat) == 1e300*1e300: + continue + for t in range(0, len(runTicks)-(merge-1), merge): + tempPair = [] + for p in range(0,merge): + tempPair.append(runTicks[t+p]) + pairRunTicks.append(tempPair) #loop through all the various ticks for each run - for tick in runTicks: - #stat.ticks = str(tick) - info.globalTicks = [ tick ] + for tick in pairRunTicks: + info.globalTicks = tick + avg += float(stat) + avg /= len(pairRunTicks) + for tick in pairRunTicks: + info.globalTicks = tick val = float(stat) - if (val < (avg * .9)) or (val > (avg * 1.1)): - numoutsideavg += 1 stdev += pow((val-avg),2) - - stdev = math.sqrt(stdev / len(runTicks)) - for tick in runTicks: - info.globalTicks = [ tick ] + stdev = math.sqrt(stdev / len(pairRunTicks)) + for tick in pairRunTicks: + info.globalTicks = tick val = float(stat) + if (val < (avg * .9)) or (val > (avg * 1.1)): + numoutsideavg += 1 if (val < (avg - stdev)) or (val > (avg + stdev)): numoutside1std += 1 if (val < (avg - (2*stdev))) or (val > (avg + (2*stdev))): numoutside2std += 1 - - print "%-20s %12s %12s %4s %5s %5s %5s %6s" % \ - (run.name, "%.1f" % avg, "%.1f" % stdev, - "%d" % numoutsideavg, "%d" % numoutside1std, - "%d" % numoutside2std, "%d" % len(runTicks), - "%.1f" % (stdev/avg*100)) + if avg > 1000: + print "%-20s %12s %12s %4s %5s %5s %5s %10s" % \ + (run.name, "%.1f" % avg, "%.1f" % stdev, + "%d" % numoutsideavg, "%d" % numoutside1std, + "%d" % numoutside2std, "%d" % len(pairRunTicks), + "%.3f" % (stdev/avg*100)) + elif avg > 100: + print "%-20s %12s %12s %4s %5s %5s %5s %10s" % \ + (run.name, "%.1f" % avg, "%.1f" % stdev, + "%d" % numoutsideavg, "%d" % numoutside1std, + "%d" % numoutside2std, "%d" % len(pairRunTicks), + "%.5f" % (stdev/avg*100)) + else: + print "%-20s %12s %12s %4s %5s %5s %5s %10s" % \ + (run.name, "%.5f" % avg, "%.5f" % stdev, + "%d" % numoutsideavg, "%d" % numoutside1std, + "%d" % numoutside2std, "%d" % len(pairRunTicks), + "%.7f" % (stdev/avg*100)) return - if command == 'stats': if len(args) == 0: info.source.listStats() |