From 98ac080ec46fc4f7abc0162b7c270fa785cb9fed Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Thu, 6 May 2021 20:00:51 -0300 Subject: [PATCH] base-stats,misc: Rename Stats namespace as statistics As part of recent decisions regarding namespace naming conventions, all namespaces will be changed to snake case. ::Stats became ::statistics. "statistics" was chosen over "stats" to avoid generating conflicts with the already existing variables (there are way too many "stats" in the codebase), which would make this patch even more disturbing for the users. Change-Id: If877b12d7dac356f86e3b3d941bf7558a4fd8719 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45421 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/arm/linux/fs_workload.cc | 2 +- src/arch/arm/table_walker.cc | 53 +-- src/arch/arm/table_walker.hh | 29 +- src/arch/arm/tlb.cc | 48 +-- src/arch/arm/tlb.hh | 48 +-- src/arch/riscv/tlb.cc | 22 +- src/arch/riscv/tlb.hh | 26 +- src/arch/x86/tlb.cc | 12 +- src/arch/x86/tlb.hh | 12 +- src/base/statistics.cc | 12 +- src/base/statistics.hh | 10 +- src/base/stats/group.cc | 8 +- src/base/stats/group.hh | 19 +- src/base/stats/hdf5.cc | 6 +- src/base/stats/hdf5.hh | 7 +- src/base/stats/info.cc | 8 +- src/base/stats/info.hh | 7 +- src/base/stats/output.hh | 8 +- src/base/stats/storage.cc | 6 +- src/base/stats/storage.hh | 7 +- src/base/stats/storage.test.cc | 334 +++++++++--------- src/base/stats/text.cc | 10 +- src/base/stats/text.hh | 9 +- src/base/stats/types.hh | 7 +- src/base/stats/units.hh | 56 +-- src/base/stats/units.test.cc | 88 +++-- src/cpu/base.cc | 28 +- src/cpu/base.hh | 22 +- src/cpu/kvm/base.cc | 24 +- src/cpu/kvm/base.hh | 24 +- src/cpu/minor/fetch2.cc | 26 +- src/cpu/minor/fetch2.hh | 14 +- src/cpu/minor/stats.cc | 24 +- src/cpu/minor/stats.hh | 18 +- src/cpu/o3/commit.cc | 40 +-- src/cpu/o3/commit.hh | 36 +- src/cpu/o3/cpu.cc | 56 +-- src/cpu/o3/cpu.hh | 44 +-- src/cpu/o3/decode.cc | 22 +- src/cpu/o3/decode.hh | 22 +- src/cpu/o3/fetch.cc | 54 +-- src/cpu/o3/fetch.hh | 46 +-- src/cpu/o3/iew.cc | 96 ++--- src/cpu/o3/iew.hh | 66 ++-- src/cpu/o3/inst_queue.cc | 84 ++--- src/cpu/o3/inst_queue.hh | 72 ++-- src/cpu/o3/lsq_unit.cc | 18 +- src/cpu/o3/lsq_unit.hh | 18 +- src/cpu/o3/mem_dep_unit.cc | 12 +- src/cpu/o3/mem_dep_unit.hh | 12 +- src/cpu/o3/probe/elastic_trace.cc | 22 +- src/cpu/o3/probe/elastic_trace.hh | 22 +- src/cpu/o3/rename.cc | 60 ++-- src/cpu/o3/rename.hh | 52 +-- src/cpu/o3/rob.cc | 10 +- src/cpu/o3/rob.hh | 8 +- src/cpu/pred/bpred_unit.cc | 28 +- src/cpu/pred/bpred_unit.hh | 28 +- src/cpu/pred/loop_predictor.cc | 9 +- src/cpu/pred/loop_predictor.hh | 8 +- src/cpu/pred/statistical_corrector.cc | 8 +- src/cpu/pred/statistical_corrector.hh | 8 +- src/cpu/pred/tage_base.cc | 28 +- src/cpu/pred/tage_base.hh | 28 +- src/cpu/profile.cc | 2 +- src/cpu/simple/exec_context.hh | 144 ++++---- src/cpu/testers/memtest/memtest.cc | 8 +- src/cpu/testers/memtest/memtest.hh | 8 +- src/cpu/testers/traffic_gen/base.cc | 40 +-- src/cpu/testers/traffic_gen/base.hh | 32 +- src/cpu/thread_state.cc | 9 +- src/cpu/thread_state.hh | 8 +- src/cpu/trace/trace_cpu.cc | 50 +-- src/cpu/trace/trace_cpu.hh | 48 +-- src/dev/arm/flash_device.cc | 19 +- src/dev/arm/flash_device.hh | 16 +- src/dev/arm/hdlcd.cc | 9 +- src/dev/arm/hdlcd.hh | 6 +- src/dev/arm/smmu_v3.cc | 22 +- src/dev/arm/smmu_v3.hh | 16 +- src/dev/arm/smmu_v3_caches.cc | 80 ++--- src/dev/arm/smmu_v3_caches.hh | 53 +-- src/dev/arm/ufs_device.cc | 54 +-- src/dev/arm/ufs_device.hh | 40 +-- src/dev/net/etherdevice.cc | 136 +++---- src/dev/net/etherdevice.hh | 102 +++--- src/dev/net/sinic.cc | 14 +- src/dev/net/sinic.hh | 12 +- src/dev/pci/copy_engine.cc | 12 +- src/dev/pci/copy_engine.hh | 17 +- src/dev/storage/ide_disk.cc | 16 +- src/dev/storage/ide_disk.hh | 16 +- src/gpu-compute/compute_unit.cc | 8 +- src/gpu-compute/compute_unit.hh | 202 +++++------ src/gpu-compute/dispatcher.cc | 5 +- src/gpu-compute/dispatcher.hh | 8 +- src/gpu-compute/exec_stage.cc | 4 +- src/gpu-compute/exec_stage.hh | 18 +- src/gpu-compute/fetch_stage.cc | 4 +- src/gpu-compute/fetch_stage.hh | 6 +- src/gpu-compute/global_memory_pipeline.cc | 4 +- src/gpu-compute/global_memory_pipeline.hh | 6 +- src/gpu-compute/gpu_tlb.cc | 4 +- src/gpu-compute/gpu_tlb.hh | 32 +- src/gpu-compute/local_memory_pipeline.cc | 4 +- src/gpu-compute/local_memory_pipeline.hh | 6 +- src/gpu-compute/register_file.cc | 4 +- src/gpu-compute/register_file.hh | 12 +- src/gpu-compute/schedule_stage.cc | 6 +- src/gpu-compute/schedule_stage.hh | 22 +- src/gpu-compute/scoreboard_check_stage.cc | 4 +- src/gpu-compute/scoreboard_check_stage.hh | 6 +- src/gpu-compute/shader.cc | 24 +- src/gpu-compute/shader.hh | 28 +- src/gpu-compute/tlb_coalescer.cc | 4 +- src/gpu-compute/tlb_coalescer.hh | 14 +- src/gpu-compute/wavefront.cc | 4 +- src/gpu-compute/wavefront.hh | 26 +- src/learning_gem5/part2/simple_cache.cc | 12 +- src/learning_gem5/part2/simple_cache.hh | 12 +- src/mem/abstract_mem.cc | 34 +- src/mem/abstract_mem.hh | 22 +- src/mem/cache/base.cc | 124 +++---- src/mem/cache/base.hh | 98 ++--- src/mem/cache/compressors/base.cc | 21 +- src/mem/cache/compressors/base.hh | 14 +- .../compressors/base_dictionary_compressor.cc | 6 +- .../compressors/dictionary_compressor.hh | 4 +- src/mem/cache/compressors/multi.cc | 6 +- src/mem/cache/compressors/multi.hh | 4 +- src/mem/cache/prefetch/base.cc | 8 +- src/mem/cache/prefetch/base.hh | 6 +- src/mem/cache/prefetch/queued.cc | 15 +- src/mem/cache/prefetch/queued.hh | 14 +- src/mem/cache/tags/base.cc | 44 +-- src/mem/cache/tags/base.hh | 26 +- src/mem/cache/tags/fa_lru.cc | 10 +- src/mem/cache/tags/fa_lru.hh | 10 +- src/mem/cache/tags/sector_tags.cc | 6 +- src/mem/cache/tags/sector_tags.hh | 4 +- src/mem/coherent_xbar.cc | 6 +- src/mem/coherent_xbar.hh | 6 +- src/mem/comm_monitor.cc | 54 +-- src/mem/comm_monitor.hh | 43 +-- src/mem/mem_ctrl.cc | 91 +++-- src/mem/mem_ctrl.hh | 70 ++-- src/mem/mem_interface.cc | 158 ++++----- src/mem/mem_interface.hh | 124 +++---- src/mem/probes/mem_footprint.cc | 16 +- src/mem/probes/mem_footprint.hh | 10 +- src/mem/probes/stack_dist.cc | 18 +- src/mem/probes/stack_dist.hh | 12 +- src/mem/qos/mem_ctrl.cc | 22 +- src/mem/qos/mem_ctrl.hh | 18 +- src/mem/qos/mem_sink.cc | 8 +- src/mem/qos/mem_sink.hh | 8 +- src/mem/ruby/network/MessageBuffer.cc | 10 +- src/mem/ruby/network/MessageBuffer.hh | 12 +- src/mem/ruby/network/Network.cc | 2 +- src/mem/ruby/network/garnet/GarnetNetwork.cc | 41 ++- src/mem/ruby/network/garnet/GarnetNetwork.hh | 54 +-- src/mem/ruby/network/garnet/Router.cc | 10 +- src/mem/ruby/network/garnet/Router.hh | 10 +- src/mem/ruby/network/simple/SimpleNetwork.cc | 14 +- src/mem/ruby/network/simple/SimpleNetwork.hh | 8 +- src/mem/ruby/network/simple/Switch.cc | 16 +- src/mem/ruby/network/simple/Switch.hh | 12 +- src/mem/ruby/network/simple/Throttle.cc | 14 +- src/mem/ruby/network/simple/Throttle.hh | 14 +- src/mem/ruby/profiler/Profiler.cc | 128 +++---- src/mem/ruby/profiler/Profiler.hh | 77 ++-- .../slicc_interface/AbstractController.cc | 12 +- .../slicc_interface/AbstractController.hh | 24 +- src/mem/ruby/structures/CacheMemory.cc | 38 +- src/mem/ruby/structures/CacheMemory.hh | 38 +- src/mem/ruby/structures/RubyPrefetcher.cc | 4 +- src/mem/ruby/structures/RubyPrefetcher.hh | 18 +- src/mem/ruby/structures/TBEStorage.cc | 6 +- src/mem/ruby/structures/TBEStorage.hh | 12 +- src/mem/ruby/system/GPUCoalescer.cc | 22 +- src/mem/ruby/system/GPUCoalescer.hh | 99 +++--- src/mem/ruby/system/HTMSequencer.cc | 18 +- src/mem/ruby/system/HTMSequencer.hh | 6 +- src/mem/ruby/system/RubySystem.cc | 2 +- src/mem/ruby/system/Sequencer.cc | 31 +- src/mem/ruby/system/Sequencer.hh | 65 ++-- src/mem/slicc/symbols/StateMachine.py | 55 +-- src/mem/snoop_filter.cc | 16 +- src/mem/snoop_filter.hh | 16 +- src/mem/xbar.cc | 18 +- src/mem/xbar.hh | 12 +- src/python/m5/SimObject.py | 2 +- src/python/pybind11/stats.cc | 200 +++++------ src/sim/clock_domain.cc | 4 +- src/sim/clock_domain.hh | 4 +- src/sim/dvfs_handler.cc | 4 +- src/sim/faults.hh | 2 +- src/sim/power/mathexpr_powermodel.cc | 4 +- src/sim/power/mathexpr_powermodel.hh | 6 +- src/sim/power/power_model.cc | 8 +- src/sim/power/power_model.hh | 4 +- src/sim/power/thermal_domain.cc | 2 +- src/sim/power/thermal_domain.hh | 2 +- src/sim/power_domain.cc | 12 +- src/sim/power_domain.hh | 6 +- src/sim/power_state.cc | 18 +- src/sim/power_state.hh | 10 +- src/sim/process.cc | 2 +- src/sim/process.hh | 3 +- src/sim/pseudo_inst.cc | 8 +- src/sim/root.cc | 22 +- src/sim/root.hh | 16 +- src/sim/sim_object.cc | 2 +- src/sim/sim_object.hh | 2 +- src/sim/simulate.cc | 2 +- src/sim/stat_control.cc | 21 +- src/sim/stat_control.hh | 6 +- src/sim/stat_register.cc | 5 +- src/sim/stat_register.hh | 7 +- src/sim/stats.cc | 8 +- src/sim/stats.hh | 8 +- src/sim/system.cc | 4 +- src/sim/system.hh | 2 +- src/sim/ticked_object.cc | 4 +- src/sim/ticked_object.hh | 10 +- src/sim/voltage_domain.cc | 4 +- src/sim/voltage_domain.hh | 4 +- src/sim/workload.hh | 17 +- 228 files changed, 3078 insertions(+), 2970 deletions(-) diff --git a/src/arch/arm/linux/fs_workload.cc b/src/arch/arm/linux/fs_workload.cc index fce4db08bf..14a2b028c0 100644 --- a/src/arch/arm/linux/fs_workload.cc +++ b/src/arch/arm/linux/fs_workload.cc @@ -357,7 +357,7 @@ DumpStats::process(ThreadContext *tc) taskFile->stream()->flush(); // Dump and reset statistics - Stats::schedStatEvent(true, true, curTick(), 0); + statistics::schedStatEvent(true, true, curTick(), 0); } } // namespace ArmISA diff --git a/src/arch/arm/table_walker.cc b/src/arch/arm/table_walker.cc index 1ce3cde4e8..64ca81eda5 100644 --- a/src/arch/arm/table_walker.cc +++ b/src/arch/arm/table_walker.cc @@ -2420,78 +2420,79 @@ TableWalker::pageSizeNtoStatBin(uint8_t N) } } - -TableWalker::TableWalkerStats::TableWalkerStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(walks, Stats::units::Count::get(), +TableWalker::TableWalkerStats::TableWalkerStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(walks, statistics::units::Count::get(), "Table walker walks requested"), - ADD_STAT(walksShortDescriptor, Stats::units::Count::get(), + ADD_STAT(walksShortDescriptor, statistics::units::Count::get(), "Table walker walks initiated with short descriptors"), - ADD_STAT(walksLongDescriptor, Stats::units::Count::get(), + ADD_STAT(walksLongDescriptor, statistics::units::Count::get(), "Table walker walks initiated with long descriptors"), - ADD_STAT(walksShortTerminatedAtLevel, Stats::units::Count::get(), + ADD_STAT(walksShortTerminatedAtLevel, statistics::units::Count::get(), "Level at which table walker walks with short descriptors " "terminate"), - ADD_STAT(walksLongTerminatedAtLevel, Stats::units::Count::get(), + ADD_STAT(walksLongTerminatedAtLevel, statistics::units::Count::get(), "Level at which table walker walks with long descriptors " "terminate"), - ADD_STAT(squashedBefore, Stats::units::Count::get(), + ADD_STAT(squashedBefore, statistics::units::Count::get(), "Table walks squashed before starting"), - ADD_STAT(squashedAfter, Stats::units::Count::get(), + ADD_STAT(squashedAfter, statistics::units::Count::get(), "Table walks squashed after completion"), - ADD_STAT(walkWaitTime, Stats::units::Tick::get(), + ADD_STAT(walkWaitTime, statistics::units::Tick::get(), "Table walker wait (enqueue to first request) latency"), - ADD_STAT(walkServiceTime, Stats::units::Tick::get(), + ADD_STAT(walkServiceTime, statistics::units::Tick::get(), "Table walker service (enqueue to completion) latency"), - ADD_STAT(pendingWalks, Stats::units::Tick::get(), + ADD_STAT(pendingWalks, statistics::units::Tick::get(), "Table walker pending requests distribution"), - ADD_STAT(pageSizes, Stats::units::Count::get(), + ADD_STAT(pageSizes, statistics::units::Count::get(), "Table walker page sizes translated"), - ADD_STAT(requestOrigin, Stats::units::Count::get(), + ADD_STAT(requestOrigin, statistics::units::Count::get(), "Table walker requests started/completed, data/inst") { walksShortDescriptor - .flags(Stats::nozero); + .flags(statistics::nozero); walksLongDescriptor - .flags(Stats::nozero); + .flags(statistics::nozero); walksShortTerminatedAtLevel .init(2) - .flags(Stats::nozero); + .flags(statistics::nozero); walksShortTerminatedAtLevel.subname(0, "Level1"); walksShortTerminatedAtLevel.subname(1, "Level2"); walksLongTerminatedAtLevel .init(4) - .flags(Stats::nozero); + .flags(statistics::nozero); walksLongTerminatedAtLevel.subname(0, "Level0"); walksLongTerminatedAtLevel.subname(1, "Level1"); walksLongTerminatedAtLevel.subname(2, "Level2"); walksLongTerminatedAtLevel.subname(3, "Level3"); squashedBefore - .flags(Stats::nozero); + .flags(statistics::nozero); squashedAfter - .flags(Stats::nozero); + .flags(statistics::nozero); walkWaitTime .init(16) - .flags(Stats::pdf | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::nozero | statistics::nonan); walkServiceTime .init(16) - .flags(Stats::pdf | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::nozero | statistics::nonan); pendingWalks .init(16) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan); pageSizes // see DDI 0487A D4-1661 .init(10) - .flags(Stats::total | Stats::pdf | Stats::dist | Stats::nozero); + .flags(statistics::total | statistics::pdf | statistics::dist | + statistics::nozero); pageSizes.subname(0, "4KiB"); pageSizes.subname(1, "16KiB"); pageSizes.subname(2, "64KiB"); @@ -2505,7 +2506,7 @@ TableWalker::TableWalkerStats::TableWalkerStats(Stats::Group *parent) requestOrigin .init(2,2) // Instruction/Data, requests/completed - .flags(Stats::total); + .flags(statistics::total); requestOrigin.subname(0,"Requested"); requestOrigin.subname(1,"Completed"); requestOrigin.ysubname(0,"Data"); diff --git a/src/arch/arm/table_walker.hh b/src/arch/arm/table_walker.hh index 4b52be6aff..0c812ec9c8 100644 --- a/src/arch/arm/table_walker.hh +++ b/src/arch/arm/table_walker.hh @@ -941,21 +941,22 @@ class TableWalker : public ClockedObject bool _haveLargeAsid64; /** Statistics */ - struct TableWalkerStats : public Stats::Group + struct TableWalkerStats : public statistics::Group { - TableWalkerStats(Stats::Group *parent); - Stats::Scalar walks; - Stats::Scalar walksShortDescriptor; - Stats::Scalar walksLongDescriptor; - Stats::Vector walksShortTerminatedAtLevel; - Stats::Vector walksLongTerminatedAtLevel; - Stats::Scalar squashedBefore; - Stats::Scalar squashedAfter; - Stats::Histogram walkWaitTime; - Stats::Histogram walkServiceTime; - Stats::Histogram pendingWalks; // essentially "L" of queueing theory - Stats::Vector pageSizes; - Stats::Vector2d requestOrigin; + TableWalkerStats(statistics::Group *parent); + statistics::Scalar walks; + statistics::Scalar walksShortDescriptor; + statistics::Scalar walksLongDescriptor; + statistics::Vector walksShortTerminatedAtLevel; + statistics::Vector walksLongTerminatedAtLevel; + statistics::Scalar squashedBefore; + statistics::Scalar squashedAfter; + statistics::Histogram walkWaitTime; + statistics::Histogram walkServiceTime; + // Essentially "L" of queueing theory + statistics::Histogram pendingWalks; + statistics::Vector pageSizes; + statistics::Vector2d requestOrigin; } stats; mutable unsigned pendingReqs; diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc index b1dd21e3f7..9cdaabd7a9 100644 --- a/src/arch/arm/tlb.cc +++ b/src/arch/arm/tlb.cc @@ -525,47 +525,47 @@ TLB::takeOverFrom(BaseTLB *_otlb) } } -TLB::TlbStats::TlbStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(instHits, Stats::units::Count::get(), "ITB inst hits"), - ADD_STAT(instMisses, Stats::units::Count::get(), "ITB inst misses"), - ADD_STAT(readHits, Stats::units::Count::get(), "DTB read hits"), - ADD_STAT(readMisses, Stats::units::Count::get(), "DTB read misses"), - ADD_STAT(writeHits, Stats::units::Count::get(), "DTB write hits"), - ADD_STAT(writeMisses, Stats::units::Count::get(), "DTB write misses"), - ADD_STAT(inserts, Stats::units::Count::get(), +TLB::TlbStats::TlbStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(instHits, statistics::units::Count::get(), "ITB inst hits"), + ADD_STAT(instMisses, statistics::units::Count::get(), "ITB inst misses"), + ADD_STAT(readHits, statistics::units::Count::get(), "DTB read hits"), + ADD_STAT(readMisses, statistics::units::Count::get(), "DTB read misses"), + ADD_STAT(writeHits, statistics::units::Count::get(), "DTB write hits"), + ADD_STAT(writeMisses, statistics::units::Count::get(), "DTB write misses"), + ADD_STAT(inserts, statistics::units::Count::get(), "Number of times an entry is inserted into the TLB"), - ADD_STAT(flushTlb, Stats::units::Count::get(), + ADD_STAT(flushTlb, statistics::units::Count::get(), "Number of times complete TLB was flushed"), - ADD_STAT(flushTlbMva, Stats::units::Count::get(), + ADD_STAT(flushTlbMva, statistics::units::Count::get(), "Number of times TLB was flushed by MVA"), - ADD_STAT(flushTlbMvaAsid, Stats::units::Count::get(), + ADD_STAT(flushTlbMvaAsid, statistics::units::Count::get(), "Number of times TLB was flushed by MVA & ASID"), - ADD_STAT(flushTlbAsid, Stats::units::Count::get(), + ADD_STAT(flushTlbAsid, statistics::units::Count::get(), "Number of times TLB was flushed by ASID"), - ADD_STAT(flushedEntries, Stats::units::Count::get(), + ADD_STAT(flushedEntries, statistics::units::Count::get(), "Number of entries that have been flushed from TLB"), - ADD_STAT(alignFaults, Stats::units::Count::get(), + ADD_STAT(alignFaults, statistics::units::Count::get(), "Number of TLB faults due to alignment restrictions"), - ADD_STAT(prefetchFaults, Stats::units::Count::get(), + ADD_STAT(prefetchFaults, statistics::units::Count::get(), "Number of TLB faults due to prefetch"), - ADD_STAT(domainFaults, Stats::units::Count::get(), + ADD_STAT(domainFaults, statistics::units::Count::get(), "Number of TLB faults due to domain restrictions"), - ADD_STAT(permsFaults, Stats::units::Count::get(), + ADD_STAT(permsFaults, statistics::units::Count::get(), "Number of TLB faults due to permissions restrictions"), - ADD_STAT(readAccesses, Stats::units::Count::get(), "DTB read accesses", + ADD_STAT(readAccesses, statistics::units::Count::get(), "DTB read accesses", readHits + readMisses), - ADD_STAT(writeAccesses, Stats::units::Count::get(), "DTB write accesses", + ADD_STAT(writeAccesses, statistics::units::Count::get(), "DTB write accesses", writeHits + writeMisses), - ADD_STAT(instAccesses, Stats::units::Count::get(), "ITB inst accesses", + ADD_STAT(instAccesses, statistics::units::Count::get(), "ITB inst accesses", instHits + instMisses), - ADD_STAT(hits, Stats::units::Count::get(), + ADD_STAT(hits, statistics::units::Count::get(), "Total TLB (inst and data) hits", readHits + writeHits + instHits), - ADD_STAT(misses, Stats::units::Count::get(), + ADD_STAT(misses, statistics::units::Count::get(), "Total TLB (inst and data) misses", readMisses + writeMisses + instMisses), - ADD_STAT(accesses, Stats::units::Count::get(), + ADD_STAT(accesses, statistics::units::Count::get(), "Total TLB (inst and data) accesses", readAccesses + writeAccesses + instAccesses) { diff --git a/src/arch/arm/tlb.hh b/src/arch/arm/tlb.hh index bb53f3f400..2d1b8e9240 100644 --- a/src/arch/arm/tlb.hh +++ b/src/arch/arm/tlb.hh @@ -170,33 +170,33 @@ class TLB : public BaseTLB TlbTestInterface *test; - struct TlbStats : public Stats::Group + struct TlbStats : public statistics::Group { - TlbStats(Stats::Group *parent); + TlbStats(statistics::Group *parent); // Access Stats - mutable Stats::Scalar instHits; - mutable Stats::Scalar instMisses; - mutable Stats::Scalar readHits; - mutable Stats::Scalar readMisses; - mutable Stats::Scalar writeHits; - mutable Stats::Scalar writeMisses; - mutable Stats::Scalar inserts; - mutable Stats::Scalar flushTlb; - mutable Stats::Scalar flushTlbMva; - mutable Stats::Scalar flushTlbMvaAsid; - mutable Stats::Scalar flushTlbAsid; - mutable Stats::Scalar flushedEntries; - mutable Stats::Scalar alignFaults; - mutable Stats::Scalar prefetchFaults; - mutable Stats::Scalar domainFaults; - mutable Stats::Scalar permsFaults; + mutable statistics::Scalar instHits; + mutable statistics::Scalar instMisses; + mutable statistics::Scalar readHits; + mutable statistics::Scalar readMisses; + mutable statistics::Scalar writeHits; + mutable statistics::Scalar writeMisses; + mutable statistics::Scalar inserts; + mutable statistics::Scalar flushTlb; + mutable statistics::Scalar flushTlbMva; + mutable statistics::Scalar flushTlbMvaAsid; + mutable statistics::Scalar flushTlbAsid; + mutable statistics::Scalar flushedEntries; + mutable statistics::Scalar alignFaults; + mutable statistics::Scalar prefetchFaults; + mutable statistics::Scalar domainFaults; + mutable statistics::Scalar permsFaults; - Stats::Formula readAccesses; - Stats::Formula writeAccesses; - Stats::Formula instAccesses; - Stats::Formula hits; - Stats::Formula misses; - Stats::Formula accesses; + statistics::Formula readAccesses; + statistics::Formula writeAccesses; + statistics::Formula instAccesses; + statistics::Formula hits; + statistics::Formula misses; + statistics::Formula accesses; } stats; /** PMU probe for TLB refills */ diff --git a/src/arch/riscv/tlb.cc b/src/arch/riscv/tlb.cc index eac2ef2152..a5e4107248 100644 --- a/src/arch/riscv/tlb.cc +++ b/src/arch/riscv/tlb.cc @@ -509,19 +509,19 @@ TLB::unserialize(CheckpointIn &cp) } } -TLB::TlbStats::TlbStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(readHits, Stats::units::Count::get(), "read hits"), - ADD_STAT(readMisses, Stats::units::Count::get(), "read misses"), - ADD_STAT(readAccesses, Stats::units::Count::get(), "read accesses"), - ADD_STAT(writeHits, Stats::units::Count::get(), "write hits"), - ADD_STAT(writeMisses, Stats::units::Count::get(), "write misses"), - ADD_STAT(writeAccesses, Stats::units::Count::get(), "write accesses"), - ADD_STAT(hits, Stats::units::Count::get(), +TLB::TlbStats::TlbStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(readHits, statistics::units::Count::get(), "read hits"), + ADD_STAT(readMisses, statistics::units::Count::get(), "read misses"), + ADD_STAT(readAccesses, statistics::units::Count::get(), "read accesses"), + ADD_STAT(writeHits, statistics::units::Count::get(), "write hits"), + ADD_STAT(writeMisses, statistics::units::Count::get(), "write misses"), + ADD_STAT(writeAccesses, statistics::units::Count::get(), "write accesses"), + ADD_STAT(hits, statistics::units::Count::get(), "Total TLB (read and write) hits", readHits + writeHits), - ADD_STAT(misses, Stats::units::Count::get(), + ADD_STAT(misses, statistics::units::Count::get(), "Total TLB (read and write) misses", readMisses + writeMisses), - ADD_STAT(accesses, Stats::units::Count::get(), + ADD_STAT(accesses, statistics::units::Count::get(), "Total TLB (read and write) accesses", readAccesses + writeAccesses) { diff --git a/src/arch/riscv/tlb.hh b/src/arch/riscv/tlb.hh index 3b3c7090fd..365465ad40 100644 --- a/src/arch/riscv/tlb.hh +++ b/src/arch/riscv/tlb.hh @@ -66,22 +66,22 @@ class TLB : public BaseTLB Walker *walker; - struct TlbStats : public Stats::Group + struct TlbStats : public statistics::Group { - TlbStats(Stats::Group *parent); + TlbStats(statistics::Group *parent); - Stats::Scalar readHits; - Stats::Scalar readMisses; - Stats::Scalar read_acv; - Stats::Scalar readAccesses; - Stats::Scalar writeHits; - Stats::Scalar writeMisses; - Stats::Scalar write_acv; - Stats::Scalar writeAccesses; + statistics::Scalar readHits; + statistics::Scalar readMisses; + statistics::Scalar read_acv; + statistics::Scalar readAccesses; + statistics::Scalar writeHits; + statistics::Scalar writeMisses; + statistics::Scalar write_acv; + statistics::Scalar writeAccesses; - Stats::Formula hits; - Stats::Formula misses; - Stats::Formula accesses; + statistics::Formula hits; + statistics::Formula misses; + statistics::Formula accesses; } stats; public: diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc index b44353a547..90e43b9dcb 100644 --- a/src/arch/x86/tlb.cc +++ b/src/arch/x86/tlb.cc @@ -518,15 +518,15 @@ TLB::getWalker() return walker; } -TLB::TlbStats::TlbStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(rdAccesses, Stats::units::Count::get(), +TLB::TlbStats::TlbStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(rdAccesses, statistics::units::Count::get(), "TLB accesses on read requests"), - ADD_STAT(wrAccesses, Stats::units::Count::get(), + ADD_STAT(wrAccesses, statistics::units::Count::get(), "TLB accesses on write requests"), - ADD_STAT(rdMisses, Stats::units::Count::get(), + ADD_STAT(rdMisses, statistics::units::Count::get(), "TLB misses on read requests"), - ADD_STAT(wrMisses, Stats::units::Count::get(), + ADD_STAT(wrMisses, statistics::units::Count::get(), "TLB misses on write requests") { } diff --git a/src/arch/x86/tlb.hh b/src/arch/x86/tlb.hh index aa25e126c7..738a70361a 100644 --- a/src/arch/x86/tlb.hh +++ b/src/arch/x86/tlb.hh @@ -101,14 +101,14 @@ namespace X86ISA AddrRange m5opRange; - struct TlbStats : public Stats::Group + struct TlbStats : public statistics::Group { - TlbStats(Stats::Group *parent); + TlbStats(statistics::Group *parent); - Stats::Scalar rdAccesses; - Stats::Scalar wrAccesses; - Stats::Scalar rdMisses; - Stats::Scalar wrMisses; + statistics::Scalar rdAccesses; + statistics::Scalar wrAccesses; + statistics::Scalar rdMisses; + statistics::Scalar wrMisses; } stats; Fault translateInt(bool read, RequestPtr req, ThreadContext *tc); diff --git a/src/base/statistics.cc b/src/base/statistics.cc index 26a6e515eb..3a709d5f64 100644 --- a/src/base/statistics.cc +++ b/src/base/statistics.cc @@ -50,7 +50,9 @@ #include "base/logging.hh" #include "sim/root.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ // We wrap these in a function to make sure they're built in time. std::list & @@ -292,7 +294,7 @@ dump() if (dumpHandler) dumpHandler(); else - fatal("No registered Stats::dump handler"); + fatal("No registered statistics::dump handler"); } void @@ -301,7 +303,7 @@ reset() if (resetHandler) resetHandler(); else - fatal("No registered Stats::reset handler"); + fatal("No registered statistics::reset handler"); } const Info * @@ -321,10 +323,10 @@ registerDumpCallback(const std::function &callback) dumpQueue.push_back(callback); } -} // namespace Stats +} // namespace statistics void debugDumpStats() { - Stats::dump(); + statistics::dump(); } diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 95f8c63e85..e0d268000d 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -87,7 +87,9 @@ #include "base/types.hh" /* A namespace for all of the Statistics */ -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ template class InfoProxy : public Base @@ -262,9 +264,9 @@ class DataWrap : public InfoAccess if (desc) info->desc = desc; - // Stat that does not belong to any Stats::Group is a legacy stat + // Stat that does not belong to any statistics::Group is a legacy stat std::string common_message = "Legacy stat is a stat that does not " - "belong to any Stats::Group. Legacy stat is deprecated."; + "belong to any statistics::Group. Legacy stat is deprecated."; if (parent == nullptr && name != nullptr) warn(csprintf("`%s` is a legacy stat. %s", name, common_message)); else if (parent == nullptr) @@ -2936,7 +2938,7 @@ std::list &statsList(); typedef std::map MapType; MapType &statsMap(); -} // namespace Stats +} // namespace statistics void debugDumpStats(); diff --git a/src/base/stats/group.cc b/src/base/stats/group.cc index ff6090983c..3d7aa015e6 100644 --- a/src/base/stats/group.cc +++ b/src/base/stats/group.cc @@ -44,7 +44,9 @@ #include "debug/Stats.hh" #include "sim/sim_object.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ Group::Group(Group *parent, const char *name) : mergedParent(nullptr) @@ -102,7 +104,7 @@ Group::preDumpStats() } void -Group::addStat(Stats::Info *info) +Group::addStat(statistics::Info *info) { stats.push_back(info); if (mergedParent) @@ -183,4 +185,4 @@ Group::getStats() const return stats; } -} // namespace Stats +} // namespace statistics diff --git a/src/base/stats/group.hh b/src/base/stats/group.hh index d7e28098f1..91b6d8adcf 100644 --- a/src/base/stats/group.hh +++ b/src/base/stats/group.hh @@ -42,25 +42,26 @@ #include #include +#include "base/compiler.hh" #include "base/stats/units.hh" /** * Convenience macro to add a stat to a statistics group. * - * This macro is used to add a stat to a Stats::Group in the + * This macro is used to add a stat to a statistics::Group in the * initilization list in the Group's constructor. The macro * automatically assigns the stat to the current group and gives it * the same name as in the class. For example: * * \code - * struct MyStats : public Stats::Group + * struct MyStats : public statistics::Group * { - * Stats::Scalar scalar0; - * Stats::Scalar scalar1; + * statistics::Scalar scalar0; + * statistics::Scalar scalar1; * * Group() * : ADD_STAT(scalar0, "Description of scalar0"), - * scalar1(this, "scalar1", Stats::units::Unspecified::get(), + * scalar1(this, "scalar1", statistics::units::Unspecified::get(), * "Description of scalar1") * { * } @@ -70,7 +71,9 @@ #define ADD_STAT(n, ...) n(this, #n, __VA_ARGS__) -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ class Info; @@ -155,7 +158,7 @@ class Group * * @ingroup api_stats */ - void addStat(Stats::Info *info); + void addStat(statistics::Info *info); /** * Get all child groups associated with this object. @@ -215,6 +218,6 @@ class Group std::vector stats; }; -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_GROUP_HH__ diff --git a/src/base/stats/hdf5.cc b/src/base/stats/hdf5.cc index 963be6ea6f..3246bb4ac4 100644 --- a/src/base/stats/hdf5.cc +++ b/src/base/stats/hdf5.cc @@ -54,7 +54,9 @@ bool emptyStrings(const T &labels) } -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ Hdf5::Hdf5(const std::string &file, unsigned chunking, bool desc, bool formulas) @@ -320,4 +322,4 @@ initHDF5(const std::string &filename, unsigned chunking, new Hdf5(simout.resolve(filename), chunking, desc, formulas)); } -}; // namespace Stats +}; // namespace statistics diff --git a/src/base/stats/hdf5.hh b/src/base/stats/hdf5.hh index 8944a55aa3..cd6caf8997 100644 --- a/src/base/stats/hdf5.hh +++ b/src/base/stats/hdf5.hh @@ -45,11 +45,14 @@ #include #include +#include "base/compiler.hh" #include "base/output.hh" #include "base/stats/output.hh" #include "base/stats/types.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ class Hdf5 : public Output { @@ -152,6 +155,6 @@ std::unique_ptr initHDF5( const std::string &filename,unsigned chunking = 10, bool desc = true, bool formulas = true); -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_HDF5_HH__ diff --git a/src/base/stats/info.cc b/src/base/stats/info.cc index b2ad86b689..85bf698bc6 100644 --- a/src/base/stats/info.cc +++ b/src/base/stats/info.cc @@ -50,7 +50,9 @@ #include "base/logging.hh" #include "base/str.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ std::string Info::separatorString = "::"; @@ -164,7 +166,7 @@ Info::less(Info *stat1, Info *stat2) bool Info::baseCheck() const { - if (!(flags & Stats::init)) { + if (!(flags & statistics::init)) { #ifdef DEBUG cprintf("this is stat number %d\n", id); #endif @@ -219,4 +221,4 @@ Vector2dInfo::enable() y_subnames.resize(y); } -} // namespace Stats +} // namespace statistics diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh index ee70341996..6665102d5b 100644 --- a/src/base/stats/info.hh +++ b/src/base/stats/info.hh @@ -29,11 +29,14 @@ #ifndef __BASE_STATS_INFO_HH__ #define __BASE_STATS_INFO_HH__ +#include "base/compiler.hh" #include "base/flags.hh" #include "base/stats/types.hh" #include "base/stats/units.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ class Group; @@ -261,6 +264,6 @@ class SparseHistInfo : public Info typedef std::map NameMapType; NameMapType &nameMap(); -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_INFO_HH__ diff --git a/src/base/stats/output.hh b/src/base/stats/output.hh index 6ff4a5db22..9c8dcd52c0 100644 --- a/src/base/stats/output.hh +++ b/src/base/stats/output.hh @@ -44,7 +44,11 @@ #include #include -namespace Stats { +#include "base/compiler.hh" + +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ class Info; class ScalarInfo; @@ -75,6 +79,6 @@ struct Output virtual void visit(const SparseHistInfo &info) = 0; // Sparse histogram }; -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_OUTPUT_HH__ diff --git a/src/base/stats/storage.cc b/src/base/stats/storage.cc index 6e2a7f2f96..9ffa280c63 100644 --- a/src/base/stats/storage.cc +++ b/src/base/stats/storage.cc @@ -43,7 +43,9 @@ #include -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ void DistStor::sample(Counter val, int number) @@ -222,4 +224,4 @@ HistStor::add(HistStor *hs) cvec[i] += hs->cvec[i]; } -} // namespace Stats +} // namespace statistics diff --git a/src/base/stats/storage.hh b/src/base/stats/storage.hh index 2ee1eb2f1e..1ce6fe7a8c 100644 --- a/src/base/stats/storage.hh +++ b/src/base/stats/storage.hh @@ -34,13 +34,16 @@ #include #include "base/cast.hh" +#include "base/compiler.hh" #include "base/logging.hh" #include "base/stats/info.hh" #include "base/stats/types.hh" // For curTick(). #include "sim/core.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ struct StorageParams { @@ -778,6 +781,6 @@ class SparseHistStor } }; -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_STORAGE_HH__ diff --git a/src/base/stats/storage.test.cc b/src/base/stats/storage.test.cc index 36f73a60c3..c744c279d3 100644 --- a/src/base/stats/storage.test.cc +++ b/src/base/stats/storage.test.cc @@ -44,10 +44,10 @@ void increaseTick() { tickHandler.setCurTick(curTick() + 1); } /** A pair of value and its number of samples, used for sampling. */ struct ValueSamples { - Stats::Counter value; - Stats::Counter numSamples; + statistics::Counter value; + statistics::Counter numSamples; - ValueSamples(Stats::Counter value, Stats::Counter num_samples) + ValueSamples(statistics::Counter value, statistics::Counter num_samples) : value(value), numSamples(num_samples) { } @@ -58,11 +58,11 @@ struct ValueSamples * @todo There is no real dependency on the info class, so this must be * removed on a cleanup. */ -class MockInfo : public Stats::Info +class MockInfo : public statistics::Info { public: - MockInfo(Stats::StorageParams* storage_params) - : Stats::Info() + MockInfo(statistics::StorageParams* storage_params) + : statistics::Info() { this->storageParams = storage_params; } @@ -72,45 +72,45 @@ class MockInfo : public Stats::Info void prepare() override { } void reset() override { } bool zero() const override { return true; } - void visit(Stats::Output &visitor) override { } + void visit(statistics::Output &visitor) override { } }; /** Test setting and getting a value to the storage. */ TEST(StatsStatStorTest, SetValueResult) { - Stats::StatStor stor(nullptr); - Stats::Counter val; + statistics::StatStor stor(nullptr); + statistics::Counter val; val = 10; stor.set(val); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(val)); + ASSERT_EQ(stor.result(), statistics::Result(val)); val = 1234; stor.set(val); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(val)); + ASSERT_EQ(stor.result(), statistics::Result(val)); } /** Test if prepare does not change the value. */ TEST(StatsStatStorTest, Prepare) { - Stats::StatStor stor(nullptr); - Stats::Counter val; + statistics::StatStor stor(nullptr); + statistics::Counter val; val = 10; stor.set(val); stor.prepare(nullptr); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(val)); + ASSERT_EQ(stor.result(), statistics::Result(val)); } /** Test whether incrementing and decrementing work as expected. */ TEST(StatsStatStorTest, IncDec) { - Stats::StatStor stor(nullptr); - Stats::Counter diff_val = 10; - Stats::Counter val = 0; + statistics::StatStor stor(nullptr); + statistics::Counter diff_val = 10; + statistics::Counter val = 0; stor.inc(diff_val); val += diff_val; @@ -136,8 +136,8 @@ TEST(StatsStatStorTest, IncDec) */ TEST(StatsStatStorTest, ZeroReset) { - Stats::StatStor stor(nullptr); - Stats::Counter val = 10; + statistics::StatStor stor(nullptr); + statistics::Counter val = 10; ASSERT_TRUE(stor.zero()); @@ -152,9 +152,9 @@ TEST(StatsStatStorTest, ZeroReset) /** Test setting and getting a value to the storage. */ TEST(StatsAvgStorTest, SetValueResult) { - Stats::AvgStor stor(nullptr); - Stats::Counter val; - Stats::Result total = 0; + statistics::AvgStor stor(nullptr); + statistics::Counter val; + statistics::Result total = 0; Tick last_reset = 0; Tick last_tick = 0; @@ -162,8 +162,8 @@ TEST(StatsAvgStorTest, SetValueResult) stor.set(val); last_tick = curTick(); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(total + val) / - Stats::Result(curTick() - last_reset + 1)); + ASSERT_EQ(stor.result(), statistics::Result(total + val) / + statistics::Result(curTick() - last_reset + 1)); increaseTick(); total += val * (curTick() - last_tick); @@ -171,8 +171,8 @@ TEST(StatsAvgStorTest, SetValueResult) stor.set(val); last_tick = curTick(); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(total + val) / - Stats::Result(curTick() - last_reset + 1)); + ASSERT_EQ(stor.result(), statistics::Result(total + val) / + statistics::Result(curTick() - last_reset + 1)); increaseTick(); } @@ -182,7 +182,7 @@ TEST(StatsAvgStorTest, SetValueResult) */ TEST(StatsAvgStorDeathTest, Result) { - Stats::AvgStor stor(nullptr); + statistics::AvgStor stor(nullptr); increaseTick(); ASSERT_DEATH(stor.result(), ".+"); } @@ -194,9 +194,9 @@ TEST(StatsAvgStorDeathTest, Result) */ TEST(StatsAvgStorTest, Prepare) { - Stats::AvgStor stor(nullptr); - Stats::Counter val = 10; - Stats::Result total = 0; + statistics::AvgStor stor(nullptr); + statistics::Counter val = 10; + statistics::Result total = 0; Tick last_reset = 0; Tick last_tick = 0; @@ -204,25 +204,25 @@ TEST(StatsAvgStorTest, Prepare) stor.set(val); last_tick = curTick(); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(total + val) / - Stats::Result(curTick() - last_reset + 1)); + ASSERT_EQ(stor.result(), statistics::Result(total + val) / + statistics::Result(curTick() - last_reset + 1)); increaseTick(); total += val * (curTick() - last_tick); stor.prepare(nullptr); last_tick = curTick(); ASSERT_EQ(stor.value(), val); - ASSERT_EQ(stor.result(), Stats::Result(total + val) / - Stats::Result(curTick() - last_reset + 1)); + ASSERT_EQ(stor.result(), statistics::Result(total + val) / + statistics::Result(curTick() - last_reset + 1)); increaseTick(); } /** Test whether incrementing and decrementing work as expected. */ TEST(StatsAvgStorTest, IncDec) { - Stats::AvgStor stor(nullptr); - Stats::Counter diff_val = 10; - Stats::Counter val = 0; + statistics::AvgStor stor(nullptr); + statistics::Counter diff_val = 10; + statistics::Counter val = 0; stor.set(diff_val); val += diff_val; @@ -252,8 +252,8 @@ TEST(StatsAvgStorTest, IncDec) */ TEST(StatsAvgStorTest, ZeroReset) { - Stats::AvgStor stor(nullptr); - Stats::Counter val = 10; + statistics::AvgStor stor(nullptr); + statistics::Counter val = 10; ASSERT_TRUE(stor.zero()); @@ -273,7 +273,7 @@ TEST(StatsAvgStorTest, ZeroReset) /** Test that an assertion is thrown when bucket size is 0. */ TEST(StatsDistStorDeathTest, BucketSize0) { - EXPECT_ANY_THROW(Stats::DistStor::Params params(0, 5, 0)); + EXPECT_ANY_THROW(statistics::DistStor::Params params(0, 5, 0)); } #endif @@ -284,11 +284,11 @@ TEST(StatsDistStorDeathTest, BucketSize0) */ TEST(StatsDistStorTest, ZeroReset) { - Stats::DistStor::Params params(0, 99, 10); + statistics::DistStor::Params params(0, 99, 10); MockInfo info(¶ms); - Stats::DistStor stor(&info); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; + statistics::DistStor stor(&info); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; ASSERT_TRUE(stor.zero()); @@ -306,14 +306,14 @@ TEST(StatsDistStorTest, ZeroReset) */ TEST(StatsDistStorTest, Size) { - Stats::Counter val = 10; - Stats::Counter num_samples = 5; - Stats::Counter size = 20; - Stats::DistData data; + statistics::Counter val = 10; + statistics::Counter num_samples = 5; + statistics::Counter size = 20; + statistics::DistData data; - Stats::DistStor::Params params(0, 19, 1); + statistics::DistStor::Params params(0, 19, 1); MockInfo info(¶ms); - Stats::DistStor stor(&info); + statistics::DistStor stor(&info); ASSERT_EQ(stor.size(), size); stor.sample(val, num_samples); @@ -334,8 +334,8 @@ TEST(StatsDistStorTest, Size) * @param no_log Whether log should not be compared. */ void -checkExpectedDistData(const Stats::DistData& data, - const Stats::DistData& expected_data, bool no_log = true) +checkExpectedDistData(const statistics::DistData& data, + const statistics::DistData& expected_data, bool no_log = true) { ASSERT_EQ(data.type, expected_data.type); ASSERT_EQ(data.min, expected_data.min); @@ -366,14 +366,14 @@ checkExpectedDistData(const Stats::DistData& data, * setup to the expected values: bucket_size, min, max_val, and cvec. */ void -prepareCheckDistStor(Stats::DistStor::Params& params, ValueSamples* values, - int num_values, Stats::DistData& expected_data) +prepareCheckDistStor(statistics::DistStor::Params& params, + ValueSamples* values, int num_values, statistics::DistData& expected_data) { MockInfo info(¶ms); - Stats::DistStor stor(&info); + statistics::DistStor stor(&info); - Stats::Counter val; - Stats::DistData data; + statistics::Counter val; + statistics::DistData data; expected_data.min = params.min; expected_data.max = params.max; @@ -400,14 +400,14 @@ prepareCheckDistStor(Stats::DistStor::Params& params, ValueSamples* values, /** Test setting and getting value from storage. */ TEST(StatsDistStorTest, SamplePrepareSingle) { - Stats::DistStor::Params params(0, 99, 5); + statistics::DistStor::Params params(0, 99, 5); ValueSamples values[] = {{10, 5}}; int num_values = sizeof(values) / sizeof(ValueSamples); // Setup expected data - Stats::DistData expected_data; - expected_data.type = Stats::Dist; + statistics::DistData expected_data; + expected_data.type = statistics::Dist; expected_data.bucket_size = params.bucket_size; expected_data.underflow = 0; expected_data.overflow = 0; @@ -423,7 +423,7 @@ TEST(StatsDistStorTest, SamplePrepareSingle) /** Test setting and getting value from storage with multiple values. */ TEST(StatsDistStorTest, SamplePrepareMultiple) { - Stats::DistStor::Params params(0, 99, 5); + statistics::DistStor::Params params(0, 99, 5); // There are 20 buckets: [0,5[, [5,10[, [10,15[, ..., [95,100[. // We test that values that pass the maximum bucket value (1234, 12345678, @@ -436,8 +436,8 @@ TEST(StatsDistStorTest, SamplePrepareMultiple) int num_values = sizeof(values) / sizeof(ValueSamples); // Setup variables that should always match params' values - Stats::DistData expected_data; - expected_data.type = Stats::Dist; + statistics::DistData expected_data; + expected_data.type = statistics::Dist; expected_data.min_val = -10; expected_data.max_val = 12345678; expected_data.bucket_size = params.bucket_size; @@ -460,9 +460,9 @@ TEST(StatsDistStorTest, SamplePrepareMultiple) /** Test resetting storage. */ TEST(StatsDistStorTest, Reset) { - Stats::DistStor::Params params(0, 99, 5); + statistics::DistStor::Params params(0, 99, 5); MockInfo info(¶ms); - Stats::DistStor stor(&info); + statistics::DistStor stor(&info); // Populate storage with random samples ValueSamples values[] = {{10, 5}, {1234, 2}, {12345678, 99}, {-10, 4}, @@ -474,11 +474,11 @@ TEST(StatsDistStorTest, Reset) // Reset storage, and make sure all data has been cleared stor.reset(&info); - Stats::DistData data; + statistics::DistData data; stor.prepare(&info, data); - Stats::DistData expected_data; - expected_data.type = Stats::Dist; + statistics::DistData expected_data; + expected_data.type = statistics::Dist; expected_data.bucket_size = params.bucket_size; expected_data.underflow = 0; expected_data.overflow = 0; @@ -499,13 +499,13 @@ TEST(StatsDistStorTest, Reset) /** Test that an assertion is thrown when not enough buckets are provided. */ TEST(StatsHistStorDeathTest, NotEnoughBuckets0) { - EXPECT_ANY_THROW(Stats::HistStor::Params params(0)); + EXPECT_ANY_THROW(statistics::HistStor::Params params(0)); } /** Test that an assertion is thrown when not enough buckets are provided. */ TEST(StatsHistStorDeathTest, NotEnoughBuckets1) { - EXPECT_ANY_THROW(Stats::HistStor::Params params(1)); + EXPECT_ANY_THROW(statistics::HistStor::Params params(1)); } #endif @@ -516,11 +516,11 @@ TEST(StatsHistStorDeathTest, NotEnoughBuckets1) */ TEST(StatsHistStorTest, ZeroReset) { - Stats::HistStor::Params params(10); + statistics::HistStor::Params params(10); MockInfo info(¶ms); - Stats::HistStor stor(&info); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; + statistics::HistStor stor(&info); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; ASSERT_TRUE(stor.zero()); @@ -538,15 +538,15 @@ TEST(StatsHistStorTest, ZeroReset) */ TEST(StatsHistStorTest, Size) { - Stats::Counter val = 10; - Stats::Counter num_samples = 5; - Stats::DistData data; - Stats::size_type sizes[] = {2, 10, 1234}; + statistics::Counter val = 10; + statistics::Counter num_samples = 5; + statistics::DistData data; + statistics::size_type sizes[] = {2, 10, 1234}; - for (int i = 0; i < (sizeof(sizes) / sizeof(Stats::size_type)); i++) { - Stats::HistStor::Params params(sizes[i]); + for (int i = 0; i < (sizeof(sizes) / sizeof(statistics::size_type)); i++) { + statistics::HistStor::Params params(sizes[i]); MockInfo info(¶ms); - Stats::HistStor stor(&info); + statistics::HistStor stor(&info); ASSERT_EQ(stor.size(), sizes[i]); stor.sample(val, num_samples); @@ -571,14 +571,14 @@ TEST(StatsHistStorTest, Size) * setup to the expected values: bucket_size, min, max_val, and cvec. */ void -prepareCheckHistStor(Stats::HistStor::Params& params, ValueSamples* values, - int num_values, Stats::DistData& expected_data) +prepareCheckHistStor(statistics::HistStor::Params& params, + ValueSamples* values, int num_values, statistics::DistData& expected_data) { MockInfo info(¶ms); - Stats::HistStor stor(&info); + statistics::HistStor stor(&info); - Stats::Counter val; - Stats::DistData data; + statistics::Counter val; + statistics::DistData data; bool no_log = false; expected_data.min_val = expected_data.min; @@ -614,15 +614,15 @@ prepareCheckHistStor(Stats::HistStor::Params& params, ValueSamples* values, */ TEST(StatsHistStorTest, SamplePrepareFit) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); // Setup expected data for the hand-carved values given. The final buckets // will be divided at: // Bkt0=[0,1[ , Bkt1=[1,2[, Bkt2=[2,3[, Bkt3=[3,4[ ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {3, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 1; expected_data.min = 0; expected_data.max_val = 3; @@ -642,7 +642,7 @@ TEST(StatsHistStorTest, SamplePrepareFit) */ TEST(StatsHistStorTest, SamplePrepareSingleGrowUp) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); // Setup expected data for the hand-carved values given. Since there // are four buckets, and the highest value is 4, the bucket size will @@ -650,8 +650,8 @@ TEST(StatsHistStorTest, SamplePrepareSingleGrowUp) // Bkt0=[0,2[ , Bkt1=[2,4[, Bkt2=[4,6[, Bkt3=[6,8[ ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {4, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 2; expected_data.min = 0; expected_data.max_val = 6; @@ -671,7 +671,7 @@ TEST(StatsHistStorTest, SamplePrepareSingleGrowUp) */ TEST(StatsHistStorTest, SamplePrepareMultipleGrowUp) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); // Setup expected data for the hand-carved values given. Since there // are four buckets, and the highest value is 4, the bucket size will @@ -679,8 +679,8 @@ TEST(StatsHistStorTest, SamplePrepareMultipleGrowUp) // Bkt0=[0,8[ , Bkt1=[8,16[, Bkt2=[16,24[, Bkt3=[24,32[ ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {16, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 8; expected_data.min = 0; expected_data.max_val = 24; @@ -701,7 +701,7 @@ TEST(StatsHistStorTest, SamplePrepareMultipleGrowUp) */ TEST(StatsHistStorTest, SamplePrepareGrowDownOddBuckets) { - Stats::HistStor::Params params(5); + statistics::HistStor::Params params(5); // Setup expected data for the hand-carved values given. Since there // is a negative value, the min bucket will change, and the bucket size @@ -710,8 +710,8 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownOddBuckets) ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {3, 12}, {4, 33}, {-1, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 2; expected_data.min = -4; expected_data.max_val = 4; @@ -733,7 +733,7 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownOddBuckets) */ TEST(StatsHistStorTest, SamplePrepareGrowDownEvenBuckets) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); // Setup expected data for the hand-carved values given. Since there // is a negative value, the min bucket will change, and the bucket size @@ -741,8 +741,8 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownEvenBuckets) // Bkt0=[-4,-2[ , Bkt1=[-2,0[, Bkt2=[0,2[, Bkt3=[2,4[ ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {-1, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 2; expected_data.min = -4; expected_data.max_val = 2; @@ -763,7 +763,7 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownEvenBuckets) */ TEST(StatsHistStorTest, SamplePrepareGrowDownGrowOutOddBuckets) { - Stats::HistStor::Params params(5); + statistics::HistStor::Params params(5); // Setup expected data for the hand-carved values given. Since there // is a negative value, the min bucket will change, and the bucket size @@ -772,8 +772,8 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownGrowOutOddBuckets) ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {3, 12}, {4, 33}, {-12, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 8; expected_data.min = -16; expected_data.max_val = 16; @@ -795,7 +795,7 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownGrowOutOddBuckets) */ TEST(StatsHistStorTest, SamplePrepareGrowDownGrowOutEvenBuckets) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); // Setup expected data for the hand-carved values given. Since there // is a negative value, the min bucket will change, and the bucket size @@ -804,8 +804,8 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownGrowOutEvenBuckets) ValueSamples values[] = {{0, 5}, {1, 2}, {2, 99}, {3, 12}, {-12, 4}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 8; expected_data.min = -16; expected_data.max_val = 8; @@ -826,7 +826,7 @@ TEST(StatsHistStorTest, SamplePrepareGrowDownGrowOutEvenBuckets) */ TEST(StatsHistStorTest, SamplePrepareMultipleGrowOddBuckets) { - Stats::HistStor::Params params(5); + statistics::HistStor::Params params(5); // Setup expected data for the hand-carved values given. This adds quite // a few positive and negative samples, and the bucket size will grow to @@ -836,8 +836,8 @@ TEST(StatsHistStorTest, SamplePrepareMultipleGrowOddBuckets) ValueSamples values[] = {{0, 5}, {7, 2}, {31, 99}, {-8, 12}, {127, 4}, {-120, 53}, {-50, 1}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 64; expected_data.min = -128; expected_data.max_val = 128; @@ -859,7 +859,7 @@ TEST(StatsHistStorTest, SamplePrepareMultipleGrowOddBuckets) */ TEST(StatsHistStorTest, SamplePrepareMultipleGrowEvenBuckets) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); // Setup expected data for the hand-carved values given. This adds quite // a few positive and negative samples, and the bucket size will grow to @@ -868,8 +868,8 @@ TEST(StatsHistStorTest, SamplePrepareMultipleGrowEvenBuckets) ValueSamples values[] = {{0, 5}, {7, 2}, {31, 99}, {-8, 12}, {127, 4}, {-120, 53}, {-50, 1}}; const int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 64; expected_data.min = -128; expected_data.max_val = 64; @@ -886,9 +886,9 @@ TEST(StatsHistStorTest, SamplePrepareMultipleGrowEvenBuckets) /** Test resetting storage. */ TEST(StatsHistStorTest, Reset) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); MockInfo info(¶ms); - Stats::HistStor stor(&info); + statistics::HistStor stor(&info); // Setup expected data for the hand-carved values given. This adds quite // a few positive and negative samples, and the bucket size will grow to @@ -904,8 +904,8 @@ TEST(StatsHistStorTest, Reset) // Reset storage, and make sure all data has been cleared: // Bkt0=[0,1[ , Bkt1=[1,2[, Bkt2=[2,3[, Bkt3=[3,4[ stor.reset(&info); - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 1; expected_data.min = 0; expected_data.max_val = 3; @@ -918,13 +918,13 @@ TEST(StatsHistStorTest, Reset) /** Test whether adding storages with different sizes triggers an assertion. */ TEST(StatsHistStorDeathTest, AddDifferentSize) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); MockInfo info(¶ms); - Stats::HistStor stor(&info); + statistics::HistStor stor(&info); - Stats::HistStor::Params params2(5); + statistics::HistStor::Params params2(5); MockInfo info2(¶ms2); - Stats::HistStor stor2(&info2); + statistics::HistStor stor2(&info2); ASSERT_DEATH(stor.add(&stor2), ".+"); } @@ -932,15 +932,15 @@ TEST(StatsHistStorDeathTest, AddDifferentSize) /** Test whether adding storages with different min triggers an assertion. */ TEST(StatsHistStorDeathTest, AddDifferentMin) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); MockInfo info(¶ms); - Stats::HistStor stor(&info); + statistics::HistStor stor(&info); stor.sample(-1, 3); // On creation, the storage's min is zero - Stats::HistStor::Params params2(4); + statistics::HistStor::Params params2(4); MockInfo info2(¶ms2); - Stats::HistStor stor2(&info2); + statistics::HistStor stor2(&info2); ASSERT_DEATH(stor.add(&stor2), ".+"); } @@ -949,40 +949,40 @@ TEST(StatsHistStorDeathTest, AddDifferentMin) /** Test merging two histograms. */ TEST(StatsHistStorTest, Add) { - Stats::HistStor::Params params(4); + statistics::HistStor::Params params(4); MockInfo info(¶ms); // Setup first storage. Buckets are: // Bkt0=[0,16[, Bkt1=[16,32[, Bkt2=[32,48[, Bkt3=[58,64[ - Stats::HistStor stor(&info); + statistics::HistStor stor(&info); ValueSamples values[] = {{0, 5}, {3, 2}, {20, 37}, {32, 18}}; int num_values = sizeof(values) / sizeof(ValueSamples); for (int i = 0; i < num_values; i++) { stor.sample(values[i].value, values[i].numSamples); } - Stats::DistData data; + statistics::DistData data; stor.prepare(&info, data); // Setup second storage. Buckets are: // Bkt0=[0,32[, Bkt1=[32,64[, Bkt2=[64,96[, Bkt3=[96,128[ - Stats::HistStor stor2(&info); + statistics::HistStor stor2(&info); ValueSamples values2[] = {{10, 10}, {0, 1}, {80, 4}, {17, 100}, {95, 79}}; int num_values2 = sizeof(values2) / sizeof(ValueSamples); for (int i = 0; i < num_values2; i++) { stor2.sample(values2[i].value, values2[i].numSamples); } - Stats::DistData data2; + statistics::DistData data2; stor2.prepare(&info, data2); // Perform the merge stor.add(&stor2); - Stats::DistData merge_data; + statistics::DistData merge_data; stor.prepare(&info, merge_data); // Setup expected data. Buckets are: // Bkt0=[0,32[, Bkt1=[32,64[, Bkt2=[64,96[, Bkt3=[96,128[ - Stats::DistData expected_data; - expected_data.type = Stats::Hist; + statistics::DistData expected_data; + expected_data.type = statistics::Hist; expected_data.bucket_size = 32; expected_data.min = 0; expected_data.max = 127; @@ -1010,9 +1010,9 @@ TEST(StatsHistStorTest, Add) */ TEST(StatsSampleStorTest, ZeroReset) { - Stats::SampleStor stor(nullptr); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; + statistics::SampleStor stor(nullptr); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; ASSERT_TRUE(stor.zero()); @@ -1027,20 +1027,20 @@ TEST(StatsSampleStorTest, ZeroReset) /** Test setting and getting value from storage. */ TEST(StatsSampleStorTest, SamplePrepare) { - Stats::SampleStor stor(nullptr); + statistics::SampleStor stor(nullptr); ValueSamples values[] = {{10, 5}, {1234, 2}, {0xFFFFFFFF, 18}}; int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::Counter val; - Stats::DistData data; - Stats::DistData expected_data; - Stats::SampleStor::Params params; + statistics::Counter val; + statistics::DistData data; + statistics::DistData expected_data; + statistics::SampleStor::Params params; MockInfo info(¶ms); // Simple test with one value being sampled stor.sample(values[0].value, values[0].numSamples); stor.prepare(&info, data); val = values[0].value * values[0].numSamples; - expected_data.type = Stats::Deviation; + expected_data.type = statistics::Deviation; expected_data.sum = val; expected_data.squares = values[0].value * val; expected_data.samples = values[0].numSamples; @@ -1079,11 +1079,11 @@ TEST(StatsSampleStorTest, SamplePrepare) /** The size is always 1, no matter which functions have been called. */ TEST(StatsSampleStorTest, Size) { - Stats::SampleStor stor(nullptr); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; - Stats::DistData data; - Stats::SampleStor::Params params; + statistics::SampleStor stor(nullptr); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; + statistics::DistData data; + statistics::SampleStor::Params params; MockInfo info(¶ms); ASSERT_EQ(stor.size(), 1); @@ -1104,9 +1104,9 @@ TEST(StatsSampleStorTest, Size) */ TEST(StatsAvgSampleStorTest, ZeroReset) { - Stats::AvgSampleStor stor(nullptr); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; + statistics::AvgSampleStor stor(nullptr); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; ASSERT_TRUE(stor.zero()); @@ -1121,20 +1121,20 @@ TEST(StatsAvgSampleStorTest, ZeroReset) /** Test setting and getting value from storage. */ TEST(StatsAvgSampleStorTest, SamplePrepare) { - Stats::AvgSampleStor stor(nullptr); + statistics::AvgSampleStor stor(nullptr); ValueSamples values[] = {{10, 5}, {1234, 2}, {0xFFFFFFFF, 18}}; int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::Counter val; - Stats::DistData data; - Stats::DistData expected_data; - Stats::AvgSampleStor::Params params; + statistics::Counter val; + statistics::DistData data; + statistics::DistData expected_data; + statistics::AvgSampleStor::Params params; MockInfo info(¶ms); // Simple test with one value being sampled stor.sample(values[0].value, values[0].numSamples); stor.prepare(&info, data); val = values[0].value * values[0].numSamples; - expected_data.type = Stats::Deviation; + expected_data.type = statistics::Deviation; expected_data.sum = val; expected_data.squares = values[0].value * val; ASSERT_EQ(data.type, expected_data.type); @@ -1174,11 +1174,11 @@ TEST(StatsAvgSampleStorTest, SamplePrepare) /** The size is always 1, no matter which functions have been called. */ TEST(StatsAvgSampleStorTest, Size) { - Stats::AvgSampleStor stor(nullptr); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; - Stats::DistData data; - Stats::AvgSampleStor::Params params; + statistics::AvgSampleStor stor(nullptr); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; + statistics::DistData data; + statistics::AvgSampleStor::Params params; MockInfo info(¶ms); ASSERT_EQ(stor.size(), 1); @@ -1199,9 +1199,9 @@ TEST(StatsAvgSampleStorTest, Size) */ TEST(StatsSparseHistStorTest, ZeroReset) { - Stats::SparseHistStor stor(nullptr); - Stats::Counter val = 10; - Stats::Counter num_samples = 5; + statistics::SparseHistStor stor(nullptr); + statistics::Counter val = 10; + statistics::Counter num_samples = 5; ASSERT_TRUE(stor.zero()); @@ -1216,11 +1216,11 @@ TEST(StatsSparseHistStorTest, ZeroReset) /** Test setting and getting value from storage. */ TEST(StatsSparseHistStorTest, SamplePrepare) { - Stats::SparseHistStor stor(nullptr); + statistics::SparseHistStor stor(nullptr); ValueSamples values[] = {{10, 5}, {1234, 2}, {0xFFFFFFFF, 18}}; int num_values = sizeof(values) / sizeof(ValueSamples); - Stats::Counter total_samples; - Stats::SparseHistData data; + statistics::Counter total_samples; + statistics::SparseHistData data; // Simple test with one value being sampled stor.sample(values[0].value, values[0].numSamples); diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index b8b49ac153..8791e45e05 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -64,7 +64,9 @@ constexpr auto Nan = std::numeric_limits::quiet_NaN(); } // anonymous namespace -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ std::list &statsList(); @@ -390,7 +392,7 @@ VectorPrint::operator()(std::ostream &stream) const } } - if (flags.isSet(::Stats::total)) { + if (flags.isSet(::statistics::total)) { print.pdf = Nan; print.cdf = Nan; print.name = base + "total"; @@ -688,7 +690,7 @@ Text::visit(const Vector2dInfo &info) std::vector total_subname; total_subname.push_back("total"); - if (info.flags.isSet(::Stats::total) && (info.x > 1)) { + if (info.flags.isSet(::statistics::total) && (info.x > 1)) { print.name = statName(info.name); print.subnames = total_subname; print.desc = info.desc; @@ -812,4 +814,4 @@ initText(const std::string &filename, bool desc, bool spaces) return &text; } -} // namespace Stats +} // namespace statistics diff --git a/src/base/stats/text.hh b/src/base/stats/text.hh index 5121a4f3aa..547c198a50 100644 --- a/src/base/stats/text.hh +++ b/src/base/stats/text.hh @@ -45,11 +45,14 @@ #include #include +#include "base/compiler.hh" +#include "base/output.hh" #include "base/stats/output.hh" #include "base/stats/types.hh" -#include "base/output.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ class Text : public Output { @@ -101,6 +104,6 @@ std::string ValueToString(Result value, int precision); Output *initText(const std::string &filename, bool desc, bool spaces); -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_TEXT_HH__ diff --git a/src/base/stats/types.hh b/src/base/stats/types.hh index adb64d043e..df485bccce 100644 --- a/src/base/stats/types.hh +++ b/src/base/stats/types.hh @@ -33,9 +33,12 @@ #include #include +#include "base/compiler.hh" #include "base/types.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ /** All counters are of 64-bit values. */ typedef double Counter; @@ -54,6 +57,6 @@ typedef std::vector VResult; typedef unsigned int size_type; typedef unsigned int off_type; -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_TYPES_HH__ diff --git a/src/base/stats/units.hh b/src/base/stats/units.hh index b6046a48e9..718a68f2e7 100644 --- a/src/base/stats/units.hh +++ b/src/base/stats/units.hh @@ -38,41 +38,43 @@ * Convenience macros to declare the unit of a stat. */ #define UNIT_CYCLE GEM5_DEPRECATED_MACRO( \ - UNIT_CYCLE, Stats::units::Cycle::get(), \ - "Use Stats::units::Cycle::get()") + UNIT_CYCLE, statistics::units::Cycle::get(), \ + "Use statistics::units::Cycle::get()") #define UNIT_TICK GEM5_DEPRECATED_MACRO( \ - UNIT_TICK, Stats::units::Tick::get(), "Use Stats::units::Tick::get()") + UNIT_TICK, statistics::units::Tick::get(), "Use statistics::units::Tick::get()") #define UNIT_SECOND GEM5_DEPRECATED_MACRO( \ - UNIT_SECOND, Stats::units::Second::get(), \ - "Use Stats::units::Second::get()") + UNIT_SECOND, statistics::units::Second::get(), \ + "Use statistics::units::Second::get()") #define UNIT_BIT GEM5_DEPRECATED_MACRO( \ - UNIT_BIT, Stats::units::Bit::get(), "Use Stats::units::Bit::get()") + UNIT_BIT, statistics::units::Bit::get(), "Use statistics::units::Bit::get()") #define UNIT_BYTE GEM5_DEPRECATED_MACRO( \ - UNIT_BYTE, Stats::units::Byte::get(), "Use Stats::units::Byte::get()") + UNIT_BYTE, statistics::units::Byte::get(), "Use statistics::units::Byte::get()") #define UNIT_JOULE GEM5_DEPRECATED_MACRO( \ - UNIT_JOULE, Stats::units::Joule::get(), \ - "Use Stats::units::Joule::get()") + UNIT_JOULE, statistics::units::Joule::get(), \ + "Use statistics::units::Joule::get()") #define UNIT_VOLT GEM5_DEPRECATED_MACRO( \ - UNIT_VOLD, Stats::units::Volt::get(), "Use Stats::units::Volt::get()") + UNIT_VOLD, statistics::units::Volt::get(), "Use statistics::units::Volt::get()") #define UNIT_CELSIUS GEM5_DEPRECATED_MACRO( \ - UNIT_CELSIUS, Stats::units::DegreeCelsius::get(), \ - "Use Stats::units::DegreeCelsius::get()") + UNIT_CELSIUS, statistics::units::DegreeCelsius::get(), \ + "Use statistics::units::DegreeCelsius::get()") #define UNIT_RATE(T1, T2) GEM5_DEPRECATED_MACRO( \ - UNIT_RATE, (Stats::units::Rate::get()), \ - "Use Stats::units::Rate::get()") + UNIT_RATE, (statistics::units::Rate::get()), \ + "Use statistics::units::Rate::get()") #define UNIT_RATIO GEM5_DEPRECATED_MACRO( \ - UNIT_RATIO, Stats::units::Ratio::get(), \ - "Use Stats::units::Ratio::get()") + UNIT_RATIO, statistics::units::Ratio::get(), \ + "Use statistics::units::Ratio::get()") #define UNIT_COUNT GEM5_DEPRECATED_MACRO( \ - UNIT_COUNT, Stats::units::Count::get(), \ - "Use Stats::units::Count::get()") + UNIT_COUNT, statistics::units::Count::get(), \ + "Use statistics::units::Count::get()") #define UNIT_WATT GEM5_DEPRECATED_MACRO( \ - UNIT_WATT, Stats::units::Watt::get(), "Use Stats::units::Watt::get()") + UNIT_WATT, statistics::units::Watt::get(), "Use statistics::units::Watt::get()") #define UNIT_UNSPECIFIED GEM5_DEPRECATED_MACRO( \ - UNIT_UNSPECIFIED, Stats::units::Unspecified::get(), \ - "Use Stats::units::Unspecified::get()") + UNIT_UNSPECIFIED, statistics::units::Unspecified::get(), \ + "Use statistics::units::Unspecified::get()") -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ /** * Units for Stats. @@ -337,10 +339,10 @@ class Unspecified : public Base template class Rate : public Base { - static_assert(std::is_base_of::value, - "Rate(T1,T2) must have T1 and T2 derived from Stats::units::Base"); - static_assert(std::is_base_of::value, - "Rate(T1,T2) must have T1 and T2 derived from Stats::units::Base"); + static_assert(std::is_base_of::value, "Rate(T1,T2) must have " + "T1 and T2 derived from statistics::units::Base"); + static_assert(std::is_base_of::value, "Rate(T1,T2) must have " + "T1 and T2 derived from statistics::units::Base"); static_assert(!std::is_same::value || std::is_same::value || std::is_same::value, "Rate(T1,T2) must have T1 and T2 of different types; " @@ -371,6 +373,6 @@ class Rate : public Base } // namespace units -} // namespace Stats +} // namespace statistics #endif // __BASE_STATS_UNITS_HH__ diff --git a/src/base/stats/units.test.cc b/src/base/stats/units.test.cc index 9353cffe21..db9c27b9bd 100644 --- a/src/base/stats/units.test.cc +++ b/src/base/stats/units.test.cc @@ -33,103 +33,113 @@ TEST(StatsUnitsTest, Cycle) { - Stats::units::Cycle *unit = Stats::units::Cycle::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Cycle::toString()); + statistics::units::Cycle *unit = statistics::units::Cycle::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Cycle::toString()); } TEST(StatsUnitsTest, Tick) { - Stats::units::Tick *unit = Stats::units::Tick::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Tick::toString()); + statistics::units::Tick *unit = statistics::units::Tick::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Tick::toString()); } TEST(StatsUnitsTest, Second) { - Stats::units::Second *unit = Stats::units::Second::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Second::toString()); + statistics::units::Second *unit = statistics::units::Second::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Second::toString()); } TEST(StatsUnitsTest, Bit) { - Stats::units::Bit *unit = Stats::units::Bit::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Bit::toString()); + statistics::units::Bit *unit = statistics::units::Bit::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Bit::toString()); } TEST(StatsUnitsTest, Byte) { - Stats::units::Byte *unit = Stats::units::Byte::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Byte::toString()); + statistics::units::Byte *unit = statistics::units::Byte::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Byte::toString()); } TEST(StatsUnitsTest, Watt) { - Stats::units::Watt *unit = Stats::units::Watt::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Watt::toString()); + statistics::units::Watt *unit = statistics::units::Watt::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Watt::toString()); } TEST(StatsUnitsTest, Joule) { - Stats::units::Joule *unit = Stats::units::Joule::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Joule::toString()); + statistics::units::Joule *unit = statistics::units::Joule::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Joule::toString()); } TEST(StatsUnitsTest, Volt) { - Stats::units::Volt *unit = Stats::units::Volt::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Volt::toString()); + statistics::units::Volt *unit = statistics::units::Volt::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Volt::toString()); } TEST(StatsUnitsTest, DegreeCelsius) { - Stats::units::DegreeCelsius *unit = Stats::units::DegreeCelsius::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::DegreeCelsius::toString()); + statistics::units::DegreeCelsius *unit = + statistics::units::DegreeCelsius::get(); + ASSERT_EQ(unit->getUnitString(), + statistics::units::DegreeCelsius::toString()); } TEST(StatsUnitsTest, Count) { - Stats::units::Count *unit = Stats::units::Count::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Count::toString()); + statistics::units::Count *unit = statistics::units::Count::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Count::toString()); } TEST(StatsUnitsTest, Rate1) { - Stats::units::Rate *unit = - Stats::units::Rate::get(); + statistics::units::Rate *unit = + statistics::units::Rate::get(); ASSERT_EQ(unit->getUnitString(), "(Count/Count)"); - ASSERT_EQ(unit->getUnitString(), (Stats::units::Rate::toString())); + ASSERT_EQ(unit->getUnitString(), + (statistics::units::Rate::toString())); } TEST(StatsUnitsTest, Rate2) { - Stats::units::Rate *unit = - Stats::units::Rate::get(); + statistics::units::Rate *unit = + statistics::units::Rate::get(); ASSERT_EQ(unit->getUnitString(), "(Tick/Second)"); - ASSERT_EQ(unit->getUnitString(), (Stats::units::Rate::toString())); + ASSERT_EQ(unit->getUnitString(), + (statistics::units::Rate::toString())); } TEST(StatsUnitsTest, RateOfRates) { - typedef Stats::units::Rate - BitPerSecond; - typedef Stats::units::Rate - CountPerCycle; - Stats::units::Rate *unit = - Stats::units::Rate::get(); + typedef statistics::units::Rate BitPerSecond; + typedef statistics::units::Rate CountPerCycle; + statistics::units::Rate *unit = + statistics::units::Rate::get(); ASSERT_EQ(unit->getUnitString(), "((Bit/Second)/(Count/Cycle))"); ASSERT_EQ(unit->getUnitString(), - (Stats::units::Rate::toString())); + (statistics::units::Rate::toString())); } TEST(StatsUnitsTest, Ratio) { - Stats::units::Ratio *unit = Stats::units::Ratio::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Ratio::toString()); + statistics::units::Ratio *unit = statistics::units::Ratio::get(); + ASSERT_EQ(unit->getUnitString(), statistics::units::Ratio::toString()); } TEST(StatsUnitsTest, Unspecified) { - Stats::units::Unspecified *unit = Stats::units::Unspecified::get(); - ASSERT_EQ(unit->getUnitString(), Stats::units::Unspecified::toString()); + statistics::units::Unspecified *unit = + statistics::units::Unspecified::get(); + ASSERT_EQ(unit->getUnitString(), + statistics::units::Unspecified::toString()); } diff --git a/src/cpu/base.cc b/src/cpu/base.cc index 2a715ebae4..1267e0be92 100644 --- a/src/cpu/base.cc +++ b/src/cpu/base.cc @@ -368,13 +368,13 @@ BaseCPU::probeInstCommit(const StaticInstPtr &inst, Addr pc) } BaseCPU:: -BaseCPUStats::BaseCPUStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(numCycles, Stats::units::Cycle::get(), +BaseCPUStats::BaseCPUStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(numCycles, statistics::units::Cycle::get(), "Number of cpu cycles simulated"), - ADD_STAT(numWorkItemsStarted, Stats::units::Count::get(), + ADD_STAT(numWorkItemsStarted, statistics::units::Count::get(), "Number of work items this cpu started"), - ADD_STAT(numWorkItemsCompleted, Stats::units::Count::get(), + ADD_STAT(numWorkItemsCompleted, statistics::units::Count::get(), "Number of work items this cpu completed") { } @@ -390,7 +390,7 @@ BaseCPU::regStats() globalStats.reset(new GlobalStats(Root::root())); } - using namespace Stats; + using namespace statistics; int size = threadContexts.size(); if (size > 1) { @@ -726,17 +726,17 @@ BaseCPU::traceFunctionsInternal(Addr pc) } -BaseCPU::GlobalStats::GlobalStats(::Stats::Group *parent) - : ::Stats::Group(parent), - ADD_STAT(simInsts, Stats::units::Count::get(), +BaseCPU::GlobalStats::GlobalStats(::statistics::Group *parent) + : ::statistics::Group(parent), + ADD_STAT(simInsts, statistics::units::Count::get(), "Number of instructions simulated"), - ADD_STAT(simOps, Stats::units::Count::get(), + ADD_STAT(simOps, statistics::units::Count::get(), "Number of ops (including micro ops) simulated"), - ADD_STAT(hostInstRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(hostInstRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Simulator instruction rate (inst/s)"), - ADD_STAT(hostOpRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(hostOpRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Simulator op (including micro ops) rate (op/s)") { simInsts diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 81b402710c..e274cfa685 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -146,15 +146,15 @@ class BaseCPU : public ClockedObject const unsigned int _cacheLineSize; /** Global CPU statistics that are merged into the Root object. */ - struct GlobalStats : public Stats::Group + struct GlobalStats : public statistics::Group { - GlobalStats(::Stats::Group *parent); + GlobalStats(::statistics::Group *parent); - ::Stats::Value simInsts; - ::Stats::Value simOps; + ::statistics::Value simInsts; + ::statistics::Value simOps; - ::Stats::Formula hostInstRate; - ::Stats::Formula hostOpRate; + ::statistics::Formula hostInstRate; + ::statistics::Formula hostOpRate; }; /** @@ -587,13 +587,13 @@ class BaseCPU : public ClockedObject } public: - struct BaseCPUStats : public Stats::Group + struct BaseCPUStats : public statistics::Group { - BaseCPUStats(Stats::Group *parent); + BaseCPUStats(statistics::Group *parent); // Number of CPU cycles simulated - Stats::Scalar numCycles; - Stats::Scalar numWorkItemsStarted; - Stats::Scalar numWorkItemsCompleted; + statistics::Scalar numCycles; + statistics::Scalar numWorkItemsStarted; + statistics::Scalar numWorkItemsCompleted; } baseStats; private: diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc index f3a5bdc371..fbf3a721ca 100644 --- a/src/cpu/kvm/base.cc +++ b/src/cpu/kvm/base.cc @@ -258,27 +258,27 @@ BaseKvmCPU::startupThread() } } -BaseKvmCPU::StatGroup::StatGroup(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(committedInsts, Stats::units::Count::get(), +BaseKvmCPU::StatGroup::StatGroup(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(committedInsts, statistics::units::Count::get(), "Number of instructions committed"), - ADD_STAT(numVMExits, Stats::units::Count::get(), + ADD_STAT(numVMExits, statistics::units::Count::get(), "total number of KVM exits"), - ADD_STAT(numVMHalfEntries, Stats::units::Count::get(), + ADD_STAT(numVMHalfEntries, statistics::units::Count::get(), "number of KVM entries to finalize pending operations"), - ADD_STAT(numExitSignal, Stats::units::Count::get(), + ADD_STAT(numExitSignal, statistics::units::Count::get(), "exits due to signal delivery"), - ADD_STAT(numMMIO, Stats::units::Count::get(), + ADD_STAT(numMMIO, statistics::units::Count::get(), "number of VM exits due to memory mapped IO"), - ADD_STAT(numCoalescedMMIO, Stats::units::Count::get(), + ADD_STAT(numCoalescedMMIO, statistics::units::Count::get(), "number of coalesced memory mapped IO requests"), - ADD_STAT(numIO, Stats::units::Count::get(), + ADD_STAT(numIO, statistics::units::Count::get(), "number of VM exits due to legacy IO"), - ADD_STAT(numHalt, Stats::units::Count::get(), + ADD_STAT(numHalt, statistics::units::Count::get(), "number of VM exits due to wait for interrupt instructions"), - ADD_STAT(numInterrupts, Stats::units::Count::get(), + ADD_STAT(numInterrupts, statistics::units::Count::get(), "number of interrupts delivered"), - ADD_STAT(numHypercalls, Stats::units::Count::get(), "number of hypercalls") + ADD_STAT(numHypercalls, statistics::units::Count::get(), "number of hypercalls") { } diff --git a/src/cpu/kvm/base.hh b/src/cpu/kvm/base.hh index 8c17a5f11b..a19152b1d6 100644 --- a/src/cpu/kvm/base.hh +++ b/src/cpu/kvm/base.hh @@ -781,19 +781,19 @@ class BaseKvmCPU : public BaseCPU public: /* @{ */ - struct StatGroup : public Stats::Group + struct StatGroup : public statistics::Group { - StatGroup(Stats::Group *parent); - Stats::Scalar committedInsts; - Stats::Scalar numVMExits; - Stats::Scalar numVMHalfEntries; - Stats::Scalar numExitSignal; - Stats::Scalar numMMIO; - Stats::Scalar numCoalescedMMIO; - Stats::Scalar numIO; - Stats::Scalar numHalt; - Stats::Scalar numInterrupts; - Stats::Scalar numHypercalls; + StatGroup(statistics::Group *parent); + statistics::Scalar committedInsts; + statistics::Scalar numVMExits; + statistics::Scalar numVMHalfEntries; + statistics::Scalar numExitSignal; + statistics::Scalar numMMIO; + statistics::Scalar numCoalescedMMIO; + statistics::Scalar numIO; + statistics::Scalar numHalt; + statistics::Scalar numInterrupts; + statistics::Scalar numHypercalls; } stats; /* @} */ diff --git a/src/cpu/minor/fetch2.cc b/src/cpu/minor/fetch2.cc index 55a3625e65..52d6ad753d 100644 --- a/src/cpu/minor/fetch2.cc +++ b/src/cpu/minor/fetch2.cc @@ -605,32 +605,32 @@ Fetch2::isDrained() } Fetch2::Fetch2Stats::Fetch2Stats(MinorCPU *cpu) - : Stats::Group(cpu, "fetch2"), - ADD_STAT(intInstructions, Stats::units::Count::get(), + : statistics::Group(cpu, "fetch2"), + ADD_STAT(intInstructions, statistics::units::Count::get(), "Number of integer instructions successfully decoded"), - ADD_STAT(fpInstructions, Stats::units::Count::get(), + ADD_STAT(fpInstructions, statistics::units::Count::get(), "Number of floating point instructions successfully decoded"), - ADD_STAT(vecInstructions, Stats::units::Count::get(), + ADD_STAT(vecInstructions, statistics::units::Count::get(), "Number of SIMD instructions successfully decoded"), - ADD_STAT(loadInstructions, Stats::units::Count::get(), + ADD_STAT(loadInstructions, statistics::units::Count::get(), "Number of memory load instructions successfully decoded"), - ADD_STAT(storeInstructions, Stats::units::Count::get(), + ADD_STAT(storeInstructions, statistics::units::Count::get(), "Number of memory store instructions successfully decoded"), - ADD_STAT(amoInstructions, Stats::units::Count::get(), + ADD_STAT(amoInstructions, statistics::units::Count::get(), "Number of memory atomic instructions successfully decoded") { intInstructions - .flags(Stats::total); + .flags(statistics::total); fpInstructions - .flags(Stats::total); + .flags(statistics::total); vecInstructions - .flags(Stats::total); + .flags(statistics::total); loadInstructions - .flags(Stats::total); + .flags(statistics::total); storeInstructions - .flags(Stats::total); + .flags(statistics::total); amoInstructions - .flags(Stats::total); + .flags(statistics::total); } void diff --git a/src/cpu/minor/fetch2.hh b/src/cpu/minor/fetch2.hh index dbe58e44f5..4ffeb56280 100644 --- a/src/cpu/minor/fetch2.hh +++ b/src/cpu/minor/fetch2.hh @@ -168,16 +168,16 @@ class Fetch2 : public Named std::vector fetchInfo; ThreadID threadPriority; - struct Fetch2Stats : public Stats::Group + struct Fetch2Stats : public statistics::Group { Fetch2Stats(MinorCPU *cpu); /** Stats */ - Stats::Scalar intInstructions; - Stats::Scalar fpInstructions; - Stats::Scalar vecInstructions; - Stats::Scalar loadInstructions; - Stats::Scalar storeInstructions; - Stats::Scalar amoInstructions; + statistics::Scalar intInstructions; + statistics::Scalar fpInstructions; + statistics::Scalar vecInstructions; + statistics::Scalar loadInstructions; + statistics::Scalar storeInstructions; + statistics::Scalar amoInstructions; } stats; protected: diff --git a/src/cpu/minor/stats.cc b/src/cpu/minor/stats.cc index c9794d1dd6..5d884dce53 100644 --- a/src/cpu/minor/stats.cc +++ b/src/cpu/minor/stats.cc @@ -42,26 +42,26 @@ namespace minor { MinorStats::MinorStats(BaseCPU *base_cpu) - : Stats::Group(base_cpu), - ADD_STAT(numInsts, Stats::units::Count::get(), + : statistics::Group(base_cpu), + ADD_STAT(numInsts, statistics::units::Count::get(), "Number of instructions committed"), - ADD_STAT(numOps, Stats::units::Count::get(), + ADD_STAT(numOps, statistics::units::Count::get(), "Number of ops (including micro ops) committed"), - ADD_STAT(numDiscardedOps, Stats::units::Count::get(), + ADD_STAT(numDiscardedOps, statistics::units::Count::get(), "Number of ops (including micro ops) which were discarded before " "commit"), - ADD_STAT(numFetchSuspends, Stats::units::Count::get(), + ADD_STAT(numFetchSuspends, statistics::units::Count::get(), "Number of times Execute suspended instruction fetching"), - ADD_STAT(quiesceCycles, Stats::units::Cycle::get(), + ADD_STAT(quiesceCycles, statistics::units::Cycle::get(), "Total number of cycles that CPU has spent quiesced or waiting " "for an interrupt"), - ADD_STAT(cpi, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(cpi, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "CPI: cycles per instruction"), - ADD_STAT(ipc, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(ipc, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "IPC: instructions per cycle"), - ADD_STAT(committedInstType, Stats::units::Count::get(), + ADD_STAT(committedInstType, statistics::units::Count::get(), "Class of committed instruction") { quiesceCycles.prereq(quiesceCycles); @@ -74,7 +74,7 @@ MinorStats::MinorStats(BaseCPU *base_cpu) committedInstType .init(base_cpu->numThreads, enums::Num_OpClass) - .flags(Stats::total | Stats::pdf | Stats::dist); + .flags(statistics::total | statistics::pdf | statistics::dist); committedInstType.ysubnames(enums::OpClassStrings); } diff --git a/src/cpu/minor/stats.hh b/src/cpu/minor/stats.hh index 601487cfd5..a38891f8c1 100644 --- a/src/cpu/minor/stats.hh +++ b/src/cpu/minor/stats.hh @@ -53,31 +53,31 @@ namespace minor { /** Currently unused stats class. */ -struct MinorStats : public Stats::Group +struct MinorStats : public statistics::Group { MinorStats(BaseCPU *parent); /** Number of simulated instructions */ - Stats::Scalar numInsts; + statistics::Scalar numInsts; /** Number of simulated insts and microops */ - Stats::Scalar numOps; + statistics::Scalar numOps; /** Number of ops discarded before committing */ - Stats::Scalar numDiscardedOps; + statistics::Scalar numDiscardedOps; /** Number of times fetch was asked to suspend by Execute */ - Stats::Scalar numFetchSuspends; + statistics::Scalar numFetchSuspends; /** Number of cycles in quiescent state */ - Stats::Scalar quiesceCycles; + statistics::Scalar quiesceCycles; /** CPI/IPC for total cycle counts and macro insts */ - Stats::Formula cpi; - Stats::Formula ipc; + statistics::Formula cpi; + statistics::Formula ipc; /** Number of instructions by type (OpClass) */ - Stats::Vector2d committedInstType; + statistics::Vector2d committedInstType; }; diff --git a/src/cpu/o3/commit.cc b/src/cpu/o3/commit.cc index 6a0f5682e2..4647adb1c1 100644 --- a/src/cpu/o3/commit.cc +++ b/src/cpu/o3/commit.cc @@ -144,43 +144,43 @@ Commit::regProbePoints() } Commit::CommitStats::CommitStats(CPU *cpu, Commit *commit) - : Stats::Group(cpu, "commit"), - ADD_STAT(commitSquashedInsts, Stats::units::Count::get(), + : statistics::Group(cpu, "commit"), + ADD_STAT(commitSquashedInsts, statistics::units::Count::get(), "The number of squashed insts skipped by commit"), - ADD_STAT(commitNonSpecStalls, Stats::units::Count::get(), + ADD_STAT(commitNonSpecStalls, statistics::units::Count::get(), "The number of times commit has been forced to stall to " "communicate backwards"), - ADD_STAT(branchMispredicts, Stats::units::Count::get(), + ADD_STAT(branchMispredicts, statistics::units::Count::get(), "The number of times a branch was mispredicted"), - ADD_STAT(numCommittedDist, Stats::units::Count::get(), + ADD_STAT(numCommittedDist, statistics::units::Count::get(), "Number of insts commited each cycle"), - ADD_STAT(instsCommitted, Stats::units::Count::get(), + ADD_STAT(instsCommitted, statistics::units::Count::get(), "Number of instructions committed"), - ADD_STAT(opsCommitted, Stats::units::Count::get(), + ADD_STAT(opsCommitted, statistics::units::Count::get(), "Number of ops (including micro ops) committed"), - ADD_STAT(memRefs, Stats::units::Count::get(), + ADD_STAT(memRefs, statistics::units::Count::get(), "Number of memory references committed"), - ADD_STAT(loads, Stats::units::Count::get(), "Number of loads committed"), - ADD_STAT(amos, Stats::units::Count::get(), + ADD_STAT(loads, statistics::units::Count::get(), "Number of loads committed"), + ADD_STAT(amos, statistics::units::Count::get(), "Number of atomic instructions committed"), - ADD_STAT(membars, Stats::units::Count::get(), + ADD_STAT(membars, statistics::units::Count::get(), "Number of memory barriers committed"), - ADD_STAT(branches, Stats::units::Count::get(), + ADD_STAT(branches, statistics::units::Count::get(), "Number of branches committed"), - ADD_STAT(vectorInstructions, Stats::units::Count::get(), + ADD_STAT(vectorInstructions, statistics::units::Count::get(), "Number of committed Vector instructions."), - ADD_STAT(floating, Stats::units::Count::get(), + ADD_STAT(floating, statistics::units::Count::get(), "Number of committed floating point instructions."), - ADD_STAT(integer, Stats::units::Count::get(), + ADD_STAT(integer, statistics::units::Count::get(), "Number of committed integer instructions."), - ADD_STAT(functionCalls, Stats::units::Count::get(), + ADD_STAT(functionCalls, statistics::units::Count::get(), "Number of function calls committed."), - ADD_STAT(committedInstType, Stats::units::Count::get(), + ADD_STAT(committedInstType, statistics::units::Count::get(), "Class of committed instruction"), - ADD_STAT(commitEligibleSamples, Stats::units::Cycle::get(), + ADD_STAT(commitEligibleSamples, statistics::units::Cycle::get(), "number cycles where commit BW limit reached") { - using namespace Stats; + using namespace statistics; commitSquashedInsts.prereq(commitSquashedInsts); commitNonSpecStalls.prereq(commitNonSpecStalls); @@ -188,7 +188,7 @@ Commit::CommitStats::CommitStats(CPU *cpu, Commit *commit) numCommittedDist .init(0,commit->commitWidth,1) - .flags(Stats::pdf); + .flags(statistics::pdf); instsCommitted .init(cpu->numThreads) diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh index 264818c40b..6c4e78059d 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -468,51 +468,51 @@ class Commit int htmStarts[MaxThreads]; int htmStops[MaxThreads]; - struct CommitStats : public Stats::Group + struct CommitStats : public statistics::Group { CommitStats(CPU *cpu, Commit *commit); /** Stat for the total number of squashed instructions discarded by * commit. */ - Stats::Scalar commitSquashedInsts; + statistics::Scalar commitSquashedInsts; /** Stat for the total number of times commit has had to stall due * to a non-speculative instruction reaching the head of the ROB. */ - Stats::Scalar commitNonSpecStalls; + statistics::Scalar commitNonSpecStalls; /** Stat for the total number of branch mispredicts that caused a * squash. */ - Stats::Scalar branchMispredicts; + statistics::Scalar branchMispredicts; /** Distribution of the number of committed instructions each cycle. */ - Stats::Distribution numCommittedDist; + statistics::Distribution numCommittedDist; /** Total number of instructions committed. */ - Stats::Vector instsCommitted; + statistics::Vector instsCommitted; /** Total number of ops (including micro ops) committed. */ - Stats::Vector opsCommitted; + statistics::Vector opsCommitted; /** Stat for the total number of committed memory references. */ - Stats::Vector memRefs; + statistics::Vector memRefs; /** Stat for the total number of committed loads. */ - Stats::Vector loads; + statistics::Vector loads; /** Stat for the total number of committed atomics. */ - Stats::Vector amos; + statistics::Vector amos; /** Total number of committed memory barriers. */ - Stats::Vector membars; + statistics::Vector membars; /** Total number of committed branches. */ - Stats::Vector branches; + statistics::Vector branches; /** Total number of vector instructions */ - Stats::Vector vectorInstructions; + statistics::Vector vectorInstructions; /** Total number of floating point instructions */ - Stats::Vector floating; + statistics::Vector floating; /** Total number of integer instructions */ - Stats::Vector integer; + statistics::Vector integer; /** Total number of function calls */ - Stats::Vector functionCalls; + statistics::Vector functionCalls; /** Committed instructions by instruction type (OpClass) */ - Stats::Vector2d committedInstType; + statistics::Vector2d committedInstType; /** Number of cycles where the commit bandwidth limit is reached. */ - Stats::Scalar commitEligibleSamples; + statistics::Scalar commitEligibleSamples; } stats; }; diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 5f0d2ec587..873ba0101d 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -368,55 +368,55 @@ CPU::regProbePoints() } CPU::CPUStats::CPUStats(CPU *cpu) - : Stats::Group(cpu), - ADD_STAT(timesIdled, Stats::units::Count::get(), + : statistics::Group(cpu), + ADD_STAT(timesIdled, statistics::units::Count::get(), "Number of times that the entire CPU went into an idle state " "and unscheduled itself"), - ADD_STAT(idleCycles, Stats::units::Cycle::get(), + ADD_STAT(idleCycles, statistics::units::Cycle::get(), "Total number of cycles that the CPU has spent unscheduled due " "to idling"), - ADD_STAT(quiesceCycles, Stats::units::Cycle::get(), + ADD_STAT(quiesceCycles, statistics::units::Cycle::get(), "Total number of cycles that CPU has spent quiesced or waiting " "for an interrupt"), - ADD_STAT(committedInsts, Stats::units::Count::get(), + ADD_STAT(committedInsts, statistics::units::Count::get(), "Number of Instructions Simulated"), - ADD_STAT(committedOps, Stats::units::Count::get(), + ADD_STAT(committedOps, statistics::units::Count::get(), "Number of Ops (including micro ops) Simulated"), - ADD_STAT(cpi, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(cpi, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "CPI: Cycles Per Instruction"), - ADD_STAT(totalCpi, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(totalCpi, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "CPI: Total CPI of All Threads"), - ADD_STAT(ipc, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(ipc, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "IPC: Instructions Per Cycle"), - ADD_STAT(totalIpc, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(totalIpc, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "IPC: Total IPC of All Threads"), - ADD_STAT(intRegfileReads, Stats::units::Count::get(), + ADD_STAT(intRegfileReads, statistics::units::Count::get(), "Number of integer regfile reads"), - ADD_STAT(intRegfileWrites, Stats::units::Count::get(), + ADD_STAT(intRegfileWrites, statistics::units::Count::get(), "Number of integer regfile writes"), - ADD_STAT(fpRegfileReads, Stats::units::Count::get(), + ADD_STAT(fpRegfileReads, statistics::units::Count::get(), "Number of floating regfile reads"), - ADD_STAT(fpRegfileWrites, Stats::units::Count::get(), + ADD_STAT(fpRegfileWrites, statistics::units::Count::get(), "Number of floating regfile writes"), - ADD_STAT(vecRegfileReads, Stats::units::Count::get(), + ADD_STAT(vecRegfileReads, statistics::units::Count::get(), "number of vector regfile reads"), - ADD_STAT(vecRegfileWrites, Stats::units::Count::get(), + ADD_STAT(vecRegfileWrites, statistics::units::Count::get(), "number of vector regfile writes"), - ADD_STAT(vecPredRegfileReads, Stats::units::Count::get(), + ADD_STAT(vecPredRegfileReads, statistics::units::Count::get(), "number of predicate regfile reads"), - ADD_STAT(vecPredRegfileWrites, Stats::units::Count::get(), + ADD_STAT(vecPredRegfileWrites, statistics::units::Count::get(), "number of predicate regfile writes"), - ADD_STAT(ccRegfileReads, Stats::units::Count::get(), + ADD_STAT(ccRegfileReads, statistics::units::Count::get(), "number of cc regfile reads"), - ADD_STAT(ccRegfileWrites, Stats::units::Count::get(), + ADD_STAT(ccRegfileWrites, statistics::units::Count::get(), "number of cc regfile writes"), - ADD_STAT(miscRegfileReads, Stats::units::Count::get(), + ADD_STAT(miscRegfileReads, statistics::units::Count::get(), "number of misc regfile reads"), - ADD_STAT(miscRegfileWrites, Stats::units::Count::get(), + ADD_STAT(miscRegfileWrites, statistics::units::Count::get(), "number of misc regfile writes") { // Register any of the O3CPU's stats here. @@ -435,11 +435,11 @@ CPU::CPUStats::CPUStats(CPU *cpu) // MaxThreads so put in here instead committedInsts .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); committedOps .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); cpi .precision(6); diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 85b20e852e..e225c38b8c 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -657,49 +657,49 @@ class CPU : public BaseCPU return iew.ldstQueue.getDataPort(); } - struct CPUStats : public Stats::Group + struct CPUStats : public statistics::Group { CPUStats(CPU *cpu); /** Stat for total number of times the CPU is descheduled. */ - Stats::Scalar timesIdled; + statistics::Scalar timesIdled; /** Stat for total number of cycles the CPU spends descheduled. */ - Stats::Scalar idleCycles; + statistics::Scalar idleCycles; /** Stat for total number of cycles the CPU spends descheduled due to a * quiesce operation or waiting for an interrupt. */ - Stats::Scalar quiesceCycles; + statistics::Scalar quiesceCycles; /** Stat for the number of committed instructions per thread. */ - Stats::Vector committedInsts; + statistics::Vector committedInsts; /** Stat for the number of committed ops (including micro ops) per * thread. */ - Stats::Vector committedOps; + statistics::Vector committedOps; /** Stat for the CPI per thread. */ - Stats::Formula cpi; + statistics::Formula cpi; /** Stat for the total CPI. */ - Stats::Formula totalCpi; + statistics::Formula totalCpi; /** Stat for the IPC per thread. */ - Stats::Formula ipc; + statistics::Formula ipc; /** Stat for the total IPC. */ - Stats::Formula totalIpc; + statistics::Formula totalIpc; //number of integer register file accesses - Stats::Scalar intRegfileReads; - Stats::Scalar intRegfileWrites; + statistics::Scalar intRegfileReads; + statistics::Scalar intRegfileWrites; //number of float register file accesses - Stats::Scalar fpRegfileReads; - Stats::Scalar fpRegfileWrites; + statistics::Scalar fpRegfileReads; + statistics::Scalar fpRegfileWrites; //number of vector register file accesses - mutable Stats::Scalar vecRegfileReads; - Stats::Scalar vecRegfileWrites; + mutable statistics::Scalar vecRegfileReads; + statistics::Scalar vecRegfileWrites; //number of predicate register file accesses - mutable Stats::Scalar vecPredRegfileReads; - Stats::Scalar vecPredRegfileWrites; + mutable statistics::Scalar vecPredRegfileReads; + statistics::Scalar vecPredRegfileWrites; //number of CC register file accesses - Stats::Scalar ccRegfileReads; - Stats::Scalar ccRegfileWrites; + statistics::Scalar ccRegfileReads; + statistics::Scalar ccRegfileWrites; //number of misc - Stats::Scalar miscRegfileReads; - Stats::Scalar miscRegfileWrites; + statistics::Scalar miscRegfileReads; + statistics::Scalar miscRegfileWrites; } cpuStats; public: diff --git a/src/cpu/o3/decode.cc b/src/cpu/o3/decode.cc index c89d74030c..993ab73385 100644 --- a/src/cpu/o3/decode.cc +++ b/src/cpu/o3/decode.cc @@ -118,27 +118,27 @@ Decode::name() const } Decode::DecodeStats::DecodeStats(CPU *cpu) - : Stats::Group(cpu, "decode"), - ADD_STAT(idleCycles, Stats::units::Cycle::get(), + : statistics::Group(cpu, "decode"), + ADD_STAT(idleCycles, statistics::units::Cycle::get(), "Number of cycles decode is idle"), - ADD_STAT(blockedCycles, Stats::units::Cycle::get(), + ADD_STAT(blockedCycles, statistics::units::Cycle::get(), "Number of cycles decode is blocked"), - ADD_STAT(runCycles, Stats::units::Cycle::get(), + ADD_STAT(runCycles, statistics::units::Cycle::get(), "Number of cycles decode is running"), - ADD_STAT(unblockCycles, Stats::units::Cycle::get(), + ADD_STAT(unblockCycles, statistics::units::Cycle::get(), "Number of cycles decode is unblocking"), - ADD_STAT(squashCycles, Stats::units::Cycle::get(), + ADD_STAT(squashCycles, statistics::units::Cycle::get(), "Number of cycles decode is squashing"), - ADD_STAT(branchResolved, Stats::units::Count::get(), + ADD_STAT(branchResolved, statistics::units::Count::get(), "Number of times decode resolved a branch"), - ADD_STAT(branchMispred, Stats::units::Count::get(), + ADD_STAT(branchMispred, statistics::units::Count::get(), "Number of times decode detected a branch misprediction"), - ADD_STAT(controlMispred, Stats::units::Count::get(), + ADD_STAT(controlMispred, statistics::units::Count::get(), "Number of times decode detected an instruction incorrectly " "predicted as a control"), - ADD_STAT(decodedInsts, Stats::units::Count::get(), + ADD_STAT(decodedInsts, statistics::units::Count::get(), "Number of instructions handled by decode"), - ADD_STAT(squashedInsts, Stats::units::Count::get(), + ADD_STAT(squashedInsts, statistics::units::Count::get(), "Number of squashed instructions handled by decode") { idleCycles.prereq(idleCycles); diff --git a/src/cpu/o3/decode.hh b/src/cpu/o3/decode.hh index b20cb7cd81..fbe9dfda4f 100644 --- a/src/cpu/o3/decode.hh +++ b/src/cpu/o3/decode.hh @@ -291,32 +291,32 @@ class Decode */ bool squashAfterDelaySlot[MaxThreads]; - struct DecodeStats : public Stats::Group + struct DecodeStats : public statistics::Group { DecodeStats(CPU *cpu); /** Stat for total number of idle cycles. */ - Stats::Scalar idleCycles; + statistics::Scalar idleCycles; /** Stat for total number of blocked cycles. */ - Stats::Scalar blockedCycles; + statistics::Scalar blockedCycles; /** Stat for total number of normal running cycles. */ - Stats::Scalar runCycles; + statistics::Scalar runCycles; /** Stat for total number of unblocking cycles. */ - Stats::Scalar unblockCycles; + statistics::Scalar unblockCycles; /** Stat for total number of squashing cycles. */ - Stats::Scalar squashCycles; + statistics::Scalar squashCycles; /** Stat for number of times a branch is resolved at decode. */ - Stats::Scalar branchResolved; + statistics::Scalar branchResolved; /** Stat for number of times a branch mispredict is detected. */ - Stats::Scalar branchMispred; + statistics::Scalar branchMispred; /** Stat for number of times decode detected a non-control instruction * incorrectly predicted as a branch. */ - Stats::Scalar controlMispred; + statistics::Scalar controlMispred; /** Stat for total number of decoded instructions. */ - Stats::Scalar decodedInsts; + statistics::Scalar decodedInsts; /** Stat for total number of squashed instructions. */ - Stats::Scalar squashedInsts; + statistics::Scalar squashedInsts; } stats; }; diff --git a/src/cpu/o3/fetch.cc b/src/cpu/o3/fetch.cc index 65ed33fd47..eb9e75054c 100644 --- a/src/cpu/o3/fetch.cc +++ b/src/cpu/o3/fetch.cc @@ -156,55 +156,55 @@ Fetch::regProbePoints() } Fetch::FetchStatGroup::FetchStatGroup(CPU *cpu, Fetch *fetch) - : Stats::Group(cpu, "fetch"), - ADD_STAT(icacheStallCycles, Stats::units::Cycle::get(), + : statistics::Group(cpu, "fetch"), + ADD_STAT(icacheStallCycles, statistics::units::Cycle::get(), "Number of cycles fetch is stalled on an Icache miss"), - ADD_STAT(insts, Stats::units::Count::get(), + ADD_STAT(insts, statistics::units::Count::get(), "Number of instructions fetch has processed"), - ADD_STAT(branches, Stats::units::Count::get(), + ADD_STAT(branches, statistics::units::Count::get(), "Number of branches that fetch encountered"), - ADD_STAT(predictedBranches, Stats::units::Count::get(), + ADD_STAT(predictedBranches, statistics::units::Count::get(), "Number of branches that fetch has predicted taken"), - ADD_STAT(cycles, Stats::units::Cycle::get(), + ADD_STAT(cycles, statistics::units::Cycle::get(), "Number of cycles fetch has run and was not squashing or " "blocked"), - ADD_STAT(squashCycles, Stats::units::Cycle::get(), + ADD_STAT(squashCycles, statistics::units::Cycle::get(), "Number of cycles fetch has spent squashing"), - ADD_STAT(tlbCycles, Stats::units::Cycle::get(), + ADD_STAT(tlbCycles, statistics::units::Cycle::get(), "Number of cycles fetch has spent waiting for tlb"), - ADD_STAT(idleCycles, Stats::units::Cycle::get(), + ADD_STAT(idleCycles, statistics::units::Cycle::get(), "Number of cycles fetch was idle"), - ADD_STAT(blockedCycles, Stats::units::Cycle::get(), + ADD_STAT(blockedCycles, statistics::units::Cycle::get(), "Number of cycles fetch has spent blocked"), - ADD_STAT(miscStallCycles, Stats::units::Cycle::get(), + ADD_STAT(miscStallCycles, statistics::units::Cycle::get(), "Number of cycles fetch has spent waiting on interrupts, or bad " "addresses, or out of MSHRs"), - ADD_STAT(pendingDrainCycles, Stats::units::Cycle::get(), + ADD_STAT(pendingDrainCycles, statistics::units::Cycle::get(), "Number of cycles fetch has spent waiting on pipes to drain"), - ADD_STAT(noActiveThreadStallCycles, Stats::units::Cycle::get(), + ADD_STAT(noActiveThreadStallCycles, statistics::units::Cycle::get(), "Number of stall cycles due to no active thread to fetch from"), - ADD_STAT(pendingTrapStallCycles, Stats::units::Cycle::get(), + ADD_STAT(pendingTrapStallCycles, statistics::units::Cycle::get(), "Number of stall cycles due to pending traps"), - ADD_STAT(pendingQuiesceStallCycles, Stats::units::Cycle::get(), + ADD_STAT(pendingQuiesceStallCycles, statistics::units::Cycle::get(), "Number of stall cycles due to pending quiesce instructions"), - ADD_STAT(icacheWaitRetryStallCycles, Stats::units::Cycle::get(), + ADD_STAT(icacheWaitRetryStallCycles, statistics::units::Cycle::get(), "Number of stall cycles due to full MSHR"), - ADD_STAT(cacheLines, Stats::units::Count::get(), + ADD_STAT(cacheLines, statistics::units::Count::get(), "Number of cache lines fetched"), - ADD_STAT(icacheSquashes, Stats::units::Count::get(), + ADD_STAT(icacheSquashes, statistics::units::Count::get(), "Number of outstanding Icache misses that were squashed"), - ADD_STAT(tlbSquashes, Stats::units::Count::get(), + ADD_STAT(tlbSquashes, statistics::units::Count::get(), "Number of outstanding ITLB misses that were squashed"), - ADD_STAT(nisnDist, Stats::units::Count::get(), + ADD_STAT(nisnDist, statistics::units::Count::get(), "Number of instructions fetched each cycle (Total)"), - ADD_STAT(idleRate, Stats::units::Ratio::get(), + ADD_STAT(idleRate, statistics::units::Ratio::get(), "Ratio of cycles fetch was idle", idleCycles / cpu->baseStats.numCycles), - ADD_STAT(branchRate, Stats::units::Ratio::get(), + ADD_STAT(branchRate, statistics::units::Ratio::get(), "Number of branch fetches per cycle", branches / cpu->baseStats.numCycles), - ADD_STAT(rate, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(rate, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "Number of inst fetches per cycle", insts / cpu->baseStats.numCycles) { @@ -248,13 +248,13 @@ Fetch::FetchStatGroup::FetchStatGroup(CPU *cpu, Fetch *fetch) .init(/* base value */ 0, /* last value */ fetch->fetchWidth, /* bucket size */ 1) - .flags(Stats::pdf); + .flags(statistics::pdf); idleRate .prereq(idleRate); branchRate - .flags(Stats::total); + .flags(statistics::total); rate - .flags(Stats::total); + .flags(statistics::total); } void Fetch::setTimeBuffer(TimeBuffer *time_buffer) diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh index b9edae98f4..46c1219de5 100644 --- a/src/cpu/o3/fetch.hh +++ b/src/cpu/o3/fetch.hh @@ -525,63 +525,63 @@ class Fetch FinishTranslationEvent finishTranslationEvent; protected: - struct FetchStatGroup : public Stats::Group + struct FetchStatGroup : public statistics::Group { FetchStatGroup(CPU *cpu, Fetch *fetch); // @todo: Consider making these // vectors and tracking on a per thread basis. /** Stat for total number of cycles stalled due to an icache miss. */ - Stats::Scalar icacheStallCycles; + statistics::Scalar icacheStallCycles; /** Stat for total number of fetched instructions. */ - Stats::Scalar insts; + statistics::Scalar insts; /** Total number of fetched branches. */ - Stats::Scalar branches; + statistics::Scalar branches; /** Stat for total number of predicted branches. */ - Stats::Scalar predictedBranches; + statistics::Scalar predictedBranches; /** Stat for total number of cycles spent fetching. */ - Stats::Scalar cycles; + statistics::Scalar cycles; /** Stat for total number of cycles spent squashing. */ - Stats::Scalar squashCycles; + statistics::Scalar squashCycles; /** Stat for total number of cycles spent waiting for translation */ - Stats::Scalar tlbCycles; + statistics::Scalar tlbCycles; /** Stat for total number of cycles * spent blocked due to other stages in * the pipeline. */ - Stats::Scalar idleCycles; + statistics::Scalar idleCycles; /** Total number of cycles spent blocked. */ - Stats::Scalar blockedCycles; + statistics::Scalar blockedCycles; /** Total number of cycles spent in any other state. */ - Stats::Scalar miscStallCycles; + statistics::Scalar miscStallCycles; /** Total number of cycles spent in waiting for drains. */ - Stats::Scalar pendingDrainCycles; + statistics::Scalar pendingDrainCycles; /** Total number of stall cycles caused by no active threads to run. */ - Stats::Scalar noActiveThreadStallCycles; + statistics::Scalar noActiveThreadStallCycles; /** Total number of stall cycles caused by pending traps. */ - Stats::Scalar pendingTrapStallCycles; + statistics::Scalar pendingTrapStallCycles; /** Total number of stall cycles * caused by pending quiesce instructions. */ - Stats::Scalar pendingQuiesceStallCycles; + statistics::Scalar pendingQuiesceStallCycles; /** Total number of stall cycles caused by I-cache wait retrys. */ - Stats::Scalar icacheWaitRetryStallCycles; + statistics::Scalar icacheWaitRetryStallCycles; /** Stat for total number of fetched cache lines. */ - Stats::Scalar cacheLines; + statistics::Scalar cacheLines; /** Total number of outstanding icache accesses that were dropped * due to a squash. */ - Stats::Scalar icacheSquashes; + statistics::Scalar icacheSquashes; /** Total number of outstanding tlb accesses that were dropped * due to a squash. */ - Stats::Scalar tlbSquashes; + statistics::Scalar tlbSquashes; /** Distribution of number of instructions fetched each cycle. */ - Stats::Distribution nisnDist; + statistics::Distribution nisnDist; /** Rate of how often fetch was idle. */ - Stats::Formula idleRate; + statistics::Formula idleRate; /** Number of branch fetches per cycle. */ - Stats::Formula branchRate; + statistics::Formula branchRate; /** Number of instruction fetched per cycle. */ - Stats::Formula rate; + statistics::Formula rate; } fetchStats; }; diff --git a/src/cpu/o3/iew.cc b/src/cpu/o3/iew.cc index eb6127d343..b53e389807 100644 --- a/src/cpu/o3/iew.cc +++ b/src/cpu/o3/iew.cc @@ -140,127 +140,127 @@ IEW::regProbePoints() } IEW::IEWStats::IEWStats(CPU *cpu) - : Stats::Group(cpu), - ADD_STAT(idleCycles, Stats::units::Cycle::get(), + : statistics::Group(cpu), + ADD_STAT(idleCycles, statistics::units::Cycle::get(), "Number of cycles IEW is idle"), - ADD_STAT(squashCycles, Stats::units::Cycle::get(), + ADD_STAT(squashCycles, statistics::units::Cycle::get(), "Number of cycles IEW is squashing"), - ADD_STAT(blockCycles, Stats::units::Cycle::get(), + ADD_STAT(blockCycles, statistics::units::Cycle::get(), "Number of cycles IEW is blocking"), - ADD_STAT(unblockCycles, Stats::units::Cycle::get(), + ADD_STAT(unblockCycles, statistics::units::Cycle::get(), "Number of cycles IEW is unblocking"), - ADD_STAT(dispatchedInsts, Stats::units::Count::get(), + ADD_STAT(dispatchedInsts, statistics::units::Count::get(), "Number of instructions dispatched to IQ"), - ADD_STAT(dispSquashedInsts, Stats::units::Count::get(), + ADD_STAT(dispSquashedInsts, statistics::units::Count::get(), "Number of squashed instructions skipped by dispatch"), - ADD_STAT(dispLoadInsts, Stats::units::Count::get(), + ADD_STAT(dispLoadInsts, statistics::units::Count::get(), "Number of dispatched load instructions"), - ADD_STAT(dispStoreInsts, Stats::units::Count::get(), + ADD_STAT(dispStoreInsts, statistics::units::Count::get(), "Number of dispatched store instructions"), - ADD_STAT(dispNonSpecInsts, Stats::units::Count::get(), + ADD_STAT(dispNonSpecInsts, statistics::units::Count::get(), "Number of dispatched non-speculative instructions"), - ADD_STAT(iqFullEvents, Stats::units::Count::get(), + ADD_STAT(iqFullEvents, statistics::units::Count::get(), "Number of times the IQ has become full, causing a stall"), - ADD_STAT(lsqFullEvents, Stats::units::Count::get(), + ADD_STAT(lsqFullEvents, statistics::units::Count::get(), "Number of times the LSQ has become full, causing a stall"), - ADD_STAT(memOrderViolationEvents, Stats::units::Count::get(), + ADD_STAT(memOrderViolationEvents, statistics::units::Count::get(), "Number of memory order violations"), - ADD_STAT(predictedTakenIncorrect, Stats::units::Count::get(), + ADD_STAT(predictedTakenIncorrect, statistics::units::Count::get(), "Number of branches that were predicted taken incorrectly"), - ADD_STAT(predictedNotTakenIncorrect, Stats::units::Count::get(), + ADD_STAT(predictedNotTakenIncorrect, statistics::units::Count::get(), "Number of branches that were predicted not taken incorrectly"), - ADD_STAT(branchMispredicts, Stats::units::Count::get(), + ADD_STAT(branchMispredicts, statistics::units::Count::get(), "Number of branch mispredicts detected at execute", predictedTakenIncorrect + predictedNotTakenIncorrect), executedInstStats(cpu), - ADD_STAT(instsToCommit, Stats::units::Count::get(), + ADD_STAT(instsToCommit, statistics::units::Count::get(), "Cumulative count of insts sent to commit"), - ADD_STAT(writebackCount, Stats::units::Count::get(), + ADD_STAT(writebackCount, statistics::units::Count::get(), "Cumulative count of insts written-back"), - ADD_STAT(producerInst, Stats::units::Count::get(), + ADD_STAT(producerInst, statistics::units::Count::get(), "Number of instructions producing a value"), - ADD_STAT(consumerInst, Stats::units::Count::get(), + ADD_STAT(consumerInst, statistics::units::Count::get(), "Number of instructions consuming a value"), - ADD_STAT(wbRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(wbRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "Insts written-back per cycle"), - ADD_STAT(wbFanout, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(wbFanout, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average fanout of values written-back") { instsToCommit .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); writebackCount .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); producerInst .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); consumerInst .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); wbRate - .flags(Stats::total); + .flags(statistics::total); wbRate = writebackCount / cpu->baseStats.numCycles; wbFanout - .flags(Stats::total); + .flags(statistics::total); wbFanout = producerInst / consumerInst; } IEW::IEWStats::ExecutedInstStats::ExecutedInstStats(CPU *cpu) - : Stats::Group(cpu), - ADD_STAT(numInsts, Stats::units::Count::get(), + : statistics::Group(cpu), + ADD_STAT(numInsts, statistics::units::Count::get(), "Number of executed instructions"), - ADD_STAT(numLoadInsts, Stats::units::Count::get(), + ADD_STAT(numLoadInsts, statistics::units::Count::get(), "Number of load instructions executed"), - ADD_STAT(numSquashedInsts, Stats::units::Count::get(), + ADD_STAT(numSquashedInsts, statistics::units::Count::get(), "Number of squashed instructions skipped in execute"), - ADD_STAT(numSwp, Stats::units::Count::get(), + ADD_STAT(numSwp, statistics::units::Count::get(), "Number of swp insts executed"), - ADD_STAT(numNop, Stats::units::Count::get(), + ADD_STAT(numNop, statistics::units::Count::get(), "Number of nop insts executed"), - ADD_STAT(numRefs, Stats::units::Count::get(), + ADD_STAT(numRefs, statistics::units::Count::get(), "Number of memory reference insts executed"), - ADD_STAT(numBranches, Stats::units::Count::get(), + ADD_STAT(numBranches, statistics::units::Count::get(), "Number of branches executed"), - ADD_STAT(numStoreInsts, Stats::units::Count::get(), + ADD_STAT(numStoreInsts, statistics::units::Count::get(), "Number of stores executed"), - ADD_STAT(numRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(numRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "Inst execution rate", numInsts / cpu->baseStats.numCycles) { numLoadInsts .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); numSwp .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); numNop .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); numRefs .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); numBranches .init(cpu->numThreads) - .flags(Stats::total); + .flags(statistics::total); numStoreInsts - .flags(Stats::total); + .flags(statistics::total); numStoreInsts = numRefs - numLoadInsts; numRate - .flags(Stats::total); + .flags(statistics::total); } void diff --git a/src/cpu/o3/iew.hh b/src/cpu/o3/iew.hh index 5ebc89f236..5049eb4808 100644 --- a/src/cpu/o3/iew.hh +++ b/src/cpu/o3/iew.hh @@ -417,79 +417,79 @@ class IEW unsigned skidBufferMax; - struct IEWStats : public Stats::Group + struct IEWStats : public statistics::Group { IEWStats(CPU *cpu); /** Stat for total number of idle cycles. */ - Stats::Scalar idleCycles; + statistics::Scalar idleCycles; /** Stat for total number of squashing cycles. */ - Stats::Scalar squashCycles; + statistics::Scalar squashCycles; /** Stat for total number of blocking cycles. */ - Stats::Scalar blockCycles; + statistics::Scalar blockCycles; /** Stat for total number of unblocking cycles. */ - Stats::Scalar unblockCycles; + statistics::Scalar unblockCycles; /** Stat for total number of instructions dispatched. */ - Stats::Scalar dispatchedInsts; + statistics::Scalar dispatchedInsts; /** Stat for total number of squashed instructions dispatch skips. */ - Stats::Scalar dispSquashedInsts; + statistics::Scalar dispSquashedInsts; /** Stat for total number of dispatched load instructions. */ - Stats::Scalar dispLoadInsts; + statistics::Scalar dispLoadInsts; /** Stat for total number of dispatched store instructions. */ - Stats::Scalar dispStoreInsts; - /** Stat for total number of dispatched non speculative instructions. */ - Stats::Scalar dispNonSpecInsts; + statistics::Scalar dispStoreInsts; + /** Stat for total number of dispatched non speculative insts. */ + statistics::Scalar dispNonSpecInsts; /** Stat for number of times the IQ becomes full. */ - Stats::Scalar iqFullEvents; + statistics::Scalar iqFullEvents; /** Stat for number of times the LSQ becomes full. */ - Stats::Scalar lsqFullEvents; + statistics::Scalar lsqFullEvents; /** Stat for total number of memory ordering violation events. */ - Stats::Scalar memOrderViolationEvents; + statistics::Scalar memOrderViolationEvents; /** Stat for total number of incorrect predicted taken branches. */ - Stats::Scalar predictedTakenIncorrect; + statistics::Scalar predictedTakenIncorrect; /** Stat for total number of incorrect predicted not taken branches. */ - Stats::Scalar predictedNotTakenIncorrect; + statistics::Scalar predictedNotTakenIncorrect; /** Stat for total number of mispredicted branches detected at * execute. */ - Stats::Formula branchMispredicts; + statistics::Formula branchMispredicts; - struct ExecutedInstStats : public Stats::Group + struct ExecutedInstStats : public statistics::Group { ExecutedInstStats(CPU *cpu); /** Stat for total number of executed instructions. */ - Stats::Scalar numInsts; + statistics::Scalar numInsts; /** Stat for total number of executed load instructions. */ - Stats::Vector numLoadInsts; + statistics::Vector numLoadInsts; /** Stat for total number of squashed instructions skipped at * execute. */ - Stats::Scalar numSquashedInsts; + statistics::Scalar numSquashedInsts; /** Number of executed software prefetches. */ - Stats::Vector numSwp; + statistics::Vector numSwp; /** Number of executed nops. */ - Stats::Vector numNop; + statistics::Vector numNop; /** Number of executed meomory references. */ - Stats::Vector numRefs; + statistics::Vector numRefs; /** Number of executed branches. */ - Stats::Vector numBranches; + statistics::Vector numBranches; /** Number of executed store instructions. */ - Stats::Formula numStoreInsts; + statistics::Formula numStoreInsts; /** Number of instructions executed per cycle. */ - Stats::Formula numRate; + statistics::Formula numRate; } executedInstStats; /** Number of instructions sent to commit. */ - Stats::Vector instsToCommit; + statistics::Vector instsToCommit; /** Number of instructions that writeback. */ - Stats::Vector writebackCount; + statistics::Vector writebackCount; /** Number of instructions that wake consumers. */ - Stats::Vector producerInst; + statistics::Vector producerInst; /** Number of instructions that wake up from producers. */ - Stats::Vector consumerInst; + statistics::Vector consumerInst; /** Number of instructions per cycle written back. */ - Stats::Formula wbRate; + statistics::Formula wbRate; /** Average number of woken instructions per writeback. */ - Stats::Formula wbFanout; + statistics::Formula wbFanout; } iewStats; }; diff --git a/src/cpu/o3/inst_queue.cc b/src/cpu/o3/inst_queue.cc index 4c3533af61..f59d3e62c0 100644 --- a/src/cpu/o3/inst_queue.cc +++ b/src/cpu/o3/inst_queue.cc @@ -171,45 +171,45 @@ InstructionQueue::name() const } InstructionQueue::IQStats::IQStats(CPU *cpu, const unsigned &total_width) - : Stats::Group(cpu), - ADD_STAT(instsAdded, Stats::units::Count::get(), + : statistics::Group(cpu), + ADD_STAT(instsAdded, statistics::units::Count::get(), "Number of instructions added to the IQ (excludes non-spec)"), - ADD_STAT(nonSpecInstsAdded, Stats::units::Count::get(), + ADD_STAT(nonSpecInstsAdded, statistics::units::Count::get(), "Number of non-speculative instructions added to the IQ"), - ADD_STAT(instsIssued, Stats::units::Count::get(), + ADD_STAT(instsIssued, statistics::units::Count::get(), "Number of instructions issued"), - ADD_STAT(intInstsIssued, Stats::units::Count::get(), + ADD_STAT(intInstsIssued, statistics::units::Count::get(), "Number of integer instructions issued"), - ADD_STAT(floatInstsIssued, Stats::units::Count::get(), + ADD_STAT(floatInstsIssued, statistics::units::Count::get(), "Number of float instructions issued"), - ADD_STAT(branchInstsIssued, Stats::units::Count::get(), + ADD_STAT(branchInstsIssued, statistics::units::Count::get(), "Number of branch instructions issued"), - ADD_STAT(memInstsIssued, Stats::units::Count::get(), + ADD_STAT(memInstsIssued, statistics::units::Count::get(), "Number of memory instructions issued"), - ADD_STAT(miscInstsIssued, Stats::units::Count::get(), + ADD_STAT(miscInstsIssued, statistics::units::Count::get(), "Number of miscellaneous instructions issued"), - ADD_STAT(squashedInstsIssued, Stats::units::Count::get(), + ADD_STAT(squashedInstsIssued, statistics::units::Count::get(), "Number of squashed instructions issued"), - ADD_STAT(squashedInstsExamined, Stats::units::Count::get(), + ADD_STAT(squashedInstsExamined, statistics::units::Count::get(), "Number of squashed instructions iterated over during squash; " "mainly for profiling"), - ADD_STAT(squashedOperandsExamined, Stats::units::Count::get(), + ADD_STAT(squashedOperandsExamined, statistics::units::Count::get(), "Number of squashed operands that are examined and possibly " "removed from graph"), - ADD_STAT(squashedNonSpecRemoved, Stats::units::Count::get(), + ADD_STAT(squashedNonSpecRemoved, statistics::units::Count::get(), "Number of squashed non-spec instructions that were removed"), - ADD_STAT(numIssuedDist, Stats::units::Count::get(), + ADD_STAT(numIssuedDist, statistics::units::Count::get(), "Number of insts issued each cycle"), - ADD_STAT(statFuBusy, Stats::units::Count::get(), + ADD_STAT(statFuBusy, statistics::units::Count::get(), "attempts to use FU when none available"), - ADD_STAT(statIssuedInstType, Stats::units::Count::get(), + ADD_STAT(statIssuedInstType, statistics::units::Count::get(), "Number of instructions issued per FU type, per thread"), - ADD_STAT(issueRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Cycle>::get(), + ADD_STAT(issueRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Cycle>::get(), "Inst issue rate", instsIssued / cpu->baseStats.numCycles), - ADD_STAT(fuBusy, Stats::units::Count::get(), "FU busy when requested"), - ADD_STAT(fuBusyRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(fuBusy, statistics::units::Count::get(), "FU busy when requested"), + ADD_STAT(fuBusyRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "FU busy rate (busy events/executed inst)") { instsAdded @@ -260,7 +260,7 @@ InstructionQueue::IQStats::IQStats(CPU *cpu, const unsigned &total_width) */ numIssuedDist .init(0,total_width,1) - .flags(Stats::pdf) + .flags(statistics::pdf) ; /* dist_unissued @@ -275,7 +275,7 @@ InstructionQueue::IQStats::IQStats(CPU *cpu, const unsigned &total_width) */ statIssuedInstType .init(cpu->numThreads,enums::Num_OpClass) - .flags(Stats::total | Stats::pdf | Stats::dist) + .flags(statistics::total | statistics::pdf | statistics::dist) ; statIssuedInstType.ysubnames(enums::OpClassStrings); @@ -296,12 +296,12 @@ InstructionQueue::IQStats::IQStats(CPU *cpu, const unsigned &total_width) } */ issueRate - .flags(Stats::total) + .flags(statistics::total) ; statFuBusy .init(Num_OpClasses) - .flags(Stats::pdf | Stats::dist) + .flags(statistics::pdf | statistics::dist) ; for (int i=0; i < Num_OpClasses; ++i) { statFuBusy.subname(i, enums::OpClassStrings[i]); @@ -309,43 +309,43 @@ InstructionQueue::IQStats::IQStats(CPU *cpu, const unsigned &total_width) fuBusy .init(cpu->numThreads) - .flags(Stats::total) + .flags(statistics::total) ; fuBusyRate - .flags(Stats::total) + .flags(statistics::total) ; fuBusyRate = fuBusy / instsIssued; } -InstructionQueue::IQIOStats::IQIOStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(intInstQueueReads, Stats::units::Count::get(), +InstructionQueue::IQIOStats::IQIOStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(intInstQueueReads, statistics::units::Count::get(), "Number of integer instruction queue reads"), - ADD_STAT(intInstQueueWrites, Stats::units::Count::get(), + ADD_STAT(intInstQueueWrites, statistics::units::Count::get(), "Number of integer instruction queue writes"), - ADD_STAT(intInstQueueWakeupAccesses, Stats::units::Count::get(), + ADD_STAT(intInstQueueWakeupAccesses, statistics::units::Count::get(), "Number of integer instruction queue wakeup accesses"), - ADD_STAT(fpInstQueueReads, Stats::units::Count::get(), + ADD_STAT(fpInstQueueReads, statistics::units::Count::get(), "Number of floating instruction queue reads"), - ADD_STAT(fpInstQueueWrites, Stats::units::Count::get(), + ADD_STAT(fpInstQueueWrites, statistics::units::Count::get(), "Number of floating instruction queue writes"), - ADD_STAT(fpInstQueueWakeupAccesses, Stats::units::Count::get(), + ADD_STAT(fpInstQueueWakeupAccesses, statistics::units::Count::get(), "Number of floating instruction queue wakeup accesses"), - ADD_STAT(vecInstQueueReads, Stats::units::Count::get(), + ADD_STAT(vecInstQueueReads, statistics::units::Count::get(), "Number of vector instruction queue reads"), - ADD_STAT(vecInstQueueWrites, Stats::units::Count::get(), + ADD_STAT(vecInstQueueWrites, statistics::units::Count::get(), "Number of vector instruction queue writes"), - ADD_STAT(vecInstQueueWakeupAccesses, Stats::units::Count::get(), + ADD_STAT(vecInstQueueWakeupAccesses, statistics::units::Count::get(), "Number of vector instruction queue wakeup accesses"), - ADD_STAT(intAluAccesses, Stats::units::Count::get(), + ADD_STAT(intAluAccesses, statistics::units::Count::get(), "Number of integer alu accesses"), - ADD_STAT(fpAluAccesses, Stats::units::Count::get(), + ADD_STAT(fpAluAccesses, statistics::units::Count::get(), "Number of floating point alu accesses"), - ADD_STAT(vecAluAccesses, Stats::units::Count::get(), + ADD_STAT(vecAluAccesses, statistics::units::Count::get(), "Number of vector alu accesses") { - using namespace Stats; + using namespace statistics; intInstQueueReads .flags(total); diff --git a/src/cpu/o3/inst_queue.hh b/src/cpu/o3/inst_queue.hh index 5f3e7e14c6..6be78d0615 100644 --- a/src/cpu/o3/inst_queue.hh +++ b/src/cpu/o3/inst_queue.hh @@ -472,86 +472,86 @@ class InstructionQueue */ void dumpInsts(); - struct IQStats : public Stats::Group + struct IQStats : public statistics::Group { IQStats(CPU *cpu, const unsigned &total_width); /** Stat for number of instructions added. */ - Stats::Scalar instsAdded; + statistics::Scalar instsAdded; /** Stat for number of non-speculative instructions added. */ - Stats::Scalar nonSpecInstsAdded; + statistics::Scalar nonSpecInstsAdded; - Stats::Scalar instsIssued; + statistics::Scalar instsIssued; /** Stat for number of integer instructions issued. */ - Stats::Scalar intInstsIssued; + statistics::Scalar intInstsIssued; /** Stat for number of floating point instructions issued. */ - Stats::Scalar floatInstsIssued; + statistics::Scalar floatInstsIssued; /** Stat for number of branch instructions issued. */ - Stats::Scalar branchInstsIssued; + statistics::Scalar branchInstsIssued; /** Stat for number of memory instructions issued. */ - Stats::Scalar memInstsIssued; + statistics::Scalar memInstsIssued; /** Stat for number of miscellaneous instructions issued. */ - Stats::Scalar miscInstsIssued; + statistics::Scalar miscInstsIssued; /** Stat for number of squashed instructions that were ready to * issue. */ - Stats::Scalar squashedInstsIssued; + statistics::Scalar squashedInstsIssued; /** Stat for number of squashed instructions examined when * squashing. */ - Stats::Scalar squashedInstsExamined; + statistics::Scalar squashedInstsExamined; /** Stat for number of squashed instruction operands examined when * squashing. */ - Stats::Scalar squashedOperandsExamined; + statistics::Scalar squashedOperandsExamined; /** Stat for number of non-speculative instructions removed due to * a squash. */ - Stats::Scalar squashedNonSpecRemoved; + statistics::Scalar squashedNonSpecRemoved; // Also include number of instructions rescheduled and replayed. /** Distribution of number of instructions in the queue. * @todo: Need to create struct to track the entry time for each * instruction. */ - // Stats::VectorDistribution queueResDist; + // statistics::VectorDistribution queueResDist; /** Distribution of the number of instructions issued. */ - Stats::Distribution numIssuedDist; + statistics::Distribution numIssuedDist; /** Distribution of the cycles it takes to issue an instruction. * @todo: Need to create struct to track the ready time for each * instruction. */ - // Stats::VectorDistribution issueDelayDist; + // statistics::VectorDistribution issueDelayDist; /** Number of times an instruction could not be issued because a * FU was busy. */ - Stats::Vector statFuBusy; - // Stats::Vector dist_unissued; + statistics::Vector statFuBusy; + // statistics::Vector dist_unissued; /** Stat for total number issued for each instruction type. */ - Stats::Vector2d statIssuedInstType; + statistics::Vector2d statIssuedInstType; /** Number of instructions issued per cycle. */ - Stats::Formula issueRate; + statistics::Formula issueRate; /** Number of times the FU was busy. */ - Stats::Vector fuBusy; + statistics::Vector fuBusy; /** Number of times the FU was busy per instruction issued. */ - Stats::Formula fuBusyRate; + statistics::Formula fuBusyRate; } iqStats; public: - struct IQIOStats : public Stats::Group + struct IQIOStats : public statistics::Group { - IQIOStats(Stats::Group *parent); - Stats::Scalar intInstQueueReads; - Stats::Scalar intInstQueueWrites; - Stats::Scalar intInstQueueWakeupAccesses; - Stats::Scalar fpInstQueueReads; - Stats::Scalar fpInstQueueWrites; - Stats::Scalar fpInstQueueWakeupAccesses; - Stats::Scalar vecInstQueueReads; - Stats::Scalar vecInstQueueWrites; - Stats::Scalar vecInstQueueWakeupAccesses; + IQIOStats(statistics::Group *parent); + statistics::Scalar intInstQueueReads; + statistics::Scalar intInstQueueWrites; + statistics::Scalar intInstQueueWakeupAccesses; + statistics::Scalar fpInstQueueReads; + statistics::Scalar fpInstQueueWrites; + statistics::Scalar fpInstQueueWakeupAccesses; + statistics::Scalar vecInstQueueReads; + statistics::Scalar vecInstQueueWrites; + statistics::Scalar vecInstQueueWakeupAccesses; - Stats::Scalar intAluAccesses; - Stats::Scalar fpAluAccesses; - Stats::Scalar vecAluAccesses; + statistics::Scalar intAluAccesses; + statistics::Scalar fpAluAccesses; + statistics::Scalar vecAluAccesses; } iqIOStats; }; diff --git a/src/cpu/o3/lsq_unit.cc b/src/cpu/o3/lsq_unit.cc index bb1833abc6..22965a92cc 100644 --- a/src/cpu/o3/lsq_unit.cc +++ b/src/cpu/o3/lsq_unit.cc @@ -258,22 +258,22 @@ LSQUnit::name() const } } -LSQUnit::LSQUnitStats::LSQUnitStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(forwLoads, Stats::units::Count::get(), +LSQUnit::LSQUnitStats::LSQUnitStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(forwLoads, statistics::units::Count::get(), "Number of loads that had data forwarded from stores"), - ADD_STAT(squashedLoads, Stats::units::Count::get(), + ADD_STAT(squashedLoads, statistics::units::Count::get(), "Number of loads squashed"), - ADD_STAT(ignoredResponses, Stats::units::Count::get(), + ADD_STAT(ignoredResponses, statistics::units::Count::get(), "Number of memory responses ignored because the instruction is " "squashed"), - ADD_STAT(memOrderViolation, Stats::units::Count::get(), + ADD_STAT(memOrderViolation, statistics::units::Count::get(), "Number of memory ordering violations"), - ADD_STAT(squashedStores, Stats::units::Count::get(), + ADD_STAT(squashedStores, statistics::units::Count::get(), "Number of stores squashed"), - ADD_STAT(rescheduledLoads, Stats::units::Count::get(), + ADD_STAT(rescheduledLoads, statistics::units::Count::get(), "Number of loads that were rescheduled"), - ADD_STAT(blockedByCache, Stats::units::Count::get(), + ADD_STAT(blockedByCache, statistics::units::Count::get(), "Number of times an access to memory failed due to the cache " "being blocked") { diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh index fbb788fb80..0681b1377c 100644 --- a/src/cpu/o3/lsq_unit.hh +++ b/src/cpu/o3/lsq_unit.hh @@ -546,31 +546,31 @@ class LSQUnit // Will also need how many read/write ports the Dcache has. Or keep track // of that in stage that is one level up, and only call executeLoad/Store // the appropriate number of times. - struct LSQUnitStats : public Stats::Group + struct LSQUnitStats : public statistics::Group { - LSQUnitStats(Stats::Group *parent); + LSQUnitStats(statistics::Group *parent); /** Total number of loads forwaded from LSQ stores. */ - Stats::Scalar forwLoads; + statistics::Scalar forwLoads; /** Total number of squashed loads. */ - Stats::Scalar squashedLoads; + statistics::Scalar squashedLoads; /** Total number of responses from the memory system that are * ignored due to the instruction already being squashed. */ - Stats::Scalar ignoredResponses; + statistics::Scalar ignoredResponses; /** Tota number of memory ordering violations. */ - Stats::Scalar memOrderViolation; + statistics::Scalar memOrderViolation; /** Total number of squashed stores. */ - Stats::Scalar squashedStores; + statistics::Scalar squashedStores; /** Number of loads that were rescheduled. */ - Stats::Scalar rescheduledLoads; + statistics::Scalar rescheduledLoads; /** Number of times the LSQ is blocked due to the cache. */ - Stats::Scalar blockedByCache; + statistics::Scalar blockedByCache; } stats; public: diff --git a/src/cpu/o3/mem_dep_unit.cc b/src/cpu/o3/mem_dep_unit.cc index a466f4554e..d12ce21b71 100644 --- a/src/cpu/o3/mem_dep_unit.cc +++ b/src/cpu/o3/mem_dep_unit.cc @@ -100,15 +100,15 @@ MemDepUnit::init(const O3CPUParams ¶ms, ThreadID tid, CPU *cpu) cpu->addStatGroup(stats_group_name.c_str(), &stats); } -MemDepUnit::MemDepUnitStats::MemDepUnitStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(insertedLoads, Stats::units::Count::get(), +MemDepUnit::MemDepUnitStats::MemDepUnitStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(insertedLoads, statistics::units::Count::get(), "Number of loads inserted to the mem dependence unit."), - ADD_STAT(insertedStores, Stats::units::Count::get(), + ADD_STAT(insertedStores, statistics::units::Count::get(), "Number of stores inserted to the mem dependence unit."), - ADD_STAT(conflictingLoads, Stats::units::Count::get(), + ADD_STAT(conflictingLoads, statistics::units::Count::get(), "Number of conflicting loads."), - ADD_STAT(conflictingStores, Stats::units::Count::get(), + ADD_STAT(conflictingStores, statistics::units::Count::get(), "Number of conflicting stores.") { } diff --git a/src/cpu/o3/mem_dep_unit.hh b/src/cpu/o3/mem_dep_unit.hh index 40c2e8677e..1754b0a84a 100644 --- a/src/cpu/o3/mem_dep_unit.hh +++ b/src/cpu/o3/mem_dep_unit.hh @@ -260,19 +260,19 @@ class MemDepUnit /** The thread id of this memory dependence unit. */ int id; - struct MemDepUnitStats : public Stats::Group + struct MemDepUnitStats : public statistics::Group { - MemDepUnitStats(Stats::Group *parent); + MemDepUnitStats(statistics::Group *parent); /** Stat for number of inserted loads. */ - Stats::Scalar insertedLoads; + statistics::Scalar insertedLoads; /** Stat for number of inserted stores. */ - Stats::Scalar insertedStores; + statistics::Scalar insertedStores; /** Stat for number of conflicting loads that had to wait for a * store. */ - Stats::Scalar conflictingLoads; + statistics::Scalar conflictingLoads; /** Stat for number of conflicting stores that had to wait for a * store. */ - Stats::Scalar conflictingStores; + statistics::Scalar conflictingStores; } stats; }; diff --git a/src/cpu/o3/probe/elastic_trace.cc b/src/cpu/o3/probe/elastic_trace.cc index f95921b1e2..092c0cfb91 100644 --- a/src/cpu/o3/probe/elastic_trace.cc +++ b/src/cpu/o3/probe/elastic_trace.cc @@ -884,29 +884,29 @@ ElasticTrace::writeDepTrace(uint32_t num_to_write) depTrace.erase(dep_trace_itr_start, dep_trace_itr); } -ElasticTrace::ElasticTraceStats::ElasticTraceStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(numRegDep, Stats::units::Count::get(), +ElasticTrace::ElasticTraceStats::ElasticTraceStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(numRegDep, statistics::units::Count::get(), "Number of register dependencies recorded during tracing"), - ADD_STAT(numOrderDepStores, Stats::units::Count::get(), + ADD_STAT(numOrderDepStores, statistics::units::Count::get(), "Number of commit order (rob) dependencies for a store " "recorded on a past load/store during tracing"), - ADD_STAT(numIssueOrderDepLoads, Stats::units::Count::get(), + ADD_STAT(numIssueOrderDepLoads, statistics::units::Count::get(), "Number of loads that got assigned issue order dependency " "because they were dependency-free"), - ADD_STAT(numIssueOrderDepStores, Stats::units::Count::get(), + ADD_STAT(numIssueOrderDepStores, statistics::units::Count::get(), "Number of stores that got assigned issue order dependency " "because they were dependency-free"), - ADD_STAT(numIssueOrderDepOther, Stats::units::Count::get(), + ADD_STAT(numIssueOrderDepOther, statistics::units::Count::get(), "Number of non load/store insts that got assigned issue order " "dependency because they were dependency-free"), - ADD_STAT(numFilteredNodes, Stats::units::Count::get(), + ADD_STAT(numFilteredNodes, statistics::units::Count::get(), "No. of nodes filtered out before writing the output trace"), - ADD_STAT(maxNumDependents, Stats::units::Count::get(), + ADD_STAT(maxNumDependents, statistics::units::Count::get(), "Maximum number or dependents on any instruction"), - ADD_STAT(maxTempStoreSize, Stats::units::Count::get(), + ADD_STAT(maxTempStoreSize, statistics::units::Count::get(), "Maximum size of the temporary store during the run"), - ADD_STAT(maxPhysRegDepMapSize, Stats::units::Count::get(), + ADD_STAT(maxPhysRegDepMapSize, statistics::units::Count::get(), "Maximum size of register dependency map") { } diff --git a/src/cpu/o3/probe/elastic_trace.hh b/src/cpu/o3/probe/elastic_trace.hh index d2a1f21473..3a6af32b55 100644 --- a/src/cpu/o3/probe/elastic_trace.hh +++ b/src/cpu/o3/probe/elastic_trace.hh @@ -510,54 +510,54 @@ class ElasticTrace : public ProbeListenerObject */ bool hasCompCompleted(TraceInfo* past_record, Tick execute_tick) const; - struct ElasticTraceStats : public Stats::Group + struct ElasticTraceStats : public statistics::Group { - ElasticTraceStats(Stats::Group *parent); + ElasticTraceStats(statistics::Group *parent); /** Number of register dependencies recorded during tracing */ - Stats::Scalar numRegDep; + statistics::Scalar numRegDep; /** * Number of stores that got assigned a commit order dependency * on a past load/store. */ - Stats::Scalar numOrderDepStores; + statistics::Scalar numOrderDepStores; /** * Number of load insts that got assigned an issue order dependency * because they were dependency-free. */ - Stats::Scalar numIssueOrderDepLoads; + statistics::Scalar numIssueOrderDepLoads; /** * Number of store insts that got assigned an issue order dependency * because they were dependency-free. */ - Stats::Scalar numIssueOrderDepStores; + statistics::Scalar numIssueOrderDepStores; /** * Number of non load/store insts that got assigned an issue order * dependency because they were dependency-free. */ - Stats::Scalar numIssueOrderDepOther; + statistics::Scalar numIssueOrderDepOther; /** Number of filtered nodes */ - Stats::Scalar numFilteredNodes; + statistics::Scalar numFilteredNodes; /** Maximum number of dependents on any instruction */ - Stats::Scalar maxNumDependents; + statistics::Scalar maxNumDependents; /** * Maximum size of the temporary store mostly useful as a check that * it is not growing */ - Stats::Scalar maxTempStoreSize; + statistics::Scalar maxTempStoreSize; /** * Maximum size of the map that holds the last writer to a physical * register. */ - Stats::Scalar maxPhysRegDepMapSize; + statistics::Scalar maxPhysRegDepMapSize; } stats; }; diff --git a/src/cpu/o3/rename.cc b/src/cpu/o3/rename.cc index 4766452012..f2466315de 100644 --- a/src/cpu/o3/rename.cc +++ b/src/cpu/o3/rename.cc @@ -91,61 +91,61 @@ Rename::name() const return cpu->name() + ".rename"; } -Rename::RenameStats::RenameStats(Stats::Group *parent) - : Stats::Group(parent, "rename"), - ADD_STAT(squashCycles, Stats::units::Cycle::get(), +Rename::RenameStats::RenameStats(statistics::Group *parent) + : statistics::Group(parent, "rename"), + ADD_STAT(squashCycles, statistics::units::Cycle::get(), "Number of cycles rename is squashing"), - ADD_STAT(idleCycles, Stats::units::Cycle::get(), + ADD_STAT(idleCycles, statistics::units::Cycle::get(), "Number of cycles rename is idle"), - ADD_STAT(blockCycles, Stats::units::Cycle::get(), + ADD_STAT(blockCycles, statistics::units::Cycle::get(), "Number of cycles rename is blocking"), - ADD_STAT(serializeStallCycles, Stats::units::Cycle::get(), + ADD_STAT(serializeStallCycles, statistics::units::Cycle::get(), "count of cycles rename stalled for serializing inst"), - ADD_STAT(runCycles, Stats::units::Cycle::get(), + ADD_STAT(runCycles, statistics::units::Cycle::get(), "Number of cycles rename is running"), - ADD_STAT(unblockCycles, Stats::units::Cycle::get(), + ADD_STAT(unblockCycles, statistics::units::Cycle::get(), "Number of cycles rename is unblocking"), - ADD_STAT(renamedInsts, Stats::units::Count::get(), + ADD_STAT(renamedInsts, statistics::units::Count::get(), "Number of instructions processed by rename"), - ADD_STAT(squashedInsts, Stats::units::Count::get(), + ADD_STAT(squashedInsts, statistics::units::Count::get(), "Number of squashed instructions processed by rename"), - ADD_STAT(ROBFullEvents, Stats::units::Count::get(), + ADD_STAT(ROBFullEvents, statistics::units::Count::get(), "Number of times rename has blocked due to ROB full"), - ADD_STAT(IQFullEvents, Stats::units::Count::get(), + ADD_STAT(IQFullEvents, statistics::units::Count::get(), "Number of times rename has blocked due to IQ full"), - ADD_STAT(LQFullEvents, Stats::units::Count::get(), + ADD_STAT(LQFullEvents, statistics::units::Count::get(), "Number of times rename has blocked due to LQ full" ), - ADD_STAT(SQFullEvents, Stats::units::Count::get(), + ADD_STAT(SQFullEvents, statistics::units::Count::get(), "Number of times rename has blocked due to SQ full"), - ADD_STAT(fullRegistersEvents, Stats::units::Count::get(), + ADD_STAT(fullRegistersEvents, statistics::units::Count::get(), "Number of times there has been no free registers"), - ADD_STAT(renamedOperands, Stats::units::Count::get(), + ADD_STAT(renamedOperands, statistics::units::Count::get(), "Number of destination operands rename has renamed"), - ADD_STAT(lookups, Stats::units::Count::get(), + ADD_STAT(lookups, statistics::units::Count::get(), "Number of register rename lookups that rename has made"), - ADD_STAT(intLookups, Stats::units::Count::get(), + ADD_STAT(intLookups, statistics::units::Count::get(), "Number of integer rename lookups"), - ADD_STAT(fpLookups, Stats::units::Count::get(), + ADD_STAT(fpLookups, statistics::units::Count::get(), "Number of floating rename lookups"), - ADD_STAT(vecLookups, Stats::units::Count::get(), + ADD_STAT(vecLookups, statistics::units::Count::get(), "Number of vector rename lookups"), - ADD_STAT(vecPredLookups, Stats::units::Count::get(), + ADD_STAT(vecPredLookups, statistics::units::Count::get(), "Number of vector predicate rename lookups"), - ADD_STAT(committedMaps, Stats::units::Count::get(), + ADD_STAT(committedMaps, statistics::units::Count::get(), "Number of HB maps that are committed"), - ADD_STAT(undoneMaps, Stats::units::Count::get(), + ADD_STAT(undoneMaps, statistics::units::Count::get(), "Number of HB maps that are undone due to squashing"), - ADD_STAT(serializing, Stats::units::Count::get(), + ADD_STAT(serializing, statistics::units::Count::get(), "count of serializing insts renamed"), - ADD_STAT(tempSerializing, Stats::units::Count::get(), + ADD_STAT(tempSerializing, statistics::units::Count::get(), "count of temporary serializing insts renamed"), - ADD_STAT(skidInsts, Stats::units::Count::get(), + ADD_STAT(skidInsts, statistics::units::Count::get(), "count of insts added to the skid buffer") { squashCycles.prereq(squashCycles); idleCycles.prereq(idleCycles); blockCycles.prereq(blockCycles); - serializeStallCycles.flags(Stats::total); + serializeStallCycles.flags(statistics::total); runCycles.prereq(idleCycles); unblockCycles.prereq(unblockCycles); @@ -167,9 +167,9 @@ Rename::RenameStats::RenameStats(Stats::Group *parent) committedMaps.prereq(committedMaps); undoneMaps.prereq(undoneMaps); - serializing.flags(Stats::total); - tempSerializing.flags(Stats::total); - skidInsts.flags(Stats::total); + serializing.flags(statistics::total); + tempSerializing.flags(statistics::total); + skidInsts.flags(statistics::total); } void diff --git a/src/cpu/o3/rename.hh b/src/cpu/o3/rename.hh index 57990a8dcb..614e60536a 100644 --- a/src/cpu/o3/rename.hh +++ b/src/cpu/o3/rename.hh @@ -473,62 +473,62 @@ class Rename */ void incrFullStat(const FullSource &source); - struct RenameStats : public Stats::Group + struct RenameStats : public statistics::Group { - RenameStats(Stats::Group *parent); + RenameStats(statistics::Group *parent); /** Stat for total number of cycles spent squashing. */ - Stats::Scalar squashCycles; + statistics::Scalar squashCycles; /** Stat for total number of cycles spent idle. */ - Stats::Scalar idleCycles; + statistics::Scalar idleCycles; /** Stat for total number of cycles spent blocking. */ - Stats::Scalar blockCycles; + statistics::Scalar blockCycles; /** Stat for total number of cycles spent stalling for a serializing * inst. */ - Stats::Scalar serializeStallCycles; + statistics::Scalar serializeStallCycles; /** Stat for total number of cycles spent running normally. */ - Stats::Scalar runCycles; + statistics::Scalar runCycles; /** Stat for total number of cycles spent unblocking. */ - Stats::Scalar unblockCycles; + statistics::Scalar unblockCycles; /** Stat for total number of renamed instructions. */ - Stats::Scalar renamedInsts; + statistics::Scalar renamedInsts; /** Stat for total number of squashed instructions that rename * discards. */ - Stats::Scalar squashedInsts; + statistics::Scalar squashedInsts; /** Stat for total number of times that the ROB starts a stall in * rename. */ - Stats::Scalar ROBFullEvents; + statistics::Scalar ROBFullEvents; /** Stat for total number of times that the IQ starts a stall in * rename. */ - Stats::Scalar IQFullEvents; + statistics::Scalar IQFullEvents; /** Stat for total number of times that the LQ starts a stall in * rename. */ - Stats::Scalar LQFullEvents; + statistics::Scalar LQFullEvents; /** Stat for total number of times that the SQ starts a stall in * rename. */ - Stats::Scalar SQFullEvents; + statistics::Scalar SQFullEvents; /** Stat for total number of times that rename runs out of free * registers to use to rename. */ - Stats::Scalar fullRegistersEvents; + statistics::Scalar fullRegistersEvents; /** Stat for total number of renamed destination registers. */ - Stats::Scalar renamedOperands; + statistics::Scalar renamedOperands; /** Stat for total number of source register rename lookups. */ - Stats::Scalar lookups; - Stats::Scalar intLookups; - Stats::Scalar fpLookups; - Stats::Scalar vecLookups; - Stats::Scalar vecPredLookups; + statistics::Scalar lookups; + statistics::Scalar intLookups; + statistics::Scalar fpLookups; + statistics::Scalar vecLookups; + statistics::Scalar vecPredLookups; /** Stat for total number of committed renaming mappings. */ - Stats::Scalar committedMaps; + statistics::Scalar committedMaps; /** Stat for total number of mappings that were undone due to a * squash. */ - Stats::Scalar undoneMaps; + statistics::Scalar undoneMaps; /** Number of serialize instructions handled. */ - Stats::Scalar serializing; + statistics::Scalar serializing; /** Number of instructions marked as temporarily serializing. */ - Stats::Scalar tempSerializing; + statistics::Scalar tempSerializing; /** Number of instructions inserted into skid buffers. */ - Stats::Scalar skidInsts; + statistics::Scalar skidInsts; } stats; }; diff --git a/src/cpu/o3/rob.cc b/src/cpu/o3/rob.cc index 5c4682d1c5..b58231f3fc 100644 --- a/src/cpu/o3/rob.cc +++ b/src/cpu/o3/rob.cc @@ -518,10 +518,12 @@ ROB::readTailInst(ThreadID tid) return *tail_thread; } -ROB::ROBStats::ROBStats(Stats::Group *parent) - : Stats::Group(parent, "rob"), - ADD_STAT(reads, Stats::units::Count::get(), "The number of ROB reads"), - ADD_STAT(writes, Stats::units::Count::get(), "The number of ROB writes") +ROB::ROBStats::ROBStats(statistics::Group *parent) + : statistics::Group(parent, "rob"), + ADD_STAT(reads, statistics::units::Count::get(), + "The number of ROB reads"), + ADD_STAT(writes, statistics::units::Count::get(), + "The number of ROB writes") { } diff --git a/src/cpu/o3/rob.hh b/src/cpu/o3/rob.hh index cf8ccec632..d81f4b5c2d 100644 --- a/src/cpu/o3/rob.hh +++ b/src/cpu/o3/rob.hh @@ -328,14 +328,14 @@ class ROB ThreadID numThreads; - struct ROBStats : public Stats::Group + struct ROBStats : public statistics::Group { - ROBStats(Stats::Group *parent); + ROBStats(statistics::Group *parent); // The number of rob_reads - Stats::Scalar reads; + statistics::Scalar reads; // The number of rob_writes - Stats::Scalar writes; + statistics::Scalar writes; } stats; }; diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc index 544c1ea796..d0f38127f8 100644 --- a/src/cpu/pred/bpred_unit.cc +++ b/src/cpu/pred/bpred_unit.cc @@ -67,29 +67,29 @@ BPredUnit::BPredUnit(const Params ¶ms) r.init(params.RASSize); } -BPredUnit::BPredUnitStats::BPredUnitStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(lookups, Stats::units::Count::get(), "Number of BP lookups"), - ADD_STAT(condPredicted, Stats::units::Count::get(), +BPredUnit::BPredUnitStats::BPredUnitStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(lookups, statistics::units::Count::get(), "Number of BP lookups"), + ADD_STAT(condPredicted, statistics::units::Count::get(), "Number of conditional branches predicted"), - ADD_STAT(condIncorrect, Stats::units::Count::get(), + ADD_STAT(condIncorrect, statistics::units::Count::get(), "Number of conditional branches incorrect"), - ADD_STAT(BTBLookups, Stats::units::Count::get(), + ADD_STAT(BTBLookups, statistics::units::Count::get(), "Number of BTB lookups"), - ADD_STAT(BTBHits, Stats::units::Count::get(), "Number of BTB hits"), - ADD_STAT(BTBHitRatio, Stats::units::Ratio::get(), "BTB Hit Ratio", + ADD_STAT(BTBHits, statistics::units::Count::get(), "Number of BTB hits"), + ADD_STAT(BTBHitRatio, statistics::units::Ratio::get(), "BTB Hit Ratio", BTBHits / BTBLookups), - ADD_STAT(RASUsed, Stats::units::Count::get(), + ADD_STAT(RASUsed, statistics::units::Count::get(), "Number of times the RAS was used to get a target."), - ADD_STAT(RASIncorrect, Stats::units::Count::get(), + ADD_STAT(RASIncorrect, statistics::units::Count::get(), "Number of incorrect RAS predictions."), - ADD_STAT(indirectLookups, Stats::units::Count::get(), + ADD_STAT(indirectLookups, statistics::units::Count::get(), "Number of indirect predictor lookups."), - ADD_STAT(indirectHits, Stats::units::Count::get(), + ADD_STAT(indirectHits, statistics::units::Count::get(), "Number of indirect target hits."), - ADD_STAT(indirectMisses, Stats::units::Count::get(), + ADD_STAT(indirectMisses, statistics::units::Count::get(), "Number of indirect misses."), - ADD_STAT(indirectMispredicted, Stats::units::Count::get(), + ADD_STAT(indirectMispredicted, statistics::units::Count::get(), "Number of mispredicted indirect branches.") { BTBHitRatio.precision(6); diff --git a/src/cpu/pred/bpred_unit.hh b/src/cpu/pred/bpred_unit.hh index d4a03ff463..fb9592f92e 100644 --- a/src/cpu/pred/bpred_unit.hh +++ b/src/cpu/pred/bpred_unit.hh @@ -278,35 +278,35 @@ class BPredUnit : public SimObject /** The indirect target predictor. */ IndirectPredictor * iPred; - struct BPredUnitStats : public Stats::Group + struct BPredUnitStats : public statistics::Group { - BPredUnitStats(Stats::Group *parent); + BPredUnitStats(statistics::Group *parent); /** Stat for number of BP lookups. */ - Stats::Scalar lookups; + statistics::Scalar lookups; /** Stat for number of conditional branches predicted. */ - Stats::Scalar condPredicted; + statistics::Scalar condPredicted; /** Stat for number of conditional branches predicted incorrectly. */ - Stats::Scalar condIncorrect; + statistics::Scalar condIncorrect; /** Stat for number of BTB lookups. */ - Stats::Scalar BTBLookups; + statistics::Scalar BTBLookups; /** Stat for number of BTB hits. */ - Stats::Scalar BTBHits; + statistics::Scalar BTBHits; /** Stat for the ratio between BTB hits and BTB lookups. */ - Stats::Formula BTBHitRatio; + statistics::Formula BTBHitRatio; /** Stat for number of times the RAS is used to get a target. */ - Stats::Scalar RASUsed; + statistics::Scalar RASUsed; /** Stat for number of times the RAS is incorrect. */ - Stats::Scalar RASIncorrect; + statistics::Scalar RASIncorrect; /** Stat for the number of indirect target lookups.*/ - Stats::Scalar indirectLookups; + statistics::Scalar indirectLookups; /** Stat for the number of indirect target hits.*/ - Stats::Scalar indirectHits; + statistics::Scalar indirectHits; /** Stat for the number of indirect target misses.*/ - Stats::Scalar indirectMisses; + statistics::Scalar indirectMisses; /** Stat for the number of indirect target mispredictions.*/ - Stats::Scalar indirectMispredicted; + statistics::Scalar indirectMispredicted; } stats; protected: diff --git a/src/cpu/pred/loop_predictor.cc b/src/cpu/pred/loop_predictor.cc index d49022912b..043d9d7dc7 100644 --- a/src/cpu/pred/loop_predictor.cc +++ b/src/cpu/pred/loop_predictor.cc @@ -345,12 +345,13 @@ LoopPredictor::condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, loopUpdate(branch_pc, taken, bi, tage_pred); } -LoopPredictor::LoopPredictorStats::LoopPredictorStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(correct, Stats::units::Count::get(), +LoopPredictor::LoopPredictorStats::LoopPredictorStats( + statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(correct, statistics::units::Count::get(), "Number of times the loop predictor is the provider and the " "prediction is correct"), - ADD_STAT(wrong, Stats::units::Count::get(), + ADD_STAT(wrong, statistics::units::Count::get(), "Number of times the loop predictor is the provider and the " "prediction is wrong") { diff --git a/src/cpu/pred/loop_predictor.hh b/src/cpu/pred/loop_predictor.hh index 96e2cb7e5a..4664ab33ba 100644 --- a/src/cpu/pred/loop_predictor.hh +++ b/src/cpu/pred/loop_predictor.hh @@ -83,11 +83,11 @@ class LoopPredictor : public SimObject const unsigned initialLoopAge; const bool optionalAgeReset; - struct LoopPredictorStats : public Stats::Group + struct LoopPredictorStats : public statistics::Group { - LoopPredictorStats(Stats::Group *parent); - Stats::Scalar correct; - Stats::Scalar wrong; + LoopPredictorStats(statistics::Group *parent); + statistics::Scalar correct; + statistics::Scalar wrong; } stats; /** diff --git a/src/cpu/pred/statistical_corrector.cc b/src/cpu/pred/statistical_corrector.cc index ac794637d0..8bd05af7f9 100644 --- a/src/cpu/pred/statistical_corrector.cc +++ b/src/cpu/pred/statistical_corrector.cc @@ -398,12 +398,12 @@ StatisticalCorrector::getSizeInBits() const } StatisticalCorrector::StatisticalCorrectorStats::StatisticalCorrectorStats( - Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(correct, Stats::units::Count::get(), + statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(correct, statistics::units::Count::get(), "Number of time the SC predictor is the provider and the " "prediction is correct"), - ADD_STAT(wrong, Stats::units::Count::get(), + ADD_STAT(wrong, statistics::units::Count::get(), "Number of time the SC predictor is the provider and the " "prediction is wrong") { diff --git a/src/cpu/pred/statistical_corrector.hh b/src/cpu/pred/statistical_corrector.hh index 11755683a3..91cc90918c 100644 --- a/src/cpu/pred/statistical_corrector.hh +++ b/src/cpu/pred/statistical_corrector.hh @@ -183,11 +183,11 @@ class StatisticalCorrector : public SimObject int8_t firstH; int8_t secondH; - struct StatisticalCorrectorStats : public Stats::Group + struct StatisticalCorrectorStats : public statistics::Group { - StatisticalCorrectorStats(Stats::Group *parent); - Stats::Scalar correct; - Stats::Scalar wrong; + StatisticalCorrectorStats(statistics::Group *parent); + statistics::Scalar correct; + statistics::Scalar wrong; } stats; public: diff --git a/src/cpu/pred/tage_base.cc b/src/cpu/pred/tage_base.cc index 0935078a2e..c6e46c9fb3 100644 --- a/src/cpu/pred/tage_base.cc +++ b/src/cpu/pred/tage_base.cc @@ -717,41 +717,41 @@ TAGEBase::getGHR(ThreadID tid, BranchInfo *bi) const } TAGEBase::TAGEBaseStats::TAGEBaseStats( - Stats::Group *parent, unsigned nHistoryTables) - : Stats::Group(parent), - ADD_STAT(longestMatchProviderCorrect, Stats::units::Count::get(), + statistics::Group *parent, unsigned nHistoryTables) + : statistics::Group(parent), + ADD_STAT(longestMatchProviderCorrect, statistics::units::Count::get(), "Number of times TAGE Longest Match is the provider and the " "prediction is correct"), - ADD_STAT(altMatchProviderCorrect, Stats::units::Count::get(), + ADD_STAT(altMatchProviderCorrect, statistics::units::Count::get(), "Number of times TAGE Alt Match is the provider and the " "prediction is correct"), - ADD_STAT(bimodalAltMatchProviderCorrect, Stats::units::Count::get(), + ADD_STAT(bimodalAltMatchProviderCorrect, statistics::units::Count::get(), "Number of times TAGE Alt Match is the bimodal and it is the " "provider and the prediction is correct"), - ADD_STAT(bimodalProviderCorrect, Stats::units::Count::get(), + ADD_STAT(bimodalProviderCorrect, statistics::units::Count::get(), "Number of times there are no hits on the TAGE tables and the " "bimodal prediction is correct"), - ADD_STAT(longestMatchProviderWrong, Stats::units::Count::get(), + ADD_STAT(longestMatchProviderWrong, statistics::units::Count::get(), "Number of times TAGE Longest Match is the provider and the " "prediction is wrong"), - ADD_STAT(altMatchProviderWrong, Stats::units::Count::get(), + ADD_STAT(altMatchProviderWrong, statistics::units::Count::get(), "Number of times TAGE Alt Match is the provider and the " "prediction is wrong"), - ADD_STAT(bimodalAltMatchProviderWrong, Stats::units::Count::get(), + ADD_STAT(bimodalAltMatchProviderWrong, statistics::units::Count::get(), "Number of times TAGE Alt Match is the bimodal and it is the " "provider and the prediction is wrong"), - ADD_STAT(bimodalProviderWrong, Stats::units::Count::get(), + ADD_STAT(bimodalProviderWrong, statistics::units::Count::get(), "Number of times there are no hits on the TAGE tables and the " "bimodal prediction is wrong"), - ADD_STAT(altMatchProviderWouldHaveHit, Stats::units::Count::get(), + ADD_STAT(altMatchProviderWouldHaveHit, statistics::units::Count::get(), "Number of times TAGE Longest Match is the provider, the " "prediction is wrong and Alt Match prediction was correct"), - ADD_STAT(longestMatchProviderWouldHaveHit, Stats::units::Count::get(), + ADD_STAT(longestMatchProviderWouldHaveHit, statistics::units::Count::get(), "Number of times TAGE Alt Match is the provider, the " "prediction is wrong and Longest Match prediction was correct"), - ADD_STAT(longestMatchProvider, Stats::units::Count::get(), + ADD_STAT(longestMatchProvider, statistics::units::Count::get(), "TAGE provider for longest match"), - ADD_STAT(altMatchProvider, Stats::units::Count::get(), + ADD_STAT(altMatchProvider, statistics::units::Count::get(), "TAGE provider for alt match") { longestMatchProvider.init(nHistoryTables + 1); diff --git a/src/cpu/pred/tage_base.hh b/src/cpu/pred/tage_base.hh index e79fac3674..d6ecf7828a 100644 --- a/src/cpu/pred/tage_base.hh +++ b/src/cpu/pred/tage_base.hh @@ -485,23 +485,23 @@ class TAGEBase : public SimObject bool initialized; - struct TAGEBaseStats : public Stats::Group + struct TAGEBaseStats : public statistics::Group { - TAGEBaseStats(Stats::Group *parent, unsigned nHistoryTables); + TAGEBaseStats(statistics::Group *parent, unsigned nHistoryTables); // stats - Stats::Scalar longestMatchProviderCorrect; - Stats::Scalar altMatchProviderCorrect; - Stats::Scalar bimodalAltMatchProviderCorrect; - Stats::Scalar bimodalProviderCorrect; - Stats::Scalar longestMatchProviderWrong; - Stats::Scalar altMatchProviderWrong; - Stats::Scalar bimodalAltMatchProviderWrong; - Stats::Scalar bimodalProviderWrong; - Stats::Scalar altMatchProviderWouldHaveHit; - Stats::Scalar longestMatchProviderWouldHaveHit; + statistics::Scalar longestMatchProviderCorrect; + statistics::Scalar altMatchProviderCorrect; + statistics::Scalar bimodalAltMatchProviderCorrect; + statistics::Scalar bimodalProviderCorrect; + statistics::Scalar longestMatchProviderWrong; + statistics::Scalar altMatchProviderWrong; + statistics::Scalar bimodalAltMatchProviderWrong; + statistics::Scalar bimodalProviderWrong; + statistics::Scalar altMatchProviderWouldHaveHit; + statistics::Scalar longestMatchProviderWouldHaveHit; - Stats::Vector longestMatchProvider; - Stats::Vector altMatchProvider; + statistics::Vector longestMatchProvider; + statistics::Vector altMatchProvider; } stats; }; diff --git a/src/cpu/profile.cc b/src/cpu/profile.cc index cf65160713..222e946da9 100644 --- a/src/cpu/profile.cc +++ b/src/cpu/profile.cc @@ -97,7 +97,7 @@ FunctionProfile::FunctionProfile(std::unique_ptr _trace, const loader::SymbolTable &_symtab) : symtab(_symtab), trace(std::move(_trace)) { - Stats::registerResetCallback([this]() { clear(); }); + statistics::registerResetCallback([this]() { clear(); }); } ProfileNode * diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh index 1aac862765..578cc554ef 100644 --- a/src/cpu/simple/exec_context.hh +++ b/src/cpu/simple/exec_context.hh @@ -79,84 +79,84 @@ class SimpleExecContext : public ExecContext // Number of cycles stalled for D-cache responses Counter lastDcacheStall; - struct ExecContextStats : public Stats::Group + struct ExecContextStats : public statistics::Group { ExecContextStats(BaseSimpleCPU *cpu, SimpleThread *thread) - : Stats::Group(cpu, + : statistics::Group(cpu, csprintf("exec_context.thread_%i", thread->threadId()).c_str()), - ADD_STAT(numInsts, Stats::units::Count::get(), + ADD_STAT(numInsts, statistics::units::Count::get(), "Number of instructions committed"), - ADD_STAT(numOps, Stats::units::Count::get(), + ADD_STAT(numOps, statistics::units::Count::get(), "Number of ops (including micro ops) committed"), - ADD_STAT(numIntAluAccesses, Stats::units::Count::get(), + ADD_STAT(numIntAluAccesses, statistics::units::Count::get(), "Number of integer alu accesses"), - ADD_STAT(numFpAluAccesses, Stats::units::Count::get(), + ADD_STAT(numFpAluAccesses, statistics::units::Count::get(), "Number of float alu accesses"), - ADD_STAT(numVecAluAccesses, Stats::units::Count::get(), + ADD_STAT(numVecAluAccesses, statistics::units::Count::get(), "Number of vector alu accesses"), - ADD_STAT(numCallsReturns, Stats::units::Count::get(), + ADD_STAT(numCallsReturns, statistics::units::Count::get(), "Number of times a function call or return occured"), - ADD_STAT(numCondCtrlInsts, Stats::units::Count::get(), + ADD_STAT(numCondCtrlInsts, statistics::units::Count::get(), "Number of instructions that are conditional controls"), - ADD_STAT(numIntInsts, Stats::units::Count::get(), + ADD_STAT(numIntInsts, statistics::units::Count::get(), "Number of integer instructions"), - ADD_STAT(numFpInsts, Stats::units::Count::get(), + ADD_STAT(numFpInsts, statistics::units::Count::get(), "Number of float instructions"), - ADD_STAT(numVecInsts, Stats::units::Count::get(), + ADD_STAT(numVecInsts, statistics::units::Count::get(), "Number of vector instructions"), - ADD_STAT(numIntRegReads, Stats::units::Count::get(), + ADD_STAT(numIntRegReads, statistics::units::Count::get(), "Number of times the integer registers were read"), - ADD_STAT(numIntRegWrites, Stats::units::Count::get(), + ADD_STAT(numIntRegWrites, statistics::units::Count::get(), "Number of times the integer registers were written"), - ADD_STAT(numFpRegReads, Stats::units::Count::get(), + ADD_STAT(numFpRegReads, statistics::units::Count::get(), "Number of times the floating registers were read"), - ADD_STAT(numFpRegWrites, Stats::units::Count::get(), + ADD_STAT(numFpRegWrites, statistics::units::Count::get(), "Number of times the floating registers were written"), - ADD_STAT(numVecRegReads, Stats::units::Count::get(), + ADD_STAT(numVecRegReads, statistics::units::Count::get(), "Number of times the vector registers were read"), - ADD_STAT(numVecRegWrites, Stats::units::Count::get(), + ADD_STAT(numVecRegWrites, statistics::units::Count::get(), "Number of times the vector registers were written"), - ADD_STAT(numVecPredRegReads, Stats::units::Count::get(), + ADD_STAT(numVecPredRegReads, statistics::units::Count::get(), "Number of times the predicate registers were read"), - ADD_STAT(numVecPredRegWrites, Stats::units::Count::get(), + ADD_STAT(numVecPredRegWrites, statistics::units::Count::get(), "Number of times the predicate registers were written"), - ADD_STAT(numCCRegReads, Stats::units::Count::get(), + ADD_STAT(numCCRegReads, statistics::units::Count::get(), "Number of times the CC registers were read"), - ADD_STAT(numCCRegWrites, Stats::units::Count::get(), + ADD_STAT(numCCRegWrites, statistics::units::Count::get(), "Number of times the CC registers were written"), - ADD_STAT(numMemRefs, Stats::units::Count::get(), + ADD_STAT(numMemRefs, statistics::units::Count::get(), "Number of memory refs"), - ADD_STAT(numLoadInsts, Stats::units::Count::get(), + ADD_STAT(numLoadInsts, statistics::units::Count::get(), "Number of load instructions"), - ADD_STAT(numStoreInsts, Stats::units::Count::get(), + ADD_STAT(numStoreInsts, statistics::units::Count::get(), "Number of store instructions"), - ADD_STAT(numIdleCycles, Stats::units::Cycle::get(), + ADD_STAT(numIdleCycles, statistics::units::Cycle::get(), "Number of idle cycles"), - ADD_STAT(numBusyCycles, Stats::units::Cycle::get(), + ADD_STAT(numBusyCycles, statistics::units::Cycle::get(), "Number of busy cycles"), - ADD_STAT(notIdleFraction, Stats::units::Ratio::get(), + ADD_STAT(notIdleFraction, statistics::units::Ratio::get(), "Percentage of non-idle cycles"), - ADD_STAT(idleFraction, Stats::units::Ratio::get(), + ADD_STAT(idleFraction, statistics::units::Ratio::get(), "Percentage of idle cycles"), - ADD_STAT(icacheStallCycles, Stats::units::Cycle::get(), + ADD_STAT(icacheStallCycles, statistics::units::Cycle::get(), "ICache total stall cycles"), - ADD_STAT(dcacheStallCycles, Stats::units::Cycle::get(), + ADD_STAT(dcacheStallCycles, statistics::units::Cycle::get(), "DCache total stall cycles"), - ADD_STAT(numBranches, Stats::units::Count::get(), + ADD_STAT(numBranches, statistics::units::Count::get(), "Number of branches fetched"), - ADD_STAT(numPredictedBranches, Stats::units::Count::get(), + ADD_STAT(numPredictedBranches, statistics::units::Count::get(), "Number of branches predicted as taken"), - ADD_STAT(numBranchMispred, Stats::units::Count::get(), + ADD_STAT(numBranchMispred, statistics::units::Count::get(), "Number of branch mispredictions"), - ADD_STAT(statExecutedInstType, Stats::units::Count::get(), + ADD_STAT(statExecutedInstType, statistics::units::Count::get(), "Class of executed instruction.") { numCCRegReads - .flags(Stats::nozero); + .flags(statistics::nozero); numCCRegWrites - .flags(Stats::nozero); + .flags(statistics::nozero); icacheStallCycles .prereq(icacheStallCycles); @@ -166,13 +166,13 @@ class SimpleExecContext : public ExecContext statExecutedInstType .init(enums::Num_OpClass) - .flags(Stats::total | Stats::pdf | Stats::dist); + .flags(statistics::total | statistics::pdf | statistics::dist); for (unsigned i = 0; i < Num_OpClasses; ++i) { statExecutedInstType.subname(i, enums::OpClassStrings[i]); } - idleFraction = Stats::constant(1.0) - notIdleFraction; + idleFraction = statistics::constant(1.0) - notIdleFraction; numIdleCycles = idleFraction * cpu->baseStats.numCycles; numBusyCycles = notIdleFraction * cpu->baseStats.numCycles; @@ -187,85 +187,85 @@ class SimpleExecContext : public ExecContext } // Number of simulated instructions - Stats::Scalar numInsts; - Stats::Scalar numOps; + statistics::Scalar numInsts; + statistics::Scalar numOps; // Number of integer alu accesses - Stats::Scalar numIntAluAccesses; + statistics::Scalar numIntAluAccesses; // Number of float alu accesses - Stats::Scalar numFpAluAccesses; + statistics::Scalar numFpAluAccesses; // Number of vector alu accesses - Stats::Scalar numVecAluAccesses; + statistics::Scalar numVecAluAccesses; // Number of function calls/returns - Stats::Scalar numCallsReturns; + statistics::Scalar numCallsReturns; // Conditional control instructions; - Stats::Scalar numCondCtrlInsts; + statistics::Scalar numCondCtrlInsts; // Number of int instructions - Stats::Scalar numIntInsts; + statistics::Scalar numIntInsts; // Number of float instructions - Stats::Scalar numFpInsts; + statistics::Scalar numFpInsts; // Number of vector instructions - Stats::Scalar numVecInsts; + statistics::Scalar numVecInsts; // Number of integer register file accesses - Stats::Scalar numIntRegReads; - Stats::Scalar numIntRegWrites; + statistics::Scalar numIntRegReads; + statistics::Scalar numIntRegWrites; // Number of float register file accesses - Stats::Scalar numFpRegReads; - Stats::Scalar numFpRegWrites; + statistics::Scalar numFpRegReads; + statistics::Scalar numFpRegWrites; // Number of vector register file accesses - mutable Stats::Scalar numVecRegReads; - Stats::Scalar numVecRegWrites; + mutable statistics::Scalar numVecRegReads; + statistics::Scalar numVecRegWrites; // Number of predicate register file accesses - mutable Stats::Scalar numVecPredRegReads; - Stats::Scalar numVecPredRegWrites; + mutable statistics::Scalar numVecPredRegReads; + statistics::Scalar numVecPredRegWrites; // Number of condition code register file accesses - Stats::Scalar numCCRegReads; - Stats::Scalar numCCRegWrites; + statistics::Scalar numCCRegReads; + statistics::Scalar numCCRegWrites; // Number of simulated memory references - Stats::Scalar numMemRefs; - Stats::Scalar numLoadInsts; - Stats::Scalar numStoreInsts; + statistics::Scalar numMemRefs; + statistics::Scalar numLoadInsts; + statistics::Scalar numStoreInsts; // Number of idle cycles - Stats::Formula numIdleCycles; + statistics::Formula numIdleCycles; // Number of busy cycles - Stats::Formula numBusyCycles; + statistics::Formula numBusyCycles; // Number of idle cycles - Stats::Average notIdleFraction; - Stats::Formula idleFraction; + statistics::Average notIdleFraction; + statistics::Formula idleFraction; // Number of cycles stalled for I-cache responses - Stats::Scalar icacheStallCycles; + statistics::Scalar icacheStallCycles; // Number of cycles stalled for D-cache responses - Stats::Scalar dcacheStallCycles; + statistics::Scalar dcacheStallCycles; /// @{ /// Total number of branches fetched - Stats::Scalar numBranches; + statistics::Scalar numBranches; /// Number of branches predicted as taken - Stats::Scalar numPredictedBranches; + statistics::Scalar numPredictedBranches; /// Number of misprediced branches - Stats::Scalar numBranchMispred; + statistics::Scalar numBranchMispred; /// @} // Instruction mix histogram by OpClass - Stats::Vector statExecutedInstType; + statistics::Vector statExecutedInstType; } execContextStats; diff --git a/src/cpu/testers/memtest/memtest.cc b/src/cpu/testers/memtest/memtest.cc index edd79cb98b..c6dbeeb98d 100644 --- a/src/cpu/testers/memtest/memtest.cc +++ b/src/cpu/testers/memtest/memtest.cc @@ -189,11 +189,11 @@ MemTest::completeRequest(PacketPtr pkt, bool functional) else if (noResponseEvent.scheduled()) deschedule(noResponseEvent); } -MemTest::MemTestStats::MemTestStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(numReads, Stats::units::Count::get(), +MemTest::MemTestStats::MemTestStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(numReads, statistics::units::Count::get(), "number of read accesses completed"), - ADD_STAT(numWrites, Stats::units::Count::get(), + ADD_STAT(numWrites, statistics::units::Count::get(), "number of write accesses completed") { diff --git a/src/cpu/testers/memtest/memtest.hh b/src/cpu/testers/memtest/memtest.hh index ec9443be0d..5c417bfa4e 100644 --- a/src/cpu/testers/memtest/memtest.hh +++ b/src/cpu/testers/memtest/memtest.hh @@ -166,11 +166,11 @@ class MemTest : public ClockedObject const bool suppressFuncErrors; protected: - struct MemTestStats : public Stats::Group + struct MemTestStats : public statistics::Group { - MemTestStats(Stats::Group *parent); - Stats::Scalar numReads; - Stats::Scalar numWrites; + MemTestStats(statistics::Group *parent); + statistics::Scalar numReads; + statistics::Scalar numWrites; } stats; /** diff --git a/src/cpu/testers/traffic_gen/base.cc b/src/cpu/testers/traffic_gen/base.cc index 141152283a..54a7cbd354 100644 --- a/src/cpu/testers/traffic_gen/base.cc +++ b/src/cpu/testers/traffic_gen/base.cc @@ -330,36 +330,36 @@ BaseTrafficGen::noProgress() name(), progressCheck); } -BaseTrafficGen::StatGroup::StatGroup(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(numSuppressed, Stats::units::Count::get(), +BaseTrafficGen::StatGroup::StatGroup(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(numSuppressed, statistics::units::Count::get(), "Number of suppressed packets to non-memory space"), - ADD_STAT(numPackets, Stats::units::Count::get(), + ADD_STAT(numPackets, statistics::units::Count::get(), "Number of packets generated"), - ADD_STAT(numRetries, Stats::units::Count::get(), "Number of retries"), - ADD_STAT(retryTicks, Stats::units::Tick::get(), + ADD_STAT(numRetries, statistics::units::Count::get(), "Number of retries"), + ADD_STAT(retryTicks, statistics::units::Tick::get(), "Time spent waiting due to back-pressure"), - ADD_STAT(bytesRead, Stats::units::Byte::get(), "Number of bytes read"), - ADD_STAT(bytesWritten, Stats::units::Byte::get(), + ADD_STAT(bytesRead, statistics::units::Byte::get(), "Number of bytes read"), + ADD_STAT(bytesWritten, statistics::units::Byte::get(), "Number of bytes written"), - ADD_STAT(totalReadLatency, Stats::units::Tick::get(), + ADD_STAT(totalReadLatency, statistics::units::Tick::get(), "Total latency of read requests"), - ADD_STAT(totalWriteLatency, Stats::units::Tick::get(), + ADD_STAT(totalWriteLatency, statistics::units::Tick::get(), "Total latency of write requests"), - ADD_STAT(totalReads, Stats::units::Count::get(), "Total num of reads"), - ADD_STAT(totalWrites, Stats::units::Count::get(), "Total num of writes"), - ADD_STAT(avgReadLatency, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(totalReads, statistics::units::Count::get(), "Total num of reads"), + ADD_STAT(totalWrites, statistics::units::Count::get(), "Total num of writes"), + ADD_STAT(avgReadLatency, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Avg latency of read requests", totalReadLatency / totalReads), - ADD_STAT(avgWriteLatency, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgWriteLatency, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Avg latency of write requests", totalWriteLatency / totalWrites), - ADD_STAT(readBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(readBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Read bandwidth", bytesRead / simSeconds), - ADD_STAT(writeBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(writeBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Write bandwidth", bytesWritten / simSeconds) { } diff --git a/src/cpu/testers/traffic_gen/base.hh b/src/cpu/testers/traffic_gen/base.hh index 29001c9e33..850326e0c7 100644 --- a/src/cpu/testers/traffic_gen/base.hh +++ b/src/cpu/testers/traffic_gen/base.hh @@ -191,51 +191,51 @@ class BaseTrafficGen : public ClockedObject /** Reqs waiting for response **/ std::unordered_map waitingResp; - struct StatGroup : public Stats::Group + struct StatGroup : public statistics::Group { - StatGroup(Stats::Group *parent); + StatGroup(statistics::Group *parent); /** Count the number of dropped requests. */ - Stats::Scalar numSuppressed; + statistics::Scalar numSuppressed; /** Count the number of generated packets. */ - Stats::Scalar numPackets; + statistics::Scalar numPackets; /** Count the number of retries. */ - Stats::Scalar numRetries; + statistics::Scalar numRetries; /** Count the time incurred from back-pressure. */ - Stats::Scalar retryTicks; + statistics::Scalar retryTicks; /** Count the number of bytes read. */ - Stats::Scalar bytesRead; + statistics::Scalar bytesRead; /** Count the number of bytes written. */ - Stats::Scalar bytesWritten; + statistics::Scalar bytesWritten; /** Total num of ticks read reqs took to complete */ - Stats::Scalar totalReadLatency; + statistics::Scalar totalReadLatency; /** Total num of ticks write reqs took to complete */ - Stats::Scalar totalWriteLatency; + statistics::Scalar totalWriteLatency; /** Count the number reads. */ - Stats::Scalar totalReads; + statistics::Scalar totalReads; /** Count the number writes. */ - Stats::Scalar totalWrites; + statistics::Scalar totalWrites; /** Avg num of ticks each read req took to complete */ - Stats::Formula avgReadLatency; + statistics::Formula avgReadLatency; /** Avg num of ticks each write reqs took to complete */ - Stats::Formula avgWriteLatency; + statistics::Formula avgWriteLatency; /** Read bandwidth in bytes/s */ - Stats::Formula readBW; + statistics::Formula readBW; /** Write bandwidth in bytes/s */ - Stats::Formula writeBW; + statistics::Formula writeBW; } stats; public: diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc index 6956196777..620ce1ee3a 100644 --- a/src/cpu/thread_state.cc +++ b/src/cpu/thread_state.cc @@ -90,11 +90,12 @@ ThreadState::getVirtProxy() ThreadState::ThreadStateStats::ThreadStateStats(BaseCPU *cpu, const ThreadID& tid) - : Stats::Group(cpu, csprintf("thread_%i", tid).c_str()), - ADD_STAT(numInsts, Stats::units::Count::get(), + : statistics::Group(cpu, csprintf("thread_%i", tid).c_str()), + ADD_STAT(numInsts, statistics::units::Count::get(), "Number of Instructions committed"), - ADD_STAT(numOps, Stats::units::Count::get(), "Number of Ops committed"), - ADD_STAT(numMemRefs, Stats::units::Count::get(), + ADD_STAT(numOps, statistics::units::Count::get(), + "Number of Ops committed"), + ADD_STAT(numMemRefs, statistics::units::Count::get(), "Number of Memory References") { diff --git a/src/cpu/thread_state.hh b/src/cpu/thread_state.hh index 4c8a00672c..e805b01521 100644 --- a/src/cpu/thread_state.hh +++ b/src/cpu/thread_state.hh @@ -96,15 +96,15 @@ struct ThreadState : public Serializable /** Number of ops (including micro ops) committed. */ Counter numOp; // Defining the stat group - struct ThreadStateStats : public Stats::Group + struct ThreadStateStats : public statistics::Group { ThreadStateStats(BaseCPU *cpu, const ThreadID& thread); /** Stat for number instructions committed. */ - Stats::Scalar numInsts; + statistics::Scalar numInsts; /** Stat for number ops (including micro ops) committed. */ - Stats::Scalar numOps; + statistics::Scalar numOps; /** Stat for number of memory references. */ - Stats::Scalar numMemRefs; + statistics::Scalar numMemRefs; } threadStats; /** Number of simulated loads, used for tracking events based on diff --git a/src/cpu/trace/trace_cpu.cc b/src/cpu/trace/trace_cpu.cc index 01e021cd54..32f021cda2 100644 --- a/src/cpu/trace/trace_cpu.cc +++ b/src/cpu/trace/trace_cpu.cc @@ -202,16 +202,16 @@ TraceCPU::checkAndSchedExitEvent() } } TraceCPU::TraceStats::TraceStats(TraceCPU *trace) : - Stats::Group(trace), - ADD_STAT(numSchedDcacheEvent, Stats::units::Count::get(), + statistics::Group(trace), + ADD_STAT(numSchedDcacheEvent, statistics::units::Count::get(), "Number of events scheduled to trigger data request generator"), - ADD_STAT(numSchedIcacheEvent, Stats::units::Count::get(), + ADD_STAT(numSchedIcacheEvent, statistics::units::Count::get(), "Number of events scheduled to trigger instruction request " "generator"), - ADD_STAT(numOps, Stats::units::Count::get(), + ADD_STAT(numOps, statistics::units::Count::get(), "Number of micro-ops simulated by the Trace CPU"), - ADD_STAT(cpi, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(cpi, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "Cycles per micro-op used as a proxy for CPI", trace->baseStats.numCycles / numOps) { @@ -219,28 +219,28 @@ TraceCPU::checkAndSchedExitEvent() } TraceCPU::ElasticDataGen:: -ElasticDataGenStatGroup::ElasticDataGenStatGroup(Stats::Group *parent, +ElasticDataGenStatGroup::ElasticDataGenStatGroup(statistics::Group *parent, const std::string& _name) : - Stats::Group(parent, _name.c_str()), - ADD_STAT(maxDependents, Stats::units::Count::get(), + statistics::Group(parent, _name.c_str()), + ADD_STAT(maxDependents, statistics::units::Count::get(), "Max number of dependents observed on a node"), - ADD_STAT(maxReadyListSize, Stats::units::Count::get(), + ADD_STAT(maxReadyListSize, statistics::units::Count::get(), "Max size of the ready list observed"), - ADD_STAT(numSendAttempted, Stats::units::Count::get(), + ADD_STAT(numSendAttempted, statistics::units::Count::get(), "Number of first attempts to send a request"), - ADD_STAT(numSendSucceeded, Stats::units::Count::get(), + ADD_STAT(numSendSucceeded, statistics::units::Count::get(), "Number of successful first attempts"), - ADD_STAT(numSendFailed, Stats::units::Count::get(), + ADD_STAT(numSendFailed, statistics::units::Count::get(), "Number of failed first attempts"), - ADD_STAT(numRetrySucceeded, Stats::units::Count::get(), + ADD_STAT(numRetrySucceeded, statistics::units::Count::get(), "Number of successful retries"), - ADD_STAT(numSplitReqs, Stats::units::Count::get(), + ADD_STAT(numSplitReqs, statistics::units::Count::get(), "Number of split requests"), - ADD_STAT(numSOLoads, Stats::units::Count::get(), + ADD_STAT(numSOLoads, statistics::units::Count::get(), "Number of strictly ordered loads"), - ADD_STAT(numSOStores, Stats::units::Count::get(), + ADD_STAT(numSOStores, statistics::units::Count::get(), "Number of strictly ordered stores"), - ADD_STAT(dataLastTick, Stats::units::Tick::get(), + ADD_STAT(dataLastTick, statistics::units::Tick::get(), "Last tick simulated from the elastic data trace") { } @@ -966,17 +966,17 @@ TraceCPU::ElasticDataGen::HardwareResource::printOccupancy() } TraceCPU::FixedRetryGen::FixedRetryGenStatGroup::FixedRetryGenStatGroup( - Stats::Group *parent, const std::string& _name) : - Stats::Group(parent, _name.c_str()), - ADD_STAT(numSendAttempted, Stats::units::Count::get(), + statistics::Group *parent, const std::string& _name) : + statistics::Group(parent, _name.c_str()), + ADD_STAT(numSendAttempted, statistics::units::Count::get(), "Number of first attempts to send a request"), - ADD_STAT(numSendSucceeded, Stats::units::Count::get(), + ADD_STAT(numSendSucceeded, statistics::units::Count::get(), "Number of successful first attempts"), - ADD_STAT(numSendFailed, Stats::units::Count::get(), + ADD_STAT(numSendFailed, statistics::units::Count::get(), "Number of failed first attempts"), - ADD_STAT(numRetrySucceeded, Stats::units::Count::get(), + ADD_STAT(numRetrySucceeded, statistics::units::Count::get(), "Number of successful retries"), - ADD_STAT(instLastTick, Stats::units::Tick::get(), + ADD_STAT(instLastTick, statistics::units::Tick::get(), "Last tick simulated from the fixed inst trace") { diff --git a/src/cpu/trace/trace_cpu.hh b/src/cpu/trace/trace_cpu.hh index f2c76782d6..4301a66855 100644 --- a/src/cpu/trace/trace_cpu.hh +++ b/src/cpu/trace/trace_cpu.hh @@ -506,18 +506,18 @@ class TraceCPU : public BaseCPU /** Store an element read from the trace to send as the next packet. */ TraceElement currElement; protected: - struct FixedRetryGenStatGroup : public Stats::Group + struct FixedRetryGenStatGroup : public statistics::Group { /** name is the extension to the name for these stats */ - FixedRetryGenStatGroup(Stats::Group *parent, + FixedRetryGenStatGroup(statistics::Group *parent, const std::string& _name); /** Stats for instruction accesses replayed. */ - Stats::Scalar numSendAttempted; - Stats::Scalar numSendSucceeded; - Stats::Scalar numSendFailed; - Stats::Scalar numRetrySucceeded; + statistics::Scalar numSendAttempted; + statistics::Scalar numSendSucceeded; + statistics::Scalar numSendFailed; + statistics::Scalar numRetrySucceeded; /** Last simulated tick by the FixedRetryGen */ - Stats::Scalar instLastTick; + statistics::Scalar instLastTick; } fixedStats; }; @@ -1004,23 +1004,23 @@ class TraceCPU : public BaseCPU protected: // Defining the a stat group - struct ElasticDataGenStatGroup : public Stats::Group + struct ElasticDataGenStatGroup : public statistics::Group { /** name is the extension to the name for these stats */ - ElasticDataGenStatGroup(Stats::Group *parent, + ElasticDataGenStatGroup(statistics::Group *parent, const std::string& _name); /** Stats for data memory accesses replayed. */ - Stats::Scalar maxDependents; - Stats::Scalar maxReadyListSize; - Stats::Scalar numSendAttempted; - Stats::Scalar numSendSucceeded; - Stats::Scalar numSendFailed; - Stats::Scalar numRetrySucceeded; - Stats::Scalar numSplitReqs; - Stats::Scalar numSOLoads; - Stats::Scalar numSOStores; + statistics::Scalar maxDependents; + statistics::Scalar maxReadyListSize; + statistics::Scalar numSendAttempted; + statistics::Scalar numSendSucceeded; + statistics::Scalar numSendFailed; + statistics::Scalar numRetrySucceeded; + statistics::Scalar numSplitReqs; + statistics::Scalar numSOLoads; + statistics::Scalar numSOStores; /** Tick when ElasticDataGen completes execution */ - Stats::Scalar dataLastTick; + statistics::Scalar dataLastTick; } elasticStats; }; @@ -1101,17 +1101,17 @@ class TraceCPU : public BaseCPU * message is printed. */ uint64_t progressMsgThreshold; - struct TraceStats : public Stats::Group + struct TraceStats : public statistics::Group { TraceStats(TraceCPU *trace); - Stats::Scalar numSchedDcacheEvent; - Stats::Scalar numSchedIcacheEvent; + statistics::Scalar numSchedDcacheEvent; + statistics::Scalar numSchedIcacheEvent; /** Stat for number of simulated micro-ops. */ - Stats::Scalar numOps; + statistics::Scalar numOps; /** Stat for the CPI. This is really cycles per * micro-op and not inst. */ - Stats::Formula cpi; + statistics::Formula cpi; } traceStats; public: diff --git a/src/dev/arm/flash_device.cc b/src/dev/arm/flash_device.cc index f3277d518f..5585d967fb 100644 --- a/src/dev/arm/flash_device.cc +++ b/src/dev/arm/flash_device.cc @@ -455,23 +455,22 @@ FlashDevice::getUnknownPages(uint32_t index) return unknownPages[index >> 5] & (0x01 << (index % 32)); } -FlashDevice:: -FlashDeviceStats::FlashDeviceStats(Stats::Group *parent) - : Stats::Group(parent, "FlashDevice"), - ADD_STAT(totalGCActivations, Stats::units::Count::get(), +FlashDevice::FlashDeviceStats::FlashDeviceStats(statistics::Group *parent) + : statistics::Group(parent, "FlashDevice"), + ADD_STAT(totalGCActivations, statistics::units::Count::get(), "Number of Garbage collector activations"), - ADD_STAT(writeAccess, Stats::units::Count::get(), + ADD_STAT(writeAccess, statistics::units::Count::get(), "Histogram of write addresses"), - ADD_STAT(readAccess, Stats::units::Count::get(), + ADD_STAT(readAccess, statistics::units::Count::get(), "Histogram of read addresses"), - ADD_STAT(fileSystemAccess, Stats::units::Count::get(), + ADD_STAT(fileSystemAccess, statistics::units::Count::get(), "Histogram of file system accesses"), - ADD_STAT(writeLatency, Stats::units::Tick::get(), + ADD_STAT(writeLatency, statistics::units::Tick::get(), "Histogram of write latency"), - ADD_STAT(readLatency, Stats::units::Tick::get(), + ADD_STAT(readLatency, statistics::units::Tick::get(), "Histogram of read latency") { - using namespace Stats; + using namespace statistics; /** Amount of GC activations*/ totalGCActivations diff --git a/src/dev/arm/flash_device.hh b/src/dev/arm/flash_device.hh index 7225f7491f..3e2d6765fc 100644 --- a/src/dev/arm/flash_device.hh +++ b/src/dev/arm/flash_device.hh @@ -93,21 +93,21 @@ class FlashDevice : public AbstractNVM std::function function; }; - struct FlashDeviceStats : public Stats::Group + struct FlashDeviceStats : public statistics::Group { - FlashDeviceStats(Stats::Group *parent); + FlashDeviceStats(statistics::Group *parent); /** Amount of GC activations*/ - Stats::Scalar totalGCActivations; + statistics::Scalar totalGCActivations; /** Histogram of address accesses*/ - Stats::Histogram writeAccess; - Stats::Histogram readAccess; - Stats::Histogram fileSystemAccess; + statistics::Histogram writeAccess; + statistics::Histogram readAccess; + statistics::Histogram fileSystemAccess; /** Histogram of access latencies*/ - Stats::Histogram writeLatency; - Stats::Histogram readLatency; + statistics::Histogram writeLatency; + statistics::Histogram readLatency; }; /** Device access functions Inherrited from AbstractNVM*/ diff --git a/src/dev/arm/hdlcd.cc b/src/dev/arm/hdlcd.cc index 0e541c90bd..0a68412d4e 100644 --- a/src/dev/arm/hdlcd.cc +++ b/src/dev/arm/hdlcd.cc @@ -78,13 +78,12 @@ HDLcd::HDLcd(const HDLcdParams &p) imgWriter = createImgWriter(imgFormat, &pixelPump.fb); } -HDLcd:: -HDLcdStats::HDLcdStats(Stats::Group *parent) - : Stats::Group(parent, "HDLcd"), - ADD_STAT(underruns, Stats::units::Count::get(), +HDLcd::HDLcdStats::HDLcdStats(statistics::Group *parent) + : statistics::Group(parent, "HDLcd"), + ADD_STAT(underruns, statistics::units::Count::get(), "Number of buffer underruns") { - using namespace Stats; + using namespace statistics; underruns.flags(nozero); } diff --git a/src/dev/arm/hdlcd.hh b/src/dev/arm/hdlcd.hh index 457265bd56..e9a9120157 100644 --- a/src/dev/arm/hdlcd.hh +++ b/src/dev/arm/hdlcd.hh @@ -411,10 +411,10 @@ class HDLcd: public AmbaDmaDevice std::unique_ptr dmaEngine; protected: // Statistics - struct HDLcdStats: public Stats::Group + struct HDLcdStats: public statistics::Group { - HDLcdStats(Stats::Group *parent); - Stats::Scalar underruns; + HDLcdStats(statistics::Group *parent); + statistics::Scalar underruns; } stats; }; diff --git a/src/dev/arm/smmu_v3.cc b/src/dev/arm/smmu_v3.cc index dcb938c08f..f50f376a64 100644 --- a/src/dev/arm/smmu_v3.cc +++ b/src/dev/arm/smmu_v3.cc @@ -745,18 +745,18 @@ SMMUv3::init() controlPort.sendRangeChange(); } -SMMUv3::SMMUv3Stats::SMMUv3Stats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(steL1Fetches, Stats::units::Count::get(), "STE L1 fetches"), - ADD_STAT(steFetches, Stats::units::Count::get(), "STE fetches"), - ADD_STAT(cdL1Fetches, Stats::units::Count::get(), "CD L1 fetches"), - ADD_STAT(cdFetches, Stats::units::Count::get(), "CD fetches"), - ADD_STAT(translationTimeDist, Stats::units::Tick::get(), - "Time to translate address"), - ADD_STAT(ptwTimeDist, Stats::units::Tick::get(), - "Time to walk page tables") +SMMUv3::SMMUv3Stats::SMMUv3Stats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(steL1Fetches, statistics::units::Count::get(), "STE L1 fetches"), + ADD_STAT(steFetches, statistics::units::Count::get(), "STE fetches"), + ADD_STAT(cdL1Fetches, statistics::units::Count::get(), "CD L1 fetches"), + ADD_STAT(cdFetches, statistics::units::Count::get(), "CD fetches"), + ADD_STAT(translationTimeDist, statistics::units::Tick::get(), + "Time to translate address"), + ADD_STAT(ptwTimeDist, statistics::units::Tick::get(), + "Time to walk page tables") { - using namespace Stats; + using namespace statistics; steL1Fetches .flags(pdf); diff --git a/src/dev/arm/smmu_v3.hh b/src/dev/arm/smmu_v3.hh index e20ab4dc50..ea5a717a75 100644 --- a/src/dev/arm/smmu_v3.hh +++ b/src/dev/arm/smmu_v3.hh @@ -133,15 +133,15 @@ class SMMUv3 : public ClockedObject const Cycles walkLat; // Stats - struct SMMUv3Stats : public Stats::Group + struct SMMUv3Stats : public statistics::Group { - SMMUv3Stats(Stats::Group *parent); - Stats::Scalar steL1Fetches; - Stats::Scalar steFetches; - Stats::Scalar cdL1Fetches; - Stats::Scalar cdFetches; - Stats::Distribution translationTimeDist; - Stats::Distribution ptwTimeDist; + SMMUv3Stats(statistics::Group *parent); + statistics::Scalar steL1Fetches; + statistics::Scalar steFetches; + statistics::Scalar cdL1Fetches; + statistics::Scalar cdFetches; + statistics::Distribution translationTimeDist; + statistics::Distribution ptwTimeDist; } stats; std::vector deviceInterfaces; diff --git a/src/dev/arm/smmu_v3_caches.cc b/src/dev/arm/smmu_v3_caches.cc index 43fb297f3b..fcb0125611 100644 --- a/src/dev/arm/smmu_v3_caches.cc +++ b/src/dev/arm/smmu_v3_caches.cc @@ -59,7 +59,7 @@ */ SMMUv3BaseCache::SMMUv3BaseCache(const std::string &policy_name, uint32_t seed, - Stats::Group *parent, const std::string &name) + statistics::Group *parent, const std::string &name) : replacementPolicy(decodePolicyName(policy_name)), nextToReplace(0), random(seed), @@ -83,28 +83,28 @@ SMMUv3BaseCache::decodePolicyName(const std::string &policy_name) SMMUv3BaseCache:: SMMUv3BaseCacheStats::SMMUv3BaseCacheStats( - Stats::Group *parent, const std::string &name) - : Stats::Group(parent, name.c_str()), - ADD_STAT(averageLookups, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + statistics::Group *parent, const std::string &name) + : statistics::Group(parent, name.c_str()), + ADD_STAT(averageLookups, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Average number lookups per second"), - ADD_STAT(totalLookups, Stats::units::Count::get(), + ADD_STAT(totalLookups, statistics::units::Count::get(), "Total number of lookups"), - ADD_STAT(averageMisses, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(averageMisses, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Average number misses per second"), - ADD_STAT(totalMisses, Stats::units::Count::get(), + ADD_STAT(totalMisses, statistics::units::Count::get(), "Total number of misses"), - ADD_STAT(averageUpdates, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(averageUpdates, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Average number updates per second"), - ADD_STAT(totalUpdates, Stats::units::Count::get(), + ADD_STAT(totalUpdates, statistics::units::Count::get(), "Total number of updates"), - ADD_STAT(averageHitRate, Stats::units::Ratio::get(), "Average hit rate"), - ADD_STAT(insertions, Stats::units::Count::get(), + ADD_STAT(averageHitRate, statistics::units::Ratio::get(), "Average hit rate"), + ADD_STAT(insertions, statistics::units::Count::get(), "Number of insertions (not replacements)") { - using namespace Stats; + using namespace statistics; averageLookups @@ -148,7 +148,7 @@ SMMUv3BaseCacheStats::SMMUv3BaseCacheStats( */ SMMUTLB::SMMUTLB(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent, + const std::string &policy, statistics::Group *parent, const std::string &name) : SMMUv3BaseCache(policy, SMMUTLB_SEED, parent, name), @@ -429,7 +429,7 @@ SMMUTLB::pickEntryIdxToReplace(const Set &set, AllocPolicy alloc) */ ARMArchTLB::ARMArchTLB(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent) + const std::string &policy, statistics::Group *parent) : SMMUv3BaseCache(policy, ARMARCHTLB_SEED, parent, "tlb"), associativity(_associativity) @@ -628,7 +628,7 @@ ARMArchTLB::pickEntryIdxToReplace(const Set &set) */ IPACache::IPACache(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent) + const std::string &policy, statistics::Group *parent) : SMMUv3BaseCache(policy, IPACACHE_SEED, parent, "ipa"), associativity(_associativity) @@ -808,7 +808,7 @@ IPACache::pickEntryIdxToReplace(const Set &set) */ ConfigCache::ConfigCache(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent) + const std::string &policy, statistics::Group *parent) : SMMUv3BaseCache(policy, CONFIGCACHE_SEED, parent, "cfg"), associativity(_associativity) @@ -973,7 +973,7 @@ ConfigCache::pickEntryIdxToReplace(const Set &set) WalkCache::WalkCache(const std::array &_sizes, unsigned _associativity, const std::string &policy, - Stats::Group *parent) : + statistics::Group *parent) : SMMUv3BaseCache(policy, WALKCACHE_SEED, parent, "walk"), walkCacheStats(&(SMMUv3BaseCache::baseCacheStats)), associativity(_associativity), @@ -1226,19 +1226,18 @@ WalkCache::pickEntryIdxToReplace(const Set &set, } -WalkCache:: -WalkCacheStats::WalkCacheStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(totalLookupsByStageLevel, Stats::units::Count::get(), +WalkCache::WalkCacheStats::WalkCacheStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(totalLookupsByStageLevel, statistics::units::Count::get(), "Total number of lookups"), - ADD_STAT(totalMissesByStageLevel, Stats::units::Count::get(), + ADD_STAT(totalMissesByStageLevel, statistics::units::Count::get(), "Total number of misses"), - ADD_STAT(totalUpdatesByStageLevel, Stats::units::Count::get(), + ADD_STAT(totalUpdatesByStageLevel, statistics::units::Count::get(), "Total number of updates"), - ADD_STAT(insertionsByStageLevel, Stats::units::Count::get(), + ADD_STAT(insertionsByStageLevel, statistics::units::Count::get(), "Number of insertions (not replacements)") { - using namespace Stats; + using namespace statistics; totalLookupsByStageLevel .init(2, WALK_CACHE_LEVELS) @@ -1265,11 +1264,11 @@ WalkCacheStats::WalkCacheStats(Stats::Group *parent) totalUpdatesByStageLevel.ysubname(l, csprintf("L%d", l)); insertionsByStageLevel.ysubname(l, csprintf("L%d", l)); - auto avg_lookup = new Stats::Formula( + auto avg_lookup = new statistics::Formula( this, csprintf("averageLookups_S%dL%d", s+1, l).c_str(), - Stats::units::Rate::get(), + statistics::units::Rate::get(), "Average number lookups per second"); avg_lookup->flags(pdf); averageLookupsByStageLevel.push_back(avg_lookup); @@ -1277,11 +1276,11 @@ WalkCacheStats::WalkCacheStats(Stats::Group *parent) *avg_lookup = totalLookupsByStageLevel[s][l] / simSeconds; - auto avg_misses = new Stats::Formula( + auto avg_misses = new statistics::Formula( this, csprintf("averageMisses_S%dL%d", s+1, l).c_str(), - Stats::units::Rate::get(), + statistics::units::Rate::get(), "Average number misses per second"); avg_misses->flags(pdf); averageMissesByStageLevel.push_back(avg_misses); @@ -1289,11 +1288,11 @@ WalkCacheStats::WalkCacheStats(Stats::Group *parent) *avg_misses = totalMissesByStageLevel[s][l] / simSeconds; - auto avg_updates = new Stats::Formula( + auto avg_updates = new statistics::Formula( this, csprintf("averageUpdates_S%dL%d", s+1, l).c_str(), - Stats::units::Rate::get(), + statistics::units::Rate::get(), "Average number updates per second"); avg_updates->flags(pdf); averageUpdatesByStageLevel.push_back(avg_updates); @@ -1301,10 +1300,10 @@ WalkCacheStats::WalkCacheStats(Stats::Group *parent) *avg_updates = totalUpdatesByStageLevel[s][l] / simSeconds; - auto avg_hitrate = new Stats::Formula( + auto avg_hitrate = new statistics::Formula( this, csprintf("averageHitRate_S%dL%d", s+1, l).c_str(), - Stats::units::Ratio::get(), "Average hit rate"); + statistics::units::Ratio::get(), "Average hit rate"); avg_hitrate->flags(pdf); averageHitRateByStageLevel.push_back(avg_hitrate); @@ -1317,8 +1316,7 @@ WalkCacheStats::WalkCacheStats(Stats::Group *parent) } } -WalkCache:: -WalkCacheStats::~WalkCacheStats() +WalkCache::WalkCacheStats::~WalkCacheStats() { for (auto avg_lookup : averageLookupsByStageLevel) delete avg_lookup; diff --git a/src/dev/arm/smmu_v3_caches.hh b/src/dev/arm/smmu_v3_caches.hh index b96e9e1b47..007664ddec 100644 --- a/src/dev/arm/smmu_v3_caches.hh +++ b/src/dev/arm/smmu_v3_caches.hh @@ -66,29 +66,30 @@ class SMMUv3BaseCache Random random; uint32_t useStamp; - struct SMMUv3BaseCacheStats : public Stats::Group + struct SMMUv3BaseCacheStats : public statistics::Group { - SMMUv3BaseCacheStats(Stats::Group *parent, const std::string &name); + SMMUv3BaseCacheStats(statistics::Group *parent, + const std::string &name); - Stats::Formula averageLookups; - Stats::Scalar totalLookups; + statistics::Formula averageLookups; + statistics::Scalar totalLookups; - Stats::Formula averageMisses; - Stats::Scalar totalMisses; + statistics::Formula averageMisses; + statistics::Scalar totalMisses; - Stats::Formula averageUpdates; - Stats::Scalar totalUpdates; + statistics::Formula averageUpdates; + statistics::Scalar totalUpdates; - Stats::Formula averageHitRate; + statistics::Formula averageHitRate; - Stats::Scalar insertions; + statistics::Scalar insertions; } baseCacheStats; static int decodePolicyName(const std::string &policy_name); public: SMMUv3BaseCache(const std::string &policy_name, uint32_t seed, - Stats::Group *parent, const std::string &name); + statistics::Group *parent, const std::string &name); virtual ~SMMUv3BaseCache() {} }; @@ -124,7 +125,7 @@ class SMMUTLB : public SMMUv3BaseCache }; SMMUTLB(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent, + const std::string &policy, statistics::Group *parent, const std::string &name); SMMUTLB(const SMMUTLB& tlb) = delete; virtual ~SMMUTLB() {} @@ -174,7 +175,7 @@ class ARMArchTLB : public SMMUv3BaseCache }; ARMArchTLB(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent); + const std::string &policy, statistics::Group *parent); virtual ~ARMArchTLB() {} const Entry *lookup(Addr va, uint16_t asid, uint16_t vmid, @@ -217,7 +218,7 @@ class IPACache : public SMMUv3BaseCache }; IPACache(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent); + const std::string &policy, statistics::Group *parent); virtual ~IPACache() {} const Entry *lookup(Addr ipa, uint16_t vmid, bool updStats=true); @@ -265,7 +266,7 @@ class ConfigCache : public SMMUv3BaseCache }; ConfigCache(unsigned numEntries, unsigned _associativity, - const std::string &policy, Stats::Group *parent); + const std::string &policy, statistics::Group *parent); virtual ~ConfigCache() {} const Entry *lookup(uint32_t sid, uint32_t ssid, bool updStats=true); @@ -309,7 +310,7 @@ class WalkCache : public SMMUv3BaseCache WalkCache(const std::array &_sizes, unsigned _associativity, const std::string &policy, - Stats::Group *parent); + statistics::Group *parent); virtual ~WalkCache() {} const Entry *lookup(Addr va, Addr vaMask, uint16_t asid, uint16_t vmid, @@ -324,23 +325,23 @@ class WalkCache : public SMMUv3BaseCache void invalidateAll(); protected: - struct WalkCacheStats : public Stats::Group + struct WalkCacheStats : public statistics::Group { - WalkCacheStats(Stats::Group *parent); + WalkCacheStats(statistics::Group *parent); ~WalkCacheStats(); - std::vector averageLookupsByStageLevel; - Stats::Vector2d totalLookupsByStageLevel; + std::vector averageLookupsByStageLevel; + statistics::Vector2d totalLookupsByStageLevel; - std::vector averageMissesByStageLevel; - Stats::Vector2d totalMissesByStageLevel; + std::vector averageMissesByStageLevel; + statistics::Vector2d totalMissesByStageLevel; - std::vector averageUpdatesByStageLevel; - Stats::Vector2d totalUpdatesByStageLevel; + std::vector averageUpdatesByStageLevel; + statistics::Vector2d totalUpdatesByStageLevel; - std::vector averageHitRateByStageLevel; + std::vector averageHitRateByStageLevel; - Stats::Vector2d insertionsByStageLevel; + statistics::Vector2d insertionsByStageLevel; } walkCacheStats; private: typedef std::vector Set; diff --git a/src/dev/arm/ufs_device.cc b/src/dev/arm/ufs_device.cc index c35b0a305d..3ad9f9373d 100644 --- a/src/dev/arm/ufs_device.cc +++ b/src/dev/arm/ufs_device.cc @@ -755,59 +755,59 @@ UFSHostDevice::UFSHostDevice(const UFSHostDeviceParams &p) : UFSHostDevice:: UFSHostDeviceStats::UFSHostDeviceStats(UFSHostDevice *parent) - : Stats::Group(parent, "UFSDiskHost"), - ADD_STAT(currentSCSIQueue, Stats::units::Count::get(), + : statistics::Group(parent, "UFSDiskHost"), + ADD_STAT(currentSCSIQueue, statistics::units::Count::get(), "Most up to date length of the command queue"), - ADD_STAT(currentReadSSDQueue, Stats::units::Count::get(), + ADD_STAT(currentReadSSDQueue, statistics::units::Count::get(), "Most up to date length of the read SSD queue"), - ADD_STAT(currentWriteSSDQueue, Stats::units::Count::get(), + ADD_STAT(currentWriteSSDQueue, statistics::units::Count::get(), "Most up to date length of the write SSD queue"), /** Amount of data read/written */ - ADD_STAT(totalReadSSD, Stats::units::Byte::get(), + ADD_STAT(totalReadSSD, statistics::units::Byte::get(), "Number of bytes read from SSD"), - ADD_STAT(totalWrittenSSD, Stats::units::Byte::get(), + ADD_STAT(totalWrittenSSD, statistics::units::Byte::get(), "Number of bytes written to SSD"), - ADD_STAT(totalReadDiskTransactions, Stats::units::Count::get(), + ADD_STAT(totalReadDiskTransactions, statistics::units::Count::get(), "Number of transactions from disk"), - ADD_STAT(totalWriteDiskTransactions, Stats::units::Count::get(), + ADD_STAT(totalWriteDiskTransactions, statistics::units::Count::get(), "Number of transactions to disk"), - ADD_STAT(totalReadUFSTransactions, Stats::units::Count::get(), + ADD_STAT(totalReadUFSTransactions, statistics::units::Count::get(), "Number of transactions from device"), - ADD_STAT(totalWriteUFSTransactions, Stats::units::Count::get(), + ADD_STAT(totalWriteUFSTransactions, statistics::units::Count::get(), "Number of transactions to device"), /** Average bandwidth for reads and writes */ - ADD_STAT(averageReadSSDBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(averageReadSSDBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average read bandwidth", totalReadSSD / simSeconds), - ADD_STAT(averageWriteSSDBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(averageWriteSSDBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average write bandwidth", totalWrittenSSD / simSeconds), - ADD_STAT(averageSCSIQueue, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(averageSCSIQueue, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average command queue length"), - ADD_STAT(averageReadSSDQueue, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(averageReadSSDQueue, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average read queue length"), - ADD_STAT(averageWriteSSDQueue, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(averageWriteSSDQueue, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average write queue length"), /** Number of doorbells rung*/ - ADD_STAT(curDoorbell, Stats::units::Count::get(), + ADD_STAT(curDoorbell, statistics::units::Count::get(), "Most up to date number of doorbells used", parent->activeDoorbells), - ADD_STAT(maxDoorbell, Stats::units::Count::get(), + ADD_STAT(maxDoorbell, statistics::units::Count::get(), "Maximum number of doorbells utilized"), - ADD_STAT(averageDoorbell, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(averageDoorbell, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average number of Doorbells used"), /** Latency*/ - ADD_STAT(transactionLatency, Stats::units::Tick::get(), + ADD_STAT(transactionLatency, statistics::units::Tick::get(), "Histogram of transaction times"), - ADD_STAT(idleTimes, Stats::units::Tick::get(), "Histogram of idle times") + ADD_STAT(idleTimes, statistics::units::Tick::get(), "Histogram of idle times") { - using namespace Stats; + using namespace statistics; // Register the stats /** Queue lengths */ diff --git a/src/dev/arm/ufs_device.hh b/src/dev/arm/ufs_device.hh index d46a40b443..6da9dd9654 100644 --- a/src/dev/arm/ufs_device.hh +++ b/src/dev/arm/ufs_device.hh @@ -512,40 +512,40 @@ class UFSHostDevice : public DmaDevice /** * Statistics */ - struct UFSHostDeviceStats : public Stats::Group + struct UFSHostDeviceStats : public statistics::Group { UFSHostDeviceStats(UFSHostDevice *parent); /** Queue lengths */ - Stats::Scalar currentSCSIQueue; - Stats::Scalar currentReadSSDQueue; - Stats::Scalar currentWriteSSDQueue; + statistics::Scalar currentSCSIQueue; + statistics::Scalar currentReadSSDQueue; + statistics::Scalar currentWriteSSDQueue; /** Amount of data read/written */ - Stats::Scalar totalReadSSD; - Stats::Scalar totalWrittenSSD; - Stats::Scalar totalReadDiskTransactions; - Stats::Scalar totalWriteDiskTransactions; - Stats::Scalar totalReadUFSTransactions; - Stats::Scalar totalWriteUFSTransactions; + statistics::Scalar totalReadSSD; + statistics::Scalar totalWrittenSSD; + statistics::Scalar totalReadDiskTransactions; + statistics::Scalar totalWriteDiskTransactions; + statistics::Scalar totalReadUFSTransactions; + statistics::Scalar totalWriteUFSTransactions; /** Average bandwidth for reads and writes */ - Stats::Formula averageReadSSDBW; - Stats::Formula averageWriteSSDBW; + statistics::Formula averageReadSSDBW; + statistics::Formula averageWriteSSDBW; /** Average Queue lengths*/ - Stats::Average averageSCSIQueue; - Stats::Average averageReadSSDQueue; - Stats::Average averageWriteSSDQueue; + statistics::Average averageSCSIQueue; + statistics::Average averageReadSSDQueue; + statistics::Average averageWriteSSDQueue; /** Number of doorbells rung*/ - Stats::Formula curDoorbell; - Stats::Scalar maxDoorbell; - Stats::Average averageDoorbell; + statistics::Formula curDoorbell; + statistics::Scalar maxDoorbell; + statistics::Average averageDoorbell; /** Histogram of latencies*/ - Stats::Histogram transactionLatency; - Stats::Histogram idleTimes; + statistics::Histogram transactionLatency; + statistics::Histogram idleTimes; }; /** diff --git a/src/dev/net/etherdevice.cc b/src/dev/net/etherdevice.cc index c99f08d651..04d0ca25c1 100644 --- a/src/dev/net/etherdevice.cc +++ b/src/dev/net/etherdevice.cc @@ -30,133 +30,133 @@ #include "sim/stats.hh" -EtherDevice::EtherDeviceStats::EtherDeviceStats(Stats::Group *parent) - : Stats::Group(parent, "EtherDevice"), - ADD_STAT(postedInterrupts, Stats::units::Count::get(), +EtherDevice::EtherDeviceStats::EtherDeviceStats(statistics::Group *parent) + : statistics::Group(parent, "EtherDevice"), + ADD_STAT(postedInterrupts, statistics::units::Count::get(), "Number of posts to CPU"), - ADD_STAT(txBytes, Stats::units::Byte::get(), + ADD_STAT(txBytes, statistics::units::Byte::get(), "Bytes Transmitted"), - ADD_STAT(rxBytes, Stats::units::Byte::get(), "Bytes Received"), - ADD_STAT(txPackets, Stats::units::Count::get(), + ADD_STAT(rxBytes, statistics::units::Byte::get(), "Bytes Received"), + ADD_STAT(txPackets, statistics::units::Count::get(), "Number of Packets Transmitted"), - ADD_STAT(rxPackets, Stats::units::Count::get(), + ADD_STAT(rxPackets, statistics::units::Count::get(), "Number of Packets Received"), - ADD_STAT(txBandwidth, Stats::units::Rate< - Stats::units::Bit, Stats::units::Second>::get(), + ADD_STAT(txBandwidth, statistics::units::Rate< + statistics::units::Bit, statistics::units::Second>::get(), "Transmit Bandwidth", - txBytes * Stats::constant(8) / simSeconds), - ADD_STAT(rxBandwidth, Stats::units::Rate< - Stats::units::Bit, Stats::units::Second>::get(), + txBytes * statistics::constant(8) / simSeconds), + ADD_STAT(rxBandwidth, statistics::units::Rate< + statistics::units::Bit, statistics::units::Second>::get(), "Receive Bandwidth", - rxBytes * Stats::constant(8) / simSeconds), - ADD_STAT(txIpChecksums, Stats::units::Count::get(), + rxBytes * statistics::constant(8) / simSeconds), + ADD_STAT(txIpChecksums, statistics::units::Count::get(), "Number of tx IP Checksums done by device"), - ADD_STAT(rxIpChecksums, Stats::units::Count::get(), + ADD_STAT(rxIpChecksums, statistics::units::Count::get(), "Number of rx IP Checksums done by device"), - ADD_STAT(txTcpChecksums, Stats::units::Count::get(), + ADD_STAT(txTcpChecksums, statistics::units::Count::get(), "Number of tx TCP Checksums done by device"), - ADD_STAT(rxTcpChecksums, Stats::units::Count::get(), + ADD_STAT(rxTcpChecksums, statistics::units::Count::get(), "Number of rx TCP Checksums done by device"), - ADD_STAT(txUdpChecksums, Stats::units::Count::get(), + ADD_STAT(txUdpChecksums, statistics::units::Count::get(), "Number of tx UDP Checksums done by device"), - ADD_STAT(rxUdpChecksums, Stats::units::Count::get(), + ADD_STAT(rxUdpChecksums, statistics::units::Count::get(), "Number of rx UDP Checksums done by device"), - ADD_STAT(descDmaReads, Stats::units::Count::get(), + ADD_STAT(descDmaReads, statistics::units::Count::get(), "Number of descriptors the device read w/ DMA"), - ADD_STAT(descDmaWrites, Stats::units::Count::get(), + ADD_STAT(descDmaWrites, statistics::units::Count::get(), "Number of descriptors the device wrote w/ DMA"), - ADD_STAT(descDmaRdBytes, Stats::units::Count::get(), + ADD_STAT(descDmaRdBytes, statistics::units::Count::get(), "Number of descriptor bytes read w/ DMA"), - ADD_STAT(descDmaWrBytes, Stats::units::Count::get(), + ADD_STAT(descDmaWrBytes, statistics::units::Count::get(), "Number of descriptor bytes write w/ DMA"), - ADD_STAT(totBandwidth, Stats::units::Rate< - Stats::units::Bit, Stats::units::Second>::get(), + ADD_STAT(totBandwidth, statistics::units::Rate< + statistics::units::Bit, statistics::units::Second>::get(), "Total Bandwidth", txBandwidth + rxBandwidth), - ADD_STAT(totPackets, Stats::units::Count::get(), "Total Packets", + ADD_STAT(totPackets, statistics::units::Count::get(), "Total Packets", txPackets + rxPackets), - ADD_STAT(totBytes, Stats::units::Byte::get(), "Total Bytes", + ADD_STAT(totBytes, statistics::units::Byte::get(), "Total Bytes", txBytes + rxBytes), - ADD_STAT(totPacketRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(totPacketRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Total Packet Tranmission Rate", totPackets / simSeconds), - ADD_STAT(txPacketRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(txPacketRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Packet Tranmission Rate", txPackets / simSeconds), - ADD_STAT(rxPacketRate, Stats::units::Rate< - Stats::units::Count, Stats::units::Second>::get(), + ADD_STAT(rxPacketRate, statistics::units::Rate< + statistics::units::Count, statistics::units::Second>::get(), "Packet Reception Rate", rxPackets / simSeconds), - ADD_STAT(postedSwi, Stats::units::Count::get(), + ADD_STAT(postedSwi, statistics::units::Count::get(), "Number of software interrupts posted to CPU"), - ADD_STAT(totalSwi, Stats::units::Count::get(), + ADD_STAT(totalSwi, statistics::units::Count::get(), "Total number of Swi written to ISR"), - ADD_STAT(coalescedSwi, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedSwi, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of Swi's coalesced into each post", totalSwi / postedInterrupts), - ADD_STAT(postedRxIdle, Stats::units::Count::get(), + ADD_STAT(postedRxIdle, statistics::units::Count::get(), "Number of rxIdle interrupts posted to CPU"), - ADD_STAT(totalRxIdle, Stats::units::Count::get(), + ADD_STAT(totalRxIdle, statistics::units::Count::get(), "Total number of RxIdle written to ISR"), - ADD_STAT(coalescedRxIdle, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedRxIdle, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of RxIdle's coalesced into each post", totalRxIdle / postedInterrupts), - ADD_STAT(postedRxOk, Stats::units::Count::get(), + ADD_STAT(postedRxOk, statistics::units::Count::get(), "Number of RxOk interrupts posted to CPU"), - ADD_STAT(totalRxOk, Stats::units::Count::get(), + ADD_STAT(totalRxOk, statistics::units::Count::get(), "Total number of RxOk written to ISR"), - ADD_STAT(coalescedRxOk, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedRxOk, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of RxOk's coalesced into each post", totalRxOk / postedInterrupts), - ADD_STAT(postedRxDesc, Stats::units::Count::get(), + ADD_STAT(postedRxDesc, statistics::units::Count::get(), "Number of RxDesc interrupts posted to CPU"), - ADD_STAT(totalRxDesc, Stats::units::Count::get(), + ADD_STAT(totalRxDesc, statistics::units::Count::get(), "Total number of RxDesc written to ISR"), - ADD_STAT(coalescedRxDesc, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedRxDesc, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of RxDesc's coalesced into each post", totalRxDesc / postedInterrupts), - ADD_STAT(postedTxOk, Stats::units::Count::get(), + ADD_STAT(postedTxOk, statistics::units::Count::get(), "Number of TxOk interrupts posted to CPU"), - ADD_STAT(totalTxOk, Stats::units::Count::get(), + ADD_STAT(totalTxOk, statistics::units::Count::get(), "Total number of TxOk written to ISR"), - ADD_STAT(coalescedTxOk, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedTxOk, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of TxOk's coalesced into each post", totalTxOk / postedInterrupts), - ADD_STAT(postedTxIdle, Stats::units::Count::get(), + ADD_STAT(postedTxIdle, statistics::units::Count::get(), "Number of TxIdle interrupts posted to CPU"), - ADD_STAT(totalTxIdle, Stats::units::Count::get(), + ADD_STAT(totalTxIdle, statistics::units::Count::get(), "Total number of TxIdle written to ISR"), - ADD_STAT(coalescedTxIdle, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedTxIdle, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of TxIdle's coalesced into each post", totalTxIdle / postedInterrupts), - ADD_STAT(postedTxDesc, Stats::units::Count::get(), + ADD_STAT(postedTxDesc, statistics::units::Count::get(), "Number of TxDesc interrupts posted to CPU"), - ADD_STAT(totalTxDesc, Stats::units::Count::get(), + ADD_STAT(totalTxDesc, statistics::units::Count::get(), "Total number of TxDesc written to ISR"), - ADD_STAT(coalescedTxDesc, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedTxDesc, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of TxDesc's coalesced into each post", totalTxDesc / postedInterrupts), - ADD_STAT(postedRxOrn, Stats::units::Count::get(), + ADD_STAT(postedRxOrn, statistics::units::Count::get(), "Number of RxOrn posted to CPU"), - ADD_STAT(totalRxOrn, Stats::units::Count::get(), + ADD_STAT(totalRxOrn, statistics::units::Count::get(), "Total number of RxOrn written to ISR"), - ADD_STAT(coalescedRxOrn, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedRxOrn, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of RxOrn's coalesced into each post", totalRxOrn / postedInterrupts), - ADD_STAT(coalescedTotal, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(coalescedTotal, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of interrupts coalesced into each post"), - ADD_STAT(droppedPackets, Stats::units::Count::get(), + ADD_STAT(droppedPackets, statistics::units::Count::get(), "Number of packets dropped") { diff --git a/src/dev/net/etherdevice.hh b/src/dev/net/etherdevice.hh index 2126afb022..a5e10099b7 100644 --- a/src/dev/net/etherdevice.hh +++ b/src/dev/net/etherdevice.hh @@ -52,78 +52,78 @@ class EtherDevice : public PciDevice {} protected: - struct EtherDeviceStats : public Stats::Group + struct EtherDeviceStats : public statistics::Group { - EtherDeviceStats(Stats::Group *parent); + EtherDeviceStats(statistics::Group *parent); - Stats::Scalar postedInterrupts; + statistics::Scalar postedInterrupts; - Stats::Scalar txBytes; - Stats::Scalar rxBytes; + statistics::Scalar txBytes; + statistics::Scalar rxBytes; - Stats::Scalar txPackets; - Stats::Scalar rxPackets; + statistics::Scalar txPackets; + statistics::Scalar rxPackets; - Stats::Formula txBandwidth; - Stats::Formula rxBandwidth; + statistics::Formula txBandwidth; + statistics::Formula rxBandwidth; - Stats::Scalar txIpChecksums; - Stats::Scalar rxIpChecksums; + statistics::Scalar txIpChecksums; + statistics::Scalar rxIpChecksums; - Stats::Scalar txTcpChecksums; - Stats::Scalar rxTcpChecksums; + statistics::Scalar txTcpChecksums; + statistics::Scalar rxTcpChecksums; - Stats::Scalar txUdpChecksums; - Stats::Scalar rxUdpChecksums; + statistics::Scalar txUdpChecksums; + statistics::Scalar rxUdpChecksums; - Stats::Scalar descDmaReads; - Stats::Scalar descDmaWrites; + statistics::Scalar descDmaReads; + statistics::Scalar descDmaWrites; - Stats::Scalar descDmaRdBytes; - Stats::Scalar descDmaWrBytes; + statistics::Scalar descDmaRdBytes; + statistics::Scalar descDmaWrBytes; - Stats::Formula totBandwidth; - Stats::Formula totPackets; - Stats::Formula totBytes; - Stats::Formula totPacketRate; + statistics::Formula totBandwidth; + statistics::Formula totPackets; + statistics::Formula totBytes; + statistics::Formula totPacketRate; - Stats::Formula txPacketRate; - Stats::Formula rxPacketRate; + statistics::Formula txPacketRate; + statistics::Formula rxPacketRate; - Stats::Scalar postedSwi; - Stats::Scalar totalSwi; - Stats::Formula coalescedSwi; + statistics::Scalar postedSwi; + statistics::Scalar totalSwi; + statistics::Formula coalescedSwi; - Stats::Scalar postedRxIdle; - Stats::Scalar totalRxIdle; - Stats::Formula coalescedRxIdle; + statistics::Scalar postedRxIdle; + statistics::Scalar totalRxIdle; + statistics::Formula coalescedRxIdle; - Stats::Scalar postedRxOk; - Stats::Scalar totalRxOk; - Stats::Formula coalescedRxOk; + statistics::Scalar postedRxOk; + statistics::Scalar totalRxOk; + statistics::Formula coalescedRxOk; - Stats::Scalar postedRxDesc; - Stats::Scalar totalRxDesc; - Stats::Formula coalescedRxDesc; + statistics::Scalar postedRxDesc; + statistics::Scalar totalRxDesc; + statistics::Formula coalescedRxDesc; - Stats::Scalar postedTxOk; - Stats::Scalar totalTxOk; - Stats::Formula coalescedTxOk; + statistics::Scalar postedTxOk; + statistics::Scalar totalTxOk; + statistics::Formula coalescedTxOk; - Stats::Scalar postedTxIdle; - Stats::Scalar totalTxIdle; - Stats::Formula coalescedTxIdle; + statistics::Scalar postedTxIdle; + statistics::Scalar totalTxIdle; + statistics::Formula coalescedTxIdle; - Stats::Scalar postedTxDesc; - Stats::Scalar totalTxDesc; - Stats::Formula coalescedTxDesc; + statistics::Scalar postedTxDesc; + statistics::Scalar totalTxDesc; + statistics::Formula coalescedTxDesc; - Stats::Scalar postedRxOrn; - Stats::Scalar totalRxOrn; - Stats::Formula coalescedRxOrn; + statistics::Scalar postedRxOrn; + statistics::Scalar totalRxOrn; + statistics::Formula coalescedRxOrn; - Stats::Formula coalescedTotal; - Stats::Scalar droppedPackets; + statistics::Formula coalescedTotal; + statistics::Scalar droppedPackets; } etherDeviceStats; }; diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc index 8491674a31..13d9eaf441 100644 --- a/src/dev/net/sinic.cc +++ b/src/dev/net/sinic.cc @@ -98,16 +98,16 @@ Device::Device(const Params &p) Device::~Device() {} -Device::DeviceStats::DeviceStats(Stats::Group *parent) - : Stats::Group(parent, "SinicDevice"), - ADD_STAT(totalVnicDistance, Stats::units::Count::get(), +Device::DeviceStats::DeviceStats(statistics::Group *parent) + : statistics::Group(parent, "SinicDevice"), + ADD_STAT(totalVnicDistance, statistics::units::Count::get(), "Total vnic distance"), - ADD_STAT(numVnicDistance, Stats::units::Count::get(), + ADD_STAT(numVnicDistance, statistics::units::Count::get(), "Number of vnic distance measurements"), - ADD_STAT(maxVnicDistance, Stats::units::Count::get(), + ADD_STAT(maxVnicDistance, statistics::units::Count::get(), "Maximum vnic distance"), - ADD_STAT(avgVnicDistance, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(avgVnicDistance, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average vnic distance", totalVnicDistance / numVnicDistance), _maxVnicDistance(0) { diff --git a/src/dev/net/sinic.hh b/src/dev/net/sinic.hh index 1395913a8a..5e35d93a12 100644 --- a/src/dev/net/sinic.hh +++ b/src/dev/net/sinic.hh @@ -277,14 +277,14 @@ class Device : public Base * Statistics */ private: - struct DeviceStats : public Stats::Group + struct DeviceStats : public statistics::Group { - DeviceStats(Stats::Group *parent); + DeviceStats(statistics::Group *parent); - Stats::Scalar totalVnicDistance; - Stats::Scalar numVnicDistance; - Stats::Scalar maxVnicDistance; - Stats::Formula avgVnicDistance; + statistics::Scalar totalVnicDistance; + statistics::Scalar numVnicDistance; + statistics::Scalar maxVnicDistance; + statistics::Formula avgVnicDistance; int _maxVnicDistance; } sinicDeviceStats; diff --git a/src/dev/pci/copy_engine.cc b/src/dev/pci/copy_engine.cc index d5c3cbdd38..4189cc14e8 100644 --- a/src/dev/pci/copy_engine.cc +++ b/src/dev/pci/copy_engine.cc @@ -428,21 +428,21 @@ CopyEngine::CopyEngineChannel::channelWrite(Packet *pkt, Addr daddr, int size) } CopyEngine:: -CopyEngineStats::CopyEngineStats(Stats::Group *parent, +CopyEngineStats::CopyEngineStats(statistics::Group *parent, const uint8_t &channel_count) - : Stats::Group(parent, "CopyEngine"), - ADD_STAT(bytesCopied, Stats::units::Byte::get(), + : statistics::Group(parent, "CopyEngine"), + ADD_STAT(bytesCopied, statistics::units::Byte::get(), "Number of bytes copied by each engine"), - ADD_STAT(copiesProcessed, Stats::units::Count::get(), + ADD_STAT(copiesProcessed, statistics::units::Count::get(), "Number of copies processed by each engine") { bytesCopied .init(channel_count) - .flags(Stats::total) + .flags(statistics::total) ; copiesProcessed .init(channel_count) - .flags(Stats::total) + .flags(statistics::total) ; } diff --git a/src/dev/pci/copy_engine.hh b/src/dev/pci/copy_engine.hh index 59f6e3926e..c55baf681a 100644 --- a/src/dev/pci/copy_engine.hh +++ b/src/dev/pci/copy_engine.hh @@ -95,7 +95,13 @@ class CopyEngine : public PciDevice virtual ~CopyEngineChannel(); Port &getPort(); - std::string name() { assert(ce); return ce->name() + csprintf("-chan%d", channelId); } + std::string + name() + { + assert(ce); + return ce->name() + csprintf("-chan%d", channelId); + } + virtual Tick read(PacketPtr pkt) { panic("CopyEngineChannel has no I/O access\n");} virtual Tick write(PacketPtr pkt) @@ -140,12 +146,13 @@ class CopyEngine : public PciDevice private: - struct CopyEngineStats : public Stats::Group + struct CopyEngineStats : public statistics::Group { - CopyEngineStats(Stats::Group *parent, const uint8_t& channel_count); + CopyEngineStats(statistics::Group *parent, + const uint8_t& channel_count); - Stats::Vector bytesCopied; - Stats::Vector copiesProcessed; + statistics::Vector bytesCopied; + statistics::Vector copiesProcessed; } copyEngineStats; // device registers diff --git a/src/dev/storage/ide_disk.cc b/src/dev/storage/ide_disk.cc index 1b6476cd62..5cedbe50ce 100644 --- a/src/dev/storage/ide_disk.cc +++ b/src/dev/storage/ide_disk.cc @@ -389,19 +389,19 @@ IdeDisk::doDmaDataRead() } IdeDisk:: -IdeDiskStats::IdeDiskStats(Stats::Group *parent) - : Stats::Group(parent, "IdeDisk"), - ADD_STAT(dmaReadFullPages, Stats::units::Count::get(), +IdeDiskStats::IdeDiskStats(statistics::Group *parent) + : statistics::Group(parent, "IdeDisk"), + ADD_STAT(dmaReadFullPages, statistics::units::Count::get(), "Number of full page size DMA reads (not PRD)."), - ADD_STAT(dmaReadBytes, Stats::units::Byte::get(), + ADD_STAT(dmaReadBytes, statistics::units::Byte::get(), "Number of bytes transfered via DMA reads (not PRD)."), - ADD_STAT(dmaReadTxs, Stats::units::Count::get(), + ADD_STAT(dmaReadTxs, statistics::units::Count::get(), "Number of DMA read transactions (not PRD)."), - ADD_STAT(dmaWriteFullPages, Stats::units::Count::get(), + ADD_STAT(dmaWriteFullPages, statistics::units::Count::get(), "Number of full page size DMA writes."), - ADD_STAT(dmaWriteBytes, Stats::units::Byte::get(), + ADD_STAT(dmaWriteBytes, statistics::units::Byte::get(), "Number of bytes transfered via DMA writes."), - ADD_STAT(dmaWriteTxs, Stats::units::Count::get(), + ADD_STAT(dmaWriteTxs, statistics::units::Count::get(), "Number of DMA write transactions.") { } diff --git a/src/dev/storage/ide_disk.hh b/src/dev/storage/ide_disk.hh index 4ece54eeb3..ee94d66755 100644 --- a/src/dev/storage/ide_disk.hh +++ b/src/dev/storage/ide_disk.hh @@ -260,16 +260,16 @@ class IdeDisk : public SimObject /** DMA Aborted */ bool dmaAborted; - struct IdeDiskStats : public Stats::Group + struct IdeDiskStats : public statistics::Group { - IdeDiskStats(Stats::Group *parent); + IdeDiskStats(statistics::Group *parent); - Stats::Scalar dmaReadFullPages; - Stats::Scalar dmaReadBytes; - Stats::Scalar dmaReadTxs; - Stats::Scalar dmaWriteFullPages; - Stats::Scalar dmaWriteBytes; - Stats::Scalar dmaWriteTxs; + statistics::Scalar dmaReadFullPages; + statistics::Scalar dmaReadBytes; + statistics::Scalar dmaReadTxs; + statistics::Scalar dmaWriteFullPages; + statistics::Scalar dmaWriteBytes; + statistics::Scalar dmaWriteTxs; } ideDiskStats; public: diff --git a/src/gpu-compute/compute_unit.cc b/src/gpu-compute/compute_unit.cc index d48917d769..d6fa2b4d34 100644 --- a/src/gpu-compute/compute_unit.cc +++ b/src/gpu-compute/compute_unit.cc @@ -2104,8 +2104,9 @@ ComputeUnit::LDSPort::recvReqRetry() } } -ComputeUnit::ComputeUnitStats::ComputeUnitStats(Stats::Group *parent, int n_wf) - : Stats::Group(parent), +ComputeUnit::ComputeUnitStats::ComputeUnitStats(statistics::Group *parent, + int n_wf) + : statistics::Group(parent), ADD_STAT(vALUInsts, "Number of vector ALU insts issued."), ADD_STAT(vALUInstsPerWF, "The avg. number of vector ALU insts issued " "per-wavefront."), @@ -2290,7 +2291,8 @@ ComputeUnit::ComputeUnitStats::ComputeUnitStats(Stats::Group *parent, int n_wf) activeLanesPerGMemInstrDist.init(1, cu->wfSize(), 4); activeLanesPerLMemInstrDist.init(1, cu->wfSize(), 4); - headTailLatency.init(0, 1000000, 10000).flags(Stats::pdf | Stats::oneline); + headTailLatency.init(0, 1000000, 10000).flags(statistics::pdf | + statistics::oneline); waveLevelParallelism.init(0, n_wf * cu->numVectorALUs, 1); instInterleave.init(cu->numVectorALUs, 0, 20, 1); diff --git a/src/gpu-compute/compute_unit.hh b/src/gpu-compute/compute_unit.hh index db4daf22f3..91a239772a 100644 --- a/src/gpu-compute/compute_unit.hh +++ b/src/gpu-compute/compute_unit.hh @@ -939,152 +939,152 @@ class ComputeUnit : public ClockedObject void updateInstStats(GPUDynInstPtr gpuDynInst); int activeWaves; - struct ComputeUnitStats : public Stats::Group + struct ComputeUnitStats : public statistics::Group { - ComputeUnitStats(Stats::Group *parent, int n_wf); + ComputeUnitStats(statistics::Group *parent, int n_wf); - Stats::Scalar vALUInsts; - Stats::Formula vALUInstsPerWF; - Stats::Scalar sALUInsts; - Stats::Formula sALUInstsPerWF; - Stats::Scalar instCyclesVALU; - Stats::Scalar instCyclesSALU; - Stats::Scalar threadCyclesVALU; - Stats::Formula vALUUtilization; - Stats::Scalar ldsNoFlatInsts; - Stats::Formula ldsNoFlatInstsPerWF; - Stats::Scalar flatVMemInsts; - Stats::Formula flatVMemInstsPerWF; - Stats::Scalar flatLDSInsts; - Stats::Formula flatLDSInstsPerWF; - Stats::Scalar vectorMemWrites; - Stats::Formula vectorMemWritesPerWF; - Stats::Scalar vectorMemReads; - Stats::Formula vectorMemReadsPerWF; - Stats::Scalar scalarMemWrites; - Stats::Formula scalarMemWritesPerWF; - Stats::Scalar scalarMemReads; - Stats::Formula scalarMemReadsPerWF; + statistics::Scalar vALUInsts; + statistics::Formula vALUInstsPerWF; + statistics::Scalar sALUInsts; + statistics::Formula sALUInstsPerWF; + statistics::Scalar instCyclesVALU; + statistics::Scalar instCyclesSALU; + statistics::Scalar threadCyclesVALU; + statistics::Formula vALUUtilization; + statistics::Scalar ldsNoFlatInsts; + statistics::Formula ldsNoFlatInstsPerWF; + statistics::Scalar flatVMemInsts; + statistics::Formula flatVMemInstsPerWF; + statistics::Scalar flatLDSInsts; + statistics::Formula flatLDSInstsPerWF; + statistics::Scalar vectorMemWrites; + statistics::Formula vectorMemWritesPerWF; + statistics::Scalar vectorMemReads; + statistics::Formula vectorMemReadsPerWF; + statistics::Scalar scalarMemWrites; + statistics::Formula scalarMemWritesPerWF; + statistics::Scalar scalarMemReads; + statistics::Formula scalarMemReadsPerWF; - Stats::Formula vectorMemReadsPerKiloInst; - Stats::Formula vectorMemWritesPerKiloInst; - Stats::Formula vectorMemInstsPerKiloInst; - Stats::Formula scalarMemReadsPerKiloInst; - Stats::Formula scalarMemWritesPerKiloInst; - Stats::Formula scalarMemInstsPerKiloInst; + statistics::Formula vectorMemReadsPerKiloInst; + statistics::Formula vectorMemWritesPerKiloInst; + statistics::Formula vectorMemInstsPerKiloInst; + statistics::Formula scalarMemReadsPerKiloInst; + statistics::Formula scalarMemWritesPerKiloInst; + statistics::Formula scalarMemInstsPerKiloInst; // Cycles required to send register source (addr and data) from // register files to memory pipeline, per SIMD. - Stats::Vector instCyclesVMemPerSimd; - Stats::Vector instCyclesScMemPerSimd; - Stats::Vector instCyclesLdsPerSimd; + statistics::Vector instCyclesVMemPerSimd; + statistics::Vector instCyclesScMemPerSimd; + statistics::Vector instCyclesLdsPerSimd; - Stats::Scalar globalReads; - Stats::Scalar globalWrites; - Stats::Formula globalMemInsts; - Stats::Scalar argReads; - Stats::Scalar argWrites; - Stats::Formula argMemInsts; - Stats::Scalar spillReads; - Stats::Scalar spillWrites; - Stats::Formula spillMemInsts; - Stats::Scalar groupReads; - Stats::Scalar groupWrites; - Stats::Formula groupMemInsts; - Stats::Scalar privReads; - Stats::Scalar privWrites; - Stats::Formula privMemInsts; - Stats::Scalar readonlyReads; - Stats::Scalar readonlyWrites; - Stats::Formula readonlyMemInsts; - Stats::Scalar kernargReads; - Stats::Scalar kernargWrites; - Stats::Formula kernargMemInsts; + statistics::Scalar globalReads; + statistics::Scalar globalWrites; + statistics::Formula globalMemInsts; + statistics::Scalar argReads; + statistics::Scalar argWrites; + statistics::Formula argMemInsts; + statistics::Scalar spillReads; + statistics::Scalar spillWrites; + statistics::Formula spillMemInsts; + statistics::Scalar groupReads; + statistics::Scalar groupWrites; + statistics::Formula groupMemInsts; + statistics::Scalar privReads; + statistics::Scalar privWrites; + statistics::Formula privMemInsts; + statistics::Scalar readonlyReads; + statistics::Scalar readonlyWrites; + statistics::Formula readonlyMemInsts; + statistics::Scalar kernargReads; + statistics::Scalar kernargWrites; + statistics::Formula kernargMemInsts; - Stats::Distribution waveLevelParallelism; + statistics::Distribution waveLevelParallelism; // the following stats compute the avg. TLB accesslatency per // uncoalesced request (only for data) - Stats::Scalar tlbRequests; - Stats::Scalar tlbCycles; - Stats::Formula tlbLatency; + statistics::Scalar tlbRequests; + statistics::Scalar tlbCycles; + statistics::Formula tlbLatency; // hitsPerTLBLevel[x] are the hits in Level x TLB. // x = 0 is the page table. - Stats::Vector hitsPerTLBLevel; + statistics::Vector hitsPerTLBLevel; - Stats::Scalar ldsBankAccesses; - Stats::Distribution ldsBankConflictDist; + statistics::Scalar ldsBankAccesses; + statistics::Distribution ldsBankConflictDist; // over all memory instructions executed over all wavefronts // how many touched 0-4 pages, 4-8, ..., 60-64 pages - Stats::Distribution pageDivergenceDist; + statistics::Distribution pageDivergenceDist; // count of non-flat global memory vector instructions executed - Stats::Scalar dynamicGMemInstrCnt; + statistics::Scalar dynamicGMemInstrCnt; // count of flat global memory vector instructions executed - Stats::Scalar dynamicFlatMemInstrCnt; - Stats::Scalar dynamicLMemInstrCnt; + statistics::Scalar dynamicFlatMemInstrCnt; + statistics::Scalar dynamicLMemInstrCnt; - Stats::Scalar wgBlockedDueBarrierAllocation; - Stats::Scalar wgBlockedDueLdsAllocation; + statistics::Scalar wgBlockedDueBarrierAllocation; + statistics::Scalar wgBlockedDueLdsAllocation; // Number of instructions executed, i.e. if 64 (or 32 or 7) lanes are // active when the instruction is committed, this number is still // incremented by 1 - Stats::Scalar numInstrExecuted; + statistics::Scalar numInstrExecuted; // Number of cycles among successive instruction executions across all // wavefronts of the same CU - Stats::Distribution execRateDist; + statistics::Distribution execRateDist; // number of individual vector operations executed - Stats::Scalar numVecOpsExecuted; + statistics::Scalar numVecOpsExecuted; // number of individual f16 vector operations executed - Stats::Scalar numVecOpsExecutedF16; + statistics::Scalar numVecOpsExecutedF16; // number of individual f32 vector operations executed - Stats::Scalar numVecOpsExecutedF32; + statistics::Scalar numVecOpsExecutedF32; // number of individual f64 vector operations executed - Stats::Scalar numVecOpsExecutedF64; + statistics::Scalar numVecOpsExecutedF64; // number of individual FMA 16,32,64 vector operations executed - Stats::Scalar numVecOpsExecutedFMA16; - Stats::Scalar numVecOpsExecutedFMA32; - Stats::Scalar numVecOpsExecutedFMA64; + statistics::Scalar numVecOpsExecutedFMA16; + statistics::Scalar numVecOpsExecutedFMA32; + statistics::Scalar numVecOpsExecutedFMA64; // number of individual MAC 16,32,64 vector operations executed - Stats::Scalar numVecOpsExecutedMAC16; - Stats::Scalar numVecOpsExecutedMAC32; - Stats::Scalar numVecOpsExecutedMAC64; + statistics::Scalar numVecOpsExecutedMAC16; + statistics::Scalar numVecOpsExecutedMAC32; + statistics::Scalar numVecOpsExecutedMAC64; // number of individual MAD 16,32,64 vector operations executed - Stats::Scalar numVecOpsExecutedMAD16; - Stats::Scalar numVecOpsExecutedMAD32; - Stats::Scalar numVecOpsExecutedMAD64; + statistics::Scalar numVecOpsExecutedMAD16; + statistics::Scalar numVecOpsExecutedMAD32; + statistics::Scalar numVecOpsExecutedMAD64; // total number of two op FP vector operations executed - Stats::Scalar numVecOpsExecutedTwoOpFP; + statistics::Scalar numVecOpsExecutedTwoOpFP; // Total cycles that something is running on the GPU - Stats::Scalar totalCycles; - Stats::Formula vpc; // vector ops per cycle - Stats::Formula vpc_f16; // vector ops per cycle - Stats::Formula vpc_f32; // vector ops per cycle - Stats::Formula vpc_f64; // vector ops per cycle - Stats::Formula ipc; // vector instructions per cycle - Stats::Distribution controlFlowDivergenceDist; - Stats::Distribution activeLanesPerGMemInstrDist; - Stats::Distribution activeLanesPerLMemInstrDist; + statistics::Scalar totalCycles; + statistics::Formula vpc; // vector ops per cycle + statistics::Formula vpc_f16; // vector ops per cycle + statistics::Formula vpc_f32; // vector ops per cycle + statistics::Formula vpc_f64; // vector ops per cycle + statistics::Formula ipc; // vector instructions per cycle + statistics::Distribution controlFlowDivergenceDist; + statistics::Distribution activeLanesPerGMemInstrDist; + statistics::Distribution activeLanesPerLMemInstrDist; // number of vector ALU instructions received - Stats::Formula numALUInstsExecuted; + statistics::Formula numALUInstsExecuted; // number of times a WG cannot start due to lack of free VGPRs in SIMDs - Stats::Scalar numTimesWgBlockedDueVgprAlloc; + statistics::Scalar numTimesWgBlockedDueVgprAlloc; // number of times a WG cannot start due to lack of free SGPRs in SIMDs - Stats::Scalar numTimesWgBlockedDueSgprAlloc; - Stats::Scalar numCASOps; - Stats::Scalar numFailedCASOps; - Stats::Scalar completedWfs; - Stats::Scalar completedWGs; + statistics::Scalar numTimesWgBlockedDueSgprAlloc; + statistics::Scalar numCASOps; + statistics::Scalar numFailedCASOps; + statistics::Scalar completedWfs; + statistics::Scalar completedWGs; // distrubtion in latency difference between first and last cache block // arrival ticks - Stats::Distribution headTailLatency; + statistics::Distribution headTailLatency; // Track the amount of interleaving between wavefronts on each SIMD. // This stat is sampled using instExecPerSimd to compute the number // of instructions that have been executed on a SIMD between a WF // executing two successive instructions. - Stats::VectorDistribution instInterleave; + statistics::VectorDistribution instInterleave; } stats; }; diff --git a/src/gpu-compute/dispatcher.cc b/src/gpu-compute/dispatcher.cc index 26e9035112..a1c036c901 100644 --- a/src/gpu-compute/dispatcher.cc +++ b/src/gpu-compute/dispatcher.cc @@ -344,8 +344,9 @@ GPUDispatcher::scheduleDispatch() } } -GPUDispatcher::GPUDispatcherStats::GPUDispatcherStats(Stats::Group *parent) - : Stats::Group(parent), +GPUDispatcher::GPUDispatcherStats::GPUDispatcherStats( + statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(numKernelLaunched, "number of kernel launched"), ADD_STAT(cyclesWaitingForDispatch, "number of cycles with outstanding " "wavefronts that are waiting to be dispatched") diff --git a/src/gpu-compute/dispatcher.hh b/src/gpu-compute/dispatcher.hh index 3cd65f6644..1fce4e5ddd 100644 --- a/src/gpu-compute/dispatcher.hh +++ b/src/gpu-compute/dispatcher.hh @@ -93,12 +93,12 @@ class GPUDispatcher : public SimObject bool dispatchActive; protected: - struct GPUDispatcherStats : public Stats::Group + struct GPUDispatcherStats : public statistics::Group { - GPUDispatcherStats(Stats::Group *parent); + GPUDispatcherStats(statistics::Group *parent); - Stats::Scalar numKernelLaunched; - Stats::Scalar cyclesWaitingForDispatch; + statistics::Scalar numKernelLaunched; + statistics::Scalar cyclesWaitingForDispatch; } stats; }; diff --git a/src/gpu-compute/exec_stage.cc b/src/gpu-compute/exec_stage.cc index 5c57bb3b3a..5a54b102ec 100644 --- a/src/gpu-compute/exec_stage.cc +++ b/src/gpu-compute/exec_stage.cc @@ -197,8 +197,8 @@ ExecStage::exec() collectStatistics(PostExec, 0); } -ExecStage::ExecStageStats::ExecStageStats(Stats::Group *parent) - : Stats::Group(parent, "ExecStage"), +ExecStage::ExecStageStats::ExecStageStats(statistics::Group *parent) + : statistics::Group(parent, "ExecStage"), ADD_STAT(numTransActiveIdle, "number of CU transitions from active to idle"), ADD_STAT(numCyclesWithNoIssue, "number of cycles the CU issues nothing"), diff --git a/src/gpu-compute/exec_stage.hh b/src/gpu-compute/exec_stage.hh index c560b24404..3281f41fa2 100644 --- a/src/gpu-compute/exec_stage.hh +++ b/src/gpu-compute/exec_stage.hh @@ -97,27 +97,27 @@ class ExecStage const std::string _name; protected: - struct ExecStageStats : public Stats::Group + struct ExecStageStats : public statistics::Group { - ExecStageStats(Stats::Group *parent); + ExecStageStats(statistics::Group *parent); // number of transitions from active to idle - Stats::Scalar numTransActiveIdle; + statistics::Scalar numTransActiveIdle; // number of idle cycles - Stats::Scalar numCyclesWithNoIssue; + statistics::Scalar numCyclesWithNoIssue; // number of busy cycles - Stats::Scalar numCyclesWithInstrIssued; + statistics::Scalar numCyclesWithInstrIssued; // SIMDs active per cycle - Stats::Distribution spc; + statistics::Distribution spc; // duration of idle periods in cycles - Stats::Distribution idleDur; + statistics::Distribution idleDur; // number of cycles during which at least one // instruction was issued to an execution resource type - Stats::Vector numCyclesWithInstrTypeIssued; + statistics::Vector numCyclesWithInstrTypeIssued; // number of idle cycles during which the scheduler // issued no instructions targeting a specific // execution resource type - Stats::Vector numCyclesWithNoInstrTypeIssued; + statistics::Vector numCyclesWithNoInstrTypeIssued; } stats; }; diff --git a/src/gpu-compute/fetch_stage.cc b/src/gpu-compute/fetch_stage.cc index 21374bb531..27d014b6fd 100644 --- a/src/gpu-compute/fetch_stage.cc +++ b/src/gpu-compute/fetch_stage.cc @@ -90,8 +90,8 @@ FetchStage::fetch(PacketPtr pkt, Wavefront *wavefront) _fetchUnit[wavefront->simdId].fetch(pkt, wavefront); } -FetchStage::FetchStageStats::FetchStageStats(Stats::Group *parent) - : Stats::Group(parent, "FetchStage"), +FetchStage::FetchStageStats::FetchStageStats(statistics::Group *parent) + : statistics::Group(parent, "FetchStage"), ADD_STAT(instFetchInstReturned, "For each instruction fetch request " "received record how many instructions you got from it") { diff --git a/src/gpu-compute/fetch_stage.hh b/src/gpu-compute/fetch_stage.hh index 3967d6de40..dd54c400c7 100644 --- a/src/gpu-compute/fetch_stage.hh +++ b/src/gpu-compute/fetch_stage.hh @@ -74,11 +74,11 @@ class FetchStage const std::string _name; protected: - struct FetchStageStats : public Stats::Group + struct FetchStageStats : public statistics::Group { - FetchStageStats(Stats::Group *parent); + FetchStageStats(statistics::Group *parent); - Stats::Distribution instFetchInstReturned; + statistics::Distribution instFetchInstReturned; } stats; }; diff --git a/src/gpu-compute/global_memory_pipeline.cc b/src/gpu-compute/global_memory_pipeline.cc index 2f251e864f..a34faa0430 100644 --- a/src/gpu-compute/global_memory_pipeline.cc +++ b/src/gpu-compute/global_memory_pipeline.cc @@ -290,8 +290,8 @@ GlobalMemPipeline::handleResponse(GPUDynInstPtr gpuDynInst) } GlobalMemPipeline:: -GlobalMemPipelineStats::GlobalMemPipelineStats(Stats::Group *parent) - : Stats::Group(parent, "GlobalMemPipeline"), +GlobalMemPipelineStats::GlobalMemPipelineStats(statistics::Group *parent) + : statistics::Group(parent, "GlobalMemPipeline"), ADD_STAT(loadVrfBankConflictCycles, "total number of cycles GM data " "are delayed before updating the VRF") { diff --git a/src/gpu-compute/global_memory_pipeline.hh b/src/gpu-compute/global_memory_pipeline.hh index e8a1fb0339..05a0ad5f7c 100644 --- a/src/gpu-compute/global_memory_pipeline.hh +++ b/src/gpu-compute/global_memory_pipeline.hh @@ -143,14 +143,14 @@ class GlobalMemPipeline std::queue gmIssuedRequests; protected: - struct GlobalMemPipelineStats : public Stats::Group + struct GlobalMemPipelineStats : public statistics::Group { - GlobalMemPipelineStats(Stats::Group *parent); + GlobalMemPipelineStats(statistics::Group *parent); // number of cycles of delaying the update of a VGPR that is the // target of a load instruction (or the load component of an atomic) // The delay is due to VRF bank conflicts - Stats::Scalar loadVrfBankConflictCycles; + statistics::Scalar loadVrfBankConflictCycles; } stats; }; diff --git a/src/gpu-compute/gpu_tlb.cc b/src/gpu-compute/gpu_tlb.cc index edd839f080..5f273cd9aa 100644 --- a/src/gpu-compute/gpu_tlb.cc +++ b/src/gpu-compute/gpu_tlb.cc @@ -1430,8 +1430,8 @@ namespace X86ISA TLBFootprint.clear(); } - GpuTLB::GpuTLBStats::GpuTLBStats(Stats::Group *parent) - : Stats::Group(parent), + GpuTLB::GpuTLBStats::GpuTLBStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(localNumTLBAccesses, "Number of TLB accesses"), ADD_STAT(localNumTLBHits, "Number of TLB hits"), ADD_STAT(localNumTLBMisses, "Number of TLB misses"), diff --git a/src/gpu-compute/gpu_tlb.hh b/src/gpu-compute/gpu_tlb.hh index b678f6b6bb..00ef905b4b 100644 --- a/src/gpu-compute/gpu_tlb.hh +++ b/src/gpu-compute/gpu_tlb.hh @@ -400,37 +400,37 @@ namespace X86ISA EventFunctionWrapper exitEvent; protected: - struct GpuTLBStats : public Stats::Group + struct GpuTLBStats : public statistics::Group { - GpuTLBStats(Stats::Group *parent); + GpuTLBStats(statistics::Group *parent); // local_stats are as seen from the TLB // without taking into account coalescing - Stats::Scalar localNumTLBAccesses; - Stats::Scalar localNumTLBHits; - Stats::Scalar localNumTLBMisses; - Stats::Formula localTLBMissRate; + statistics::Scalar localNumTLBAccesses; + statistics::Scalar localNumTLBHits; + statistics::Scalar localNumTLBMisses; + statistics::Formula localTLBMissRate; // global_stats are as seen from the // CU's perspective taking into account // all coalesced requests. - Stats::Scalar globalNumTLBAccesses; - Stats::Scalar globalNumTLBHits; - Stats::Scalar globalNumTLBMisses; - Stats::Formula globalTLBMissRate; + statistics::Scalar globalNumTLBAccesses; + statistics::Scalar globalNumTLBHits; + statistics::Scalar globalNumTLBMisses; + statistics::Formula globalTLBMissRate; // from the CU perspective (global) - Stats::Scalar accessCycles; + statistics::Scalar accessCycles; // from the CU perspective (global) - Stats::Scalar pageTableCycles; - Stats::Scalar numUniquePages; + statistics::Scalar pageTableCycles; + statistics::Scalar numUniquePages; // from the perspective of this TLB - Stats::Scalar localCycles; + statistics::Scalar localCycles; // from the perspective of this TLB - Stats::Formula localLatency; + statistics::Formula localLatency; // I take the avg. per page and then // the avg. over all pages. - Stats::Scalar avgReuseDistance; + statistics::Scalar avgReuseDistance; } stats; }; } diff --git a/src/gpu-compute/local_memory_pipeline.cc b/src/gpu-compute/local_memory_pipeline.cc index d441a29a7d..d55d16d7a1 100644 --- a/src/gpu-compute/local_memory_pipeline.cc +++ b/src/gpu-compute/local_memory_pipeline.cc @@ -126,8 +126,8 @@ LocalMemPipeline::issueRequest(GPUDynInstPtr gpuDynInst) LocalMemPipeline:: -LocalMemPipelineStats::LocalMemPipelineStats(Stats::Group *parent) - : Stats::Group(parent, "LocalMemPipeline"), +LocalMemPipelineStats::LocalMemPipelineStats(statistics::Group *parent) + : statistics::Group(parent, "LocalMemPipeline"), ADD_STAT(loadVrfBankConflictCycles, "total number of cycles LDS data " "are delayed before updating the VRF") { diff --git a/src/gpu-compute/local_memory_pipeline.hh b/src/gpu-compute/local_memory_pipeline.hh index 83895656e2..3af223253e 100644 --- a/src/gpu-compute/local_memory_pipeline.hh +++ b/src/gpu-compute/local_memory_pipeline.hh @@ -97,11 +97,11 @@ class LocalMemPipeline std::queue lmReturnedRequests; protected: - struct LocalMemPipelineStats : public Stats::Group + struct LocalMemPipelineStats : public statistics::Group { - LocalMemPipelineStats(Stats::Group *parent); + LocalMemPipelineStats(statistics::Group *parent); - Stats::Scalar loadVrfBankConflictCycles; + statistics::Scalar loadVrfBankConflictCycles; } stats; }; diff --git a/src/gpu-compute/register_file.cc b/src/gpu-compute/register_file.cc index faf3f1ee4e..f91bbf494b 100644 --- a/src/gpu-compute/register_file.cc +++ b/src/gpu-compute/register_file.cc @@ -189,8 +189,8 @@ RegisterFile::dispatchInstruction(GPUDynInstPtr ii) { } -RegisterFile::RegisterFileStats::RegisterFileStats(Stats::Group *parent) - : Stats::Group(parent), +RegisterFile::RegisterFileStats::RegisterFileStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(registerReads, "Total number of DWORDs read from register file"), ADD_STAT(registerWrites, diff --git a/src/gpu-compute/register_file.hh b/src/gpu-compute/register_file.hh index e067cfc2d3..12c40584b3 100644 --- a/src/gpu-compute/register_file.hh +++ b/src/gpu-compute/register_file.hh @@ -151,21 +151,21 @@ class RegisterFile : public SimObject // numer of registers in this register file int _numRegs; - struct RegisterFileStats : public Stats::Group + struct RegisterFileStats : public statistics::Group { - RegisterFileStats(Stats::Group *parent); + RegisterFileStats(statistics::Group *parent); // Total number of register reads per DWORD per thread - Stats::Scalar registerReads; + statistics::Scalar registerReads; // Total number of register writes per DWORD per thread - Stats::Scalar registerWrites; + statistics::Scalar registerWrites; // Number of register file SRAM activations for reads. // The register file may be implemented with multiple SRAMs. This stat // tracks how many times the SRAMs are accessed for reads. - Stats::Scalar sramReads; + statistics::Scalar sramReads; // Number of register file SRAM activations for writes - Stats::Scalar sramWrites; + statistics::Scalar sramWrites; } stats; }; diff --git a/src/gpu-compute/schedule_stage.cc b/src/gpu-compute/schedule_stage.cc index 865912ca60..757ea2fe32 100644 --- a/src/gpu-compute/schedule_stage.cc +++ b/src/gpu-compute/schedule_stage.cc @@ -784,9 +784,9 @@ ScheduleStage::deleteFromSch(Wavefront *w) wavesInSch.erase(w->wfDynId); } -ScheduleStage::ScheduleStageStats::ScheduleStageStats(Stats::Group *parent, - int num_exec_units) - : Stats::Group(parent, "ScheduleStage"), +ScheduleStage::ScheduleStageStats::ScheduleStageStats( + statistics::Group *parent, int num_exec_units) + : statistics::Group(parent, "ScheduleStage"), ADD_STAT(rdyListEmpty ,"number of cycles no wave on ready list per " "execution resource"), ADD_STAT(rdyListNotEmpty, "number of cycles one or more wave on ready " diff --git a/src/gpu-compute/schedule_stage.hh b/src/gpu-compute/schedule_stage.hh index 126201a696..7959ec49a6 100644 --- a/src/gpu-compute/schedule_stage.hh +++ b/src/gpu-compute/schedule_stage.hh @@ -184,49 +184,49 @@ class ScheduleStage std::vector>> schList; protected: - struct ScheduleStageStats : public Stats::Group + struct ScheduleStageStats : public statistics::Group { - ScheduleStageStats(Stats::Group *parent, int num_exec_units); + ScheduleStageStats(statistics::Group *parent, int num_exec_units); // Number of cycles with empty (or not empty) readyList, per execution // resource, when the CU is active (not sleeping) - Stats::Vector rdyListEmpty; - Stats::Vector rdyListNotEmpty; + statistics::Vector rdyListEmpty; + statistics::Vector rdyListNotEmpty; // Number of cycles, per execution resource, when at least one wave // was on the readyList and picked by scheduler, but was unable to be // added to the schList, when the CU is active (not sleeping) - Stats::Vector addToSchListStalls; + statistics::Vector addToSchListStalls; // Number of cycles, per execution resource, when a wave is selected // as candidate for dispatchList from schList // Note: may be arbitrated off dispatchList (e.g., LDS arbitration) - Stats::Vector schListToDispList; + statistics::Vector schListToDispList; // Per execution resource stat, incremented once per cycle if no wave // was selected as candidate for dispatch and moved to dispatchList - Stats::Vector schListToDispListStalls; + statistics::Vector schListToDispListStalls; // Number of times a wave is selected by the scheduler but cannot // be added to the schList due to register files not being able to // support reads or writes of operands. RF_ACCESS_NRDY condition is // always incremented if at least one read/write not supported, other // conditions are incremented independently from each other. - Stats::Vector rfAccessStalls; + statistics::Vector rfAccessStalls; // Number of times a wave is executing FLAT instruction and // forces another wave occupying its required local memory resource // to be deselected for execution, and placed back on schList - Stats::Scalar ldsBusArbStalls; + statistics::Scalar ldsBusArbStalls; // Count of times VRF and/or SRF blocks waves on schList from // performing RFBUSY->RFREADY transition - Stats::Vector opdNrdyStalls; + statistics::Vector opdNrdyStalls; // Count of times resource required for dispatch is not ready and // blocks wave in RFREADY state on schList from potentially moving // to dispatchList - Stats::Vector dispNrdyStalls; + statistics::Vector dispNrdyStalls; } stats; }; diff --git a/src/gpu-compute/scoreboard_check_stage.cc b/src/gpu-compute/scoreboard_check_stage.cc index 08ce6a193b..f0ff664b55 100644 --- a/src/gpu-compute/scoreboard_check_stage.cc +++ b/src/gpu-compute/scoreboard_check_stage.cc @@ -277,8 +277,8 @@ ScoreboardCheckStage::exec() } ScoreboardCheckStage:: -ScoreboardCheckStageStats::ScoreboardCheckStageStats(Stats::Group *parent) - : Stats::Group(parent, "ScoreboardCheckStage"), +ScoreboardCheckStageStats::ScoreboardCheckStageStats(statistics::Group *parent) + : statistics::Group(parent, "ScoreboardCheckStage"), ADD_STAT(stallCycles, "number of cycles wave stalled in SCB") { stallCycles.init(NRDY_CONDITIONS); diff --git a/src/gpu-compute/scoreboard_check_stage.hh b/src/gpu-compute/scoreboard_check_stage.hh index 00e1466e80..b522f3860c 100644 --- a/src/gpu-compute/scoreboard_check_stage.hh +++ b/src/gpu-compute/scoreboard_check_stage.hh @@ -99,11 +99,11 @@ class ScoreboardCheckStage const std::string _name; protected: - struct ScoreboardCheckStageStats : public Stats::Group + struct ScoreboardCheckStageStats : public statistics::Group { - ScoreboardCheckStageStats(Stats::Group *parent); + ScoreboardCheckStageStats(statistics::Group *parent); - Stats::Vector stallCycles; + statistics::Vector stallCycles; } stats; }; diff --git a/src/gpu-compute/shader.cc b/src/gpu-compute/shader.cc index 4905aa0d29..8f9e59e14f 100644 --- a/src/gpu-compute/shader.cc +++ b/src/gpu-compute/shader.cc @@ -522,8 +522,8 @@ Shader::notifyCuSleep() { stats.shaderActiveTicks += curTick() - _lastInactiveTick; } -Shader::ShaderStats::ShaderStats(Stats::Group *parent, int wf_size) - : Stats::Group(parent), +Shader::ShaderStats::ShaderStats(statistics::Group *parent, int wf_size) + : statistics::Group(parent), ADD_STAT(allLatencyDist, "delay distribution for all"), ADD_STAT(loadLatencyDist, "delay distribution for loads"), ADD_STAT(storeLatencyDist, "delay distribution for stores"), @@ -546,40 +546,40 @@ Shader::ShaderStats::ShaderStats(Stats::Group *parent, int wf_size) { allLatencyDist .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); loadLatencyDist .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); storeLatencyDist .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); initToCoalesceLatency .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); rubyNetworkLatency .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); gmEnqueueLatency .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); gmToCompleteLatency .init(0, 1600000, 10000) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); coalsrLineAddresses .init(0, 20, 1) - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); vectorInstSrcOperand.init(4); vectorInstDstOperand.init(4); - cacheBlockRoundTrip = new Stats::Distribution[wf_size]; + cacheBlockRoundTrip = new statistics::Distribution[wf_size]; for (int idx = 0; idx < wf_size; ++idx) { std::stringstream namestr; ccprintf(namestr, "%s.cacheBlockRoundTrip%d", @@ -588,6 +588,6 @@ Shader::ShaderStats::ShaderStats(Stats::Group *parent, int wf_size) .init(0, 1600000, 10000) .name(namestr.str()) .desc("Coalsr-to-coalsr time for the Nth cache block in an inst") - .flags(Stats::pdf | Stats::oneline); + .flags(statistics::pdf | statistics::oneline); } } diff --git a/src/gpu-compute/shader.hh b/src/gpu-compute/shader.hh index 9d14ddd5d9..99616e0b42 100644 --- a/src/gpu-compute/shader.hh +++ b/src/gpu-compute/shader.hh @@ -281,37 +281,37 @@ class Shader : public ClockedObject } protected: - struct ShaderStats : public Stats::Group + struct ShaderStats : public statistics::Group { - ShaderStats(Stats::Group *parent, int wf_size); + ShaderStats(statistics::Group *parent, int wf_size); // some stats for measuring latency - Stats::Distribution allLatencyDist; - Stats::Distribution loadLatencyDist; - Stats::Distribution storeLatencyDist; + statistics::Distribution allLatencyDist; + statistics::Distribution loadLatencyDist; + statistics::Distribution storeLatencyDist; // average ticks from vmem inst initiateAcc to coalescer issue, - Stats::Distribution initToCoalesceLatency; + statistics::Distribution initToCoalesceLatency; // average ticks from coalescer issue to coalescer hit callback, - Stats::Distribution rubyNetworkLatency; + statistics::Distribution rubyNetworkLatency; // average ticks from coalescer hit callback to GM pipe enqueue, - Stats::Distribution gmEnqueueLatency; + statistics::Distribution gmEnqueueLatency; // average ticks spent in GM pipe's ordered resp buffer. - Stats::Distribution gmToCompleteLatency; + statistics::Distribution gmToCompleteLatency; // average number of cache blocks requested by vmem inst - Stats::Distribution coalsrLineAddresses; + statistics::Distribution coalsrLineAddresses; // average ticks for cache blocks to main memory for the Nth // cache block generated by a vmem inst. - Stats::Distribution *cacheBlockRoundTrip; + statistics::Distribution *cacheBlockRoundTrip; - Stats::Scalar shaderActiveTicks; - Stats::Vector vectorInstSrcOperand; - Stats::Vector vectorInstDstOperand; + statistics::Scalar shaderActiveTicks; + statistics::Vector vectorInstSrcOperand; + statistics::Vector vectorInstDstOperand; } stats; }; diff --git a/src/gpu-compute/tlb_coalescer.cc b/src/gpu-compute/tlb_coalescer.cc index ea754c1609..be01114656 100644 --- a/src/gpu-compute/tlb_coalescer.cc +++ b/src/gpu-compute/tlb_coalescer.cc @@ -521,8 +521,8 @@ TLBCoalescer::processCleanupEvent() } } -TLBCoalescer::TLBCoalescerStats::TLBCoalescerStats(Stats::Group *parent) - : Stats::Group(parent), +TLBCoalescer::TLBCoalescerStats::TLBCoalescerStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(uncoalescedAccesses, "Number of uncoalesced TLB accesses"), ADD_STAT(coalescedAccesses, "Number of coalesced TLB accesses"), ADD_STAT(queuingCycles, "Number of cycles spent in queue"), diff --git a/src/gpu-compute/tlb_coalescer.hh b/src/gpu-compute/tlb_coalescer.hh index 5ee7572415..22d375d4d6 100644 --- a/src/gpu-compute/tlb_coalescer.hh +++ b/src/gpu-compute/tlb_coalescer.hh @@ -195,26 +195,26 @@ class TLBCoalescer : public ClockedObject std::queue cleanupQueue; protected: - struct TLBCoalescerStats : public Stats::Group + struct TLBCoalescerStats : public statistics::Group { - TLBCoalescerStats(Stats::Group *parent); + TLBCoalescerStats(statistics::Group *parent); // number of packets the coalescer receives - Stats::Scalar uncoalescedAccesses; + statistics::Scalar uncoalescedAccesses; // number packets the coalescer send to the TLB - Stats::Scalar coalescedAccesses; + statistics::Scalar coalescedAccesses; // Number of cycles the coalesced requests spend waiting in // coalescerFIFO. For each packet the coalescer receives we take into // account the number of all uncoalesced requests this pkt "represents" - Stats::Scalar queuingCycles; + statistics::Scalar queuingCycles; // On average how much time a request from the // uncoalescedAccesses that reaches the TLB // spends waiting? - Stats::Scalar localqueuingCycles; + statistics::Scalar localqueuingCycles; // localqueuingCycles/uncoalescedAccesses - Stats::Formula localLatency; + statistics::Formula localLatency; } stats; }; diff --git a/src/gpu-compute/wavefront.cc b/src/gpu-compute/wavefront.cc index a933308a1d..3dbf15b463 100644 --- a/src/gpu-compute/wavefront.cc +++ b/src/gpu-compute/wavefront.cc @@ -1435,8 +1435,8 @@ Wavefront::releaseBarrier() barId = WFBarrier::InvalidID; } -Wavefront::WavefrontStats::WavefrontStats(Stats::Group *parent) - : Stats::Group(parent), +Wavefront::WavefrontStats::WavefrontStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(numInstrExecuted, "number of instructions executed by this WF slot"), ADD_STAT(schCycles, "number of cycles spent in schedule stage"), diff --git a/src/gpu-compute/wavefront.hh b/src/gpu-compute/wavefront.hh index eb7ccb53e1..84b705edc5 100644 --- a/src/gpu-compute/wavefront.hh +++ b/src/gpu-compute/wavefront.hh @@ -330,49 +330,49 @@ class Wavefront : public SimObject int barId; public: - struct WavefrontStats : public Stats::Group + struct WavefrontStats : public statistics::Group { - WavefrontStats(Stats::Group *parent); + WavefrontStats(statistics::Group *parent); // Number of instructions executed by this wavefront slot across all // dynamic wavefronts - Stats::Scalar numInstrExecuted; + statistics::Scalar numInstrExecuted; // Number of cycles this WF spends in SCH stage - Stats::Scalar schCycles; + statistics::Scalar schCycles; // Number of stall cycles encounterd by this WF in SCH stage - Stats::Scalar schStalls; + statistics::Scalar schStalls; // The following stats sum to the value of schStalls, and record, per // WF slot, what the cause of each stall was at a coarse granularity. // Cycles WF is selected by scheduler, but RFs cannot support // instruction - Stats::Scalar schRfAccessStalls; + statistics::Scalar schRfAccessStalls; // Cycles spent waiting for execution resources - Stats::Scalar schResourceStalls; + statistics::Scalar schResourceStalls; // cycles spent waiting for RF reads to complete in SCH stage - Stats::Scalar schOpdNrdyStalls; + statistics::Scalar schOpdNrdyStalls; // LDS arbitration stall cycles. WF attempts to execute LM instruction, // but another wave is executing FLAT, which requires LM and GM and // forces this WF to stall. - Stats::Scalar schLdsArbStalls; + statistics::Scalar schLdsArbStalls; // number of times an instruction of a WF is blocked from being issued // due to WAR and WAW dependencies - Stats::Scalar numTimesBlockedDueWAXDependencies; + statistics::Scalar numTimesBlockedDueWAXDependencies; // number of times an instruction of a WF is blocked from being issued // due to WAR and WAW dependencies - Stats::Scalar numTimesBlockedDueRAWDependencies; + statistics::Scalar numTimesBlockedDueRAWDependencies; // Distribution to track the distance between producer and consumer // for vector register values - Stats::Distribution vecRawDistance; + statistics::Distribution vecRawDistance; // Distribution to track the number of times every vector register // value produced is consumed. - Stats::Distribution readsPerWrite; + statistics::Distribution readsPerWrite; } stats; }; diff --git a/src/learning_gem5/part2/simple_cache.cc b/src/learning_gem5/part2/simple_cache.cc index cdf9ab8403..aafafd25d9 100644 --- a/src/learning_gem5/part2/simple_cache.cc +++ b/src/learning_gem5/part2/simple_cache.cc @@ -422,13 +422,13 @@ SimpleCache::sendRangeChange() const } } -SimpleCache::SimpleCacheStats::SimpleCacheStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(hits, Stats::units::Count::get(), "Number of hits"), - ADD_STAT(misses, Stats::units::Count::get(), "Number of misses"), - ADD_STAT(missLatency, Stats::units::Tick::get(), +SimpleCache::SimpleCacheStats::SimpleCacheStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(hits, statistics::units::Count::get(), "Number of hits"), + ADD_STAT(misses, statistics::units::Count::get(), "Number of misses"), + ADD_STAT(missLatency, statistics::units::Tick::get(), "Ticks for misses to the cache"), - ADD_STAT(hitRatio, Stats::units::Ratio::get(), + ADD_STAT(hitRatio, statistics::units::Ratio::get(), "The ratio of hits to the total accesses to the cache", hits / (hits + misses)) { diff --git a/src/learning_gem5/part2/simple_cache.hh b/src/learning_gem5/part2/simple_cache.hh index 68ab0012b1..7ec430572f 100644 --- a/src/learning_gem5/part2/simple_cache.hh +++ b/src/learning_gem5/part2/simple_cache.hh @@ -293,13 +293,13 @@ class SimpleCache : public ClockedObject /// Cache statistics protected: - struct SimpleCacheStats : public Stats::Group + struct SimpleCacheStats : public statistics::Group { - SimpleCacheStats(Stats::Group *parent); - Stats::Scalar hits; - Stats::Scalar misses; - Stats::Histogram missLatency; - Stats::Formula hitRatio; + SimpleCacheStats(statistics::Group *parent); + statistics::Scalar hits; + statistics::Scalar misses; + statistics::Histogram missLatency; + statistics::Formula hitRatio; } stats; public: diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc index bcb69147fc..720ebfed11 100644 --- a/src/mem/abstract_mem.cc +++ b/src/mem/abstract_mem.cc @@ -110,31 +110,31 @@ AbstractMemory::setBackingStore(uint8_t* pmem_addr) } AbstractMemory::MemStats::MemStats(AbstractMemory &_mem) - : Stats::Group(&_mem), mem(_mem), - ADD_STAT(bytesRead, Stats::units::Byte::get(), + : statistics::Group(&_mem), mem(_mem), + ADD_STAT(bytesRead, statistics::units::Byte::get(), "Number of bytes read from this memory"), - ADD_STAT(bytesInstRead, Stats::units::Byte::get(), + ADD_STAT(bytesInstRead, statistics::units::Byte::get(), "Number of instructions bytes read from this memory"), - ADD_STAT(bytesWritten, Stats::units::Byte::get(), + ADD_STAT(bytesWritten, statistics::units::Byte::get(), "Number of bytes written to this memory"), - ADD_STAT(numReads, Stats::units::Count::get(), + ADD_STAT(numReads, statistics::units::Count::get(), "Number of read requests responded to by this memory"), - ADD_STAT(numWrites, Stats::units::Count::get(), + ADD_STAT(numWrites, statistics::units::Count::get(), "Number of write requests responded to by this memory"), - ADD_STAT(numOther, Stats::units::Count::get(), + ADD_STAT(numOther, statistics::units::Count::get(), "Number of other requests responded to by this memory"), - ADD_STAT(bwRead, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(bwRead, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Total read bandwidth from this memory"), ADD_STAT(bwInstRead, - Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Instruction read bandwidth from this memory"), - ADD_STAT(bwWrite, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(bwWrite, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Write bandwidth from this memory"), - ADD_STAT(bwTotal, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(bwTotal, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Total bandwidth to/from this memory") { } @@ -142,9 +142,9 @@ AbstractMemory::MemStats::MemStats(AbstractMemory &_mem) void AbstractMemory::MemStats::regStats() { - using namespace Stats; + using namespace statistics; - Stats::Group::regStats(); + statistics::Group::regStats(); System *sys = mem.system(); assert(sys); diff --git a/src/mem/abstract_mem.hh b/src/mem/abstract_mem.hh index 4b71b835c7..4ec91ad572 100644 --- a/src/mem/abstract_mem.hh +++ b/src/mem/abstract_mem.hh @@ -165,7 +165,7 @@ class AbstractMemory : public ClockedObject */ System *_system; - struct MemStats : public Stats::Group + struct MemStats : public statistics::Group { MemStats(AbstractMemory &mem); @@ -174,25 +174,25 @@ class AbstractMemory : public ClockedObject const AbstractMemory &mem; /** Number of total bytes read from this memory */ - Stats::Vector bytesRead; + statistics::Vector bytesRead; /** Number of instruction bytes read from this memory */ - Stats::Vector bytesInstRead; + statistics::Vector bytesInstRead; /** Number of bytes written to this memory */ - Stats::Vector bytesWritten; + statistics::Vector bytesWritten; /** Number of read requests */ - Stats::Vector numReads; + statistics::Vector numReads; /** Number of write requests */ - Stats::Vector numWrites; + statistics::Vector numWrites; /** Number of other requests */ - Stats::Vector numOther; + statistics::Vector numOther; /** Read bandwidth from this memory */ - Stats::Formula bwRead; + statistics::Formula bwRead; /** Read bandwidth from this memory */ - Stats::Formula bwInstRead; + statistics::Formula bwInstRead; /** Write bandwidth from this memory */ - Stats::Formula bwWrite; + statistics::Formula bwWrite; /** Total bandwidth from this memory */ - Stats::Formula bwTotal; + statistics::Formula bwTotal; } stats; diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc index fac376e930..928c30b2b1 100644 --- a/src/mem/cache/base.cc +++ b/src/mem/cache/base.cc @@ -1927,37 +1927,37 @@ BaseCache::unserialize(CheckpointIn &cp) BaseCache::CacheCmdStats::CacheCmdStats(BaseCache &c, const std::string &name) - : Stats::Group(&c, name.c_str()), cache(c), - ADD_STAT(hits, Stats::units::Count::get(), + : statistics::Group(&c, name.c_str()), cache(c), + ADD_STAT(hits, statistics::units::Count::get(), ("number of " + name + " hits").c_str()), - ADD_STAT(misses, Stats::units::Count::get(), + ADD_STAT(misses, statistics::units::Count::get(), ("number of " + name + " misses").c_str()), - ADD_STAT(missLatency, Stats::units::Tick::get(), + ADD_STAT(missLatency, statistics::units::Tick::get(), ("number of " + name + " miss ticks").c_str()), - ADD_STAT(accesses, Stats::units::Count::get(), + ADD_STAT(accesses, statistics::units::Count::get(), ("number of " + name + " accesses(hits+misses)").c_str()), - ADD_STAT(missRate, Stats::units::Ratio::get(), + ADD_STAT(missRate, statistics::units::Ratio::get(), ("miss rate for " + name + " accesses").c_str()), - ADD_STAT(avgMissLatency, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgMissLatency, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), ("average " + name + " miss latency").c_str()), - ADD_STAT(mshrHits, Stats::units::Count::get(), + ADD_STAT(mshrHits, statistics::units::Count::get(), ("number of " + name + " MSHR hits").c_str()), - ADD_STAT(mshrMisses, Stats::units::Count::get(), + ADD_STAT(mshrMisses, statistics::units::Count::get(), ("number of " + name + " MSHR misses").c_str()), - ADD_STAT(mshrUncacheable, Stats::units::Count::get(), + ADD_STAT(mshrUncacheable, statistics::units::Count::get(), ("number of " + name + " MSHR uncacheable").c_str()), - ADD_STAT(mshrMissLatency, Stats::units::Tick::get(), + ADD_STAT(mshrMissLatency, statistics::units::Tick::get(), ("number of " + name + " MSHR miss ticks").c_str()), - ADD_STAT(mshrUncacheableLatency, Stats::units::Tick::get(), + ADD_STAT(mshrUncacheableLatency, statistics::units::Tick::get(), ("number of " + name + " MSHR uncacheable ticks").c_str()), - ADD_STAT(mshrMissRate, Stats::units::Ratio::get(), + ADD_STAT(mshrMissRate, statistics::units::Ratio::get(), ("mshr miss rate for " + name + " accesses").c_str()), - ADD_STAT(avgMshrMissLatency, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgMshrMissLatency, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), ("average " + name + " mshr miss latency").c_str()), - ADD_STAT(avgMshrUncacheableLatency, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgMshrUncacheableLatency, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), ("average " + name + " mshr uncacheable latency").c_str()) { } @@ -1965,9 +1965,9 @@ BaseCache::CacheCmdStats::CacheCmdStats(BaseCache &c, void BaseCache::CacheCmdStats::regStatsFromParent() { - using namespace Stats; + using namespace statistics; - Stats::Group::regStats(); + statistics::Group::regStats(); System *system = cache.system; const auto max_requestors = system->maxRequestors(); @@ -2088,78 +2088,78 @@ BaseCache::CacheCmdStats::regStatsFromParent() } BaseCache::CacheStats::CacheStats(BaseCache &c) - : Stats::Group(&c), cache(c), + : statistics::Group(&c), cache(c), - ADD_STAT(demandHits, Stats::units::Count::get(), + ADD_STAT(demandHits, statistics::units::Count::get(), "number of demand (read+write) hits"), - ADD_STAT(overallHits, Stats::units::Count::get(), + ADD_STAT(overallHits, statistics::units::Count::get(), "number of overall hits"), - ADD_STAT(demandMisses, Stats::units::Count::get(), + ADD_STAT(demandMisses, statistics::units::Count::get(), "number of demand (read+write) misses"), - ADD_STAT(overallMisses, Stats::units::Count::get(), + ADD_STAT(overallMisses, statistics::units::Count::get(), "number of overall misses"), - ADD_STAT(demandMissLatency, Stats::units::Tick::get(), + ADD_STAT(demandMissLatency, statistics::units::Tick::get(), "number of demand (read+write) miss ticks"), - ADD_STAT(overallMissLatency, Stats::units::Tick::get(), + ADD_STAT(overallMissLatency, statistics::units::Tick::get(), "number of overall miss ticks"), - ADD_STAT(demandAccesses, Stats::units::Count::get(), + ADD_STAT(demandAccesses, statistics::units::Count::get(), "number of demand (read+write) accesses"), - ADD_STAT(overallAccesses, Stats::units::Count::get(), + ADD_STAT(overallAccesses, statistics::units::Count::get(), "number of overall (read+write) accesses"), - ADD_STAT(demandMissRate, Stats::units::Ratio::get(), + ADD_STAT(demandMissRate, statistics::units::Ratio::get(), "miss rate for demand accesses"), - ADD_STAT(overallMissRate, Stats::units::Ratio::get(), + ADD_STAT(overallMissRate, statistics::units::Ratio::get(), "miss rate for overall accesses"), - ADD_STAT(demandAvgMissLatency, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(demandAvgMissLatency, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "average overall miss latency"), - ADD_STAT(overallAvgMissLatency, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(overallAvgMissLatency, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "average overall miss latency"), - ADD_STAT(blockedCycles, Stats::units::Cycle::get(), + ADD_STAT(blockedCycles, statistics::units::Cycle::get(), "number of cycles access was blocked"), - ADD_STAT(blockedCauses, Stats::units::Count::get(), + ADD_STAT(blockedCauses, statistics::units::Count::get(), "number of times access was blocked"), - ADD_STAT(avgBlocked, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(avgBlocked, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "average number of cycles each access was blocked"), - ADD_STAT(unusedPrefetches, Stats::units::Count::get(), + ADD_STAT(unusedPrefetches, statistics::units::Count::get(), "number of HardPF blocks evicted w/o reference"), - ADD_STAT(writebacks, Stats::units::Count::get(), "number of writebacks"), - ADD_STAT(demandMshrHits, Stats::units::Count::get(), + ADD_STAT(writebacks, statistics::units::Count::get(), "number of writebacks"), + ADD_STAT(demandMshrHits, statistics::units::Count::get(), "number of demand (read+write) MSHR hits"), - ADD_STAT(overallMshrHits, Stats::units::Count::get(), + ADD_STAT(overallMshrHits, statistics::units::Count::get(), "number of overall MSHR hits"), - ADD_STAT(demandMshrMisses, Stats::units::Count::get(), + ADD_STAT(demandMshrMisses, statistics::units::Count::get(), "number of demand (read+write) MSHR misses"), - ADD_STAT(overallMshrMisses, Stats::units::Count::get(), + ADD_STAT(overallMshrMisses, statistics::units::Count::get(), "number of overall MSHR misses"), - ADD_STAT(overallMshrUncacheable, Stats::units::Count::get(), + ADD_STAT(overallMshrUncacheable, statistics::units::Count::get(), "number of overall MSHR uncacheable misses"), - ADD_STAT(demandMshrMissLatency, Stats::units::Tick::get(), + ADD_STAT(demandMshrMissLatency, statistics::units::Tick::get(), "number of demand (read+write) MSHR miss ticks"), - ADD_STAT(overallMshrMissLatency, Stats::units::Tick::get(), + ADD_STAT(overallMshrMissLatency, statistics::units::Tick::get(), "number of overall MSHR miss ticks"), - ADD_STAT(overallMshrUncacheableLatency, Stats::units::Tick::get(), + ADD_STAT(overallMshrUncacheableLatency, statistics::units::Tick::get(), "number of overall MSHR uncacheable ticks"), - ADD_STAT(demandMshrMissRate, Stats::units::Ratio::get(), + ADD_STAT(demandMshrMissRate, statistics::units::Ratio::get(), "mshr miss ratio for demand accesses"), - ADD_STAT(overallMshrMissRate, Stats::units::Ratio::get(), + ADD_STAT(overallMshrMissRate, statistics::units::Ratio::get(), "mshr miss ratio for overall accesses"), - ADD_STAT(demandAvgMshrMissLatency, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(demandAvgMshrMissLatency, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "average overall mshr miss latency"), - ADD_STAT(overallAvgMshrMissLatency, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(overallAvgMshrMissLatency, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "average overall mshr miss latency"), - ADD_STAT(overallAvgMshrUncacheableLatency, Stats::units::Rate< - Stats::units::Cycle, Stats::units::Count>::get(), + ADD_STAT(overallAvgMshrUncacheableLatency, statistics::units::Rate< + statistics::units::Cycle, statistics::units::Count>::get(), "average overall mshr uncacheable latency"), - ADD_STAT(replacements, Stats::units::Count::get(), + ADD_STAT(replacements, statistics::units::Count::get(), "number of replacements"), - ADD_STAT(dataExpansions, Stats::units::Count::get(), + ADD_STAT(dataExpansions, statistics::units::Count::get(), "number of data expansions"), - ADD_STAT(dataContractions, Stats::units::Count::get(), + ADD_STAT(dataContractions, statistics::units::Count::get(), "number of data contractions"), cmd(MemCmd::NUM_MEM_CMDS) { @@ -2170,9 +2170,9 @@ BaseCache::CacheStats::CacheStats(BaseCache &c) void BaseCache::CacheStats::regStats() { - using namespace Stats; + using namespace statistics; - Stats::Group::regStats(); + statistics::Group::regStats(); System *system = cache.system; const auto max_requestors = system->maxRequestors(); diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh index 458440d1a1..b18284ec09 100644 --- a/src/mem/cache/base.hh +++ b/src/mem/cache/base.hh @@ -982,7 +982,7 @@ class BaseCache : public ClockedObject /** System we are currently operating in. */ System *system; - struct CacheCmdStats : public Stats::Group + struct CacheCmdStats : public statistics::Group { CacheCmdStats(BaseCache &c, const std::string &name); @@ -998,40 +998,40 @@ class BaseCache : public ClockedObject /** Number of hits per thread for each type of command. @sa Packet::Command */ - Stats::Vector hits; + statistics::Vector hits; /** Number of misses per thread for each type of command. @sa Packet::Command */ - Stats::Vector misses; + statistics::Vector misses; /** * Total number of cycles per thread/command spent waiting for a miss. * Used to calculate the average miss latency. */ - Stats::Vector missLatency; + statistics::Vector missLatency; /** The number of accesses per command and thread. */ - Stats::Formula accesses; + statistics::Formula accesses; /** The miss rate per command and thread. */ - Stats::Formula missRate; + statistics::Formula missRate; /** The average miss latency per command and thread. */ - Stats::Formula avgMissLatency; + statistics::Formula avgMissLatency; /** Number of misses that hit in the MSHRs per command and thread. */ - Stats::Vector mshrHits; + statistics::Vector mshrHits; /** Number of misses that miss in the MSHRs, per command and thread. */ - Stats::Vector mshrMisses; + statistics::Vector mshrMisses; /** Number of misses that miss in the MSHRs, per command and thread. */ - Stats::Vector mshrUncacheable; + statistics::Vector mshrUncacheable; /** Total cycle latency of each MSHR miss, per command and thread. */ - Stats::Vector mshrMissLatency; + statistics::Vector mshrMissLatency; /** Total cycle latency of each MSHR miss, per command and thread. */ - Stats::Vector mshrUncacheableLatency; + statistics::Vector mshrUncacheableLatency; /** The miss rate in the MSHRs pre command and thread. */ - Stats::Formula mshrMissRate; + statistics::Formula mshrMissRate; /** The average latency of an MSHR miss, per command and thread. */ - Stats::Formula avgMshrMissLatency; + statistics::Formula avgMshrMissLatency; /** The average latency of an MSHR miss, per command and thread. */ - Stats::Formula avgMshrUncacheableLatency; + statistics::Formula avgMshrUncacheableLatency; }; - struct CacheStats : public Stats::Group + struct CacheStats : public statistics::Group { CacheStats(BaseCache &c); @@ -1044,95 +1044,95 @@ class BaseCache : public ClockedObject const BaseCache &cache; /** Number of hits for demand accesses. */ - Stats::Formula demandHits; + statistics::Formula demandHits; /** Number of hit for all accesses. */ - Stats::Formula overallHits; + statistics::Formula overallHits; /** Number of misses for demand accesses. */ - Stats::Formula demandMisses; + statistics::Formula demandMisses; /** Number of misses for all accesses. */ - Stats::Formula overallMisses; + statistics::Formula overallMisses; /** Total number of cycles spent waiting for demand misses. */ - Stats::Formula demandMissLatency; + statistics::Formula demandMissLatency; /** Total number of cycles spent waiting for all misses. */ - Stats::Formula overallMissLatency; + statistics::Formula overallMissLatency; /** The number of demand accesses. */ - Stats::Formula demandAccesses; + statistics::Formula demandAccesses; /** The number of overall accesses. */ - Stats::Formula overallAccesses; + statistics::Formula overallAccesses; /** The miss rate of all demand accesses. */ - Stats::Formula demandMissRate; + statistics::Formula demandMissRate; /** The miss rate for all accesses. */ - Stats::Formula overallMissRate; + statistics::Formula overallMissRate; /** The average miss latency for demand misses. */ - Stats::Formula demandAvgMissLatency; + statistics::Formula demandAvgMissLatency; /** The average miss latency for all misses. */ - Stats::Formula overallAvgMissLatency; + statistics::Formula overallAvgMissLatency; /** The total number of cycles blocked for each blocked cause. */ - Stats::Vector blockedCycles; + statistics::Vector blockedCycles; /** The number of times this cache blocked for each blocked cause. */ - Stats::Vector blockedCauses; + statistics::Vector blockedCauses; /** The average number of cycles blocked for each blocked cause. */ - Stats::Formula avgBlocked; + statistics::Formula avgBlocked; /** The number of times a HW-prefetched block is evicted w/o * reference. */ - Stats::Scalar unusedPrefetches; + statistics::Scalar unusedPrefetches; /** Number of blocks written back per thread. */ - Stats::Vector writebacks; + statistics::Vector writebacks; /** Demand misses that hit in the MSHRs. */ - Stats::Formula demandMshrHits; + statistics::Formula demandMshrHits; /** Total number of misses that hit in the MSHRs. */ - Stats::Formula overallMshrHits; + statistics::Formula overallMshrHits; /** Demand misses that miss in the MSHRs. */ - Stats::Formula demandMshrMisses; + statistics::Formula demandMshrMisses; /** Total number of misses that miss in the MSHRs. */ - Stats::Formula overallMshrMisses; + statistics::Formula overallMshrMisses; /** Total number of misses that miss in the MSHRs. */ - Stats::Formula overallMshrUncacheable; + statistics::Formula overallMshrUncacheable; /** Total cycle latency of demand MSHR misses. */ - Stats::Formula demandMshrMissLatency; + statistics::Formula demandMshrMissLatency; /** Total cycle latency of overall MSHR misses. */ - Stats::Formula overallMshrMissLatency; + statistics::Formula overallMshrMissLatency; /** Total cycle latency of overall MSHR misses. */ - Stats::Formula overallMshrUncacheableLatency; + statistics::Formula overallMshrUncacheableLatency; /** The demand miss rate in the MSHRs. */ - Stats::Formula demandMshrMissRate; + statistics::Formula demandMshrMissRate; /** The overall miss rate in the MSHRs. */ - Stats::Formula overallMshrMissRate; + statistics::Formula overallMshrMissRate; /** The average latency of a demand MSHR miss. */ - Stats::Formula demandAvgMshrMissLatency; + statistics::Formula demandAvgMshrMissLatency; /** The average overall latency of an MSHR miss. */ - Stats::Formula overallAvgMshrMissLatency; + statistics::Formula overallAvgMshrMissLatency; /** The average overall latency of an MSHR miss. */ - Stats::Formula overallAvgMshrUncacheableLatency; + statistics::Formula overallAvgMshrUncacheableLatency; /** Number of replacements of valid blocks. */ - Stats::Scalar replacements; + statistics::Scalar replacements; /** Number of data expansions. */ - Stats::Scalar dataExpansions; + statistics::Scalar dataExpansions; /** * Number of data contractions (blocks that had their compression * factor improved). */ - Stats::Scalar dataContractions; + statistics::Scalar dataContractions; /** Per-command statistics */ std::vector> cmd; diff --git a/src/mem/cache/compressors/base.cc b/src/mem/cache/compressors/base.cc index 2a7b13d368..c17fc7d99d 100644 --- a/src/mem/cache/compressors/base.cc +++ b/src/mem/cache/compressors/base.cc @@ -229,20 +229,20 @@ Base::setSizeBits(CacheBlk* blk, const std::size_t size_bits) } Base::BaseStats::BaseStats(Base& _compressor) - : Stats::Group(&_compressor), compressor(_compressor), - ADD_STAT(compressions, Stats::units::Count::get(), + : statistics::Group(&_compressor), compressor(_compressor), + ADD_STAT(compressions, statistics::units::Count::get(), "Total number of compressions"), - ADD_STAT(failedCompressions, Stats::units::Count::get(), + ADD_STAT(failedCompressions, statistics::units::Count::get(), "Total number of failed compressions"), - ADD_STAT(compressionSize, Stats::units::Count::get(), + ADD_STAT(compressionSize, statistics::units::Count::get(), "Number of blocks that were compressed to this power of two " "size"), - ADD_STAT(compressionSizeBits, Stats::units::Bit::get(), + ADD_STAT(compressionSizeBits, statistics::units::Bit::get(), "Total compressed data size"), - ADD_STAT(avgCompressionSizeBits, Stats::units::Rate< - Stats::units::Bit, Stats::units::Count>::get(), + ADD_STAT(avgCompressionSizeBits, statistics::units::Rate< + statistics::units::Bit, statistics::units::Count>::get(), "Average compression size"), - ADD_STAT(decompressions, Stats::units::Count::get(), + ADD_STAT(decompressions, statistics::units::Count::get(), "Total number of decompressions") { } @@ -250,7 +250,7 @@ Base::BaseStats::BaseStats(Base& _compressor) void Base::BaseStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); // Values comprised are {0, 1, 2, 4, ..., blkSize} compressionSize.init(std::log2(compressor.blkSize*8) + 2); @@ -264,7 +264,8 @@ Base::BaseStats::regStats() "Number of blocks that compressed to fit in " + str_i + " bits"); } - avgCompressionSizeBits.flags(Stats::total | Stats::nozero | Stats::nonan); + avgCompressionSizeBits.flags(statistics::total | statistics::nozero | + statistics::nonan); avgCompressionSizeBits = compressionSizeBits / compressions; } diff --git a/src/mem/cache/compressors/base.hh b/src/mem/cache/compressors/base.hh index 4bf09500a6..c6b116b6c4 100644 --- a/src/mem/cache/compressors/base.hh +++ b/src/mem/cache/compressors/base.hh @@ -126,7 +126,7 @@ class Base : public SimObject /** Pointer to the parent cache. */ BaseCache* cache; - struct BaseStats : public Stats::Group + struct BaseStats : public statistics::Group { const Base& compressor; @@ -135,22 +135,22 @@ class Base : public SimObject void regStats() override; /** Number of compressions performed. */ - Stats::Scalar compressions; + statistics::Scalar compressions; /** Number of failed compressions. */ - Stats::Scalar failedCompressions; + statistics::Scalar failedCompressions; /** Number of blocks that were compressed to this power of two size. */ - Stats::Vector compressionSize; + statistics::Vector compressionSize; /** Total compressed data size, in number of bits. */ - Stats::Scalar compressionSizeBits; + statistics::Scalar compressionSizeBits; /** Average data size after compression, in number of bits. */ - Stats::Formula avgCompressionSizeBits; + statistics::Formula avgCompressionSizeBits; /** Number of decompressions performed. */ - Stats::Scalar decompressions; + statistics::Scalar decompressions; } stats; /** diff --git a/src/mem/cache/compressors/base_dictionary_compressor.cc b/src/mem/cache/compressors/base_dictionary_compressor.cc index 56a8c3cd3a..dc4461e71a 100644 --- a/src/mem/cache/compressors/base_dictionary_compressor.cc +++ b/src/mem/cache/compressors/base_dictionary_compressor.cc @@ -46,8 +46,8 @@ BaseDictionaryCompressor::BaseDictionaryCompressor(const Params &p) BaseDictionaryCompressor::DictionaryStats::DictionaryStats( BaseStats& base_group, BaseDictionaryCompressor& _compressor) - : Stats::Group(&base_group), compressor(_compressor), - ADD_STAT(patterns, Stats::units::Count::get(), + : statistics::Group(&base_group), compressor(_compressor), + ADD_STAT(patterns, statistics::units::Count::get(), "Number of data entries that were compressed to this pattern") { } @@ -55,7 +55,7 @@ BaseDictionaryCompressor::DictionaryStats::DictionaryStats( void BaseDictionaryCompressor::DictionaryStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); // We store the frequency of each pattern patterns.init(compressor.getNumPatterns()); diff --git a/src/mem/cache/compressors/dictionary_compressor.hh b/src/mem/cache/compressors/dictionary_compressor.hh index 1222d2a081..0f1c388f3d 100644 --- a/src/mem/cache/compressors/dictionary_compressor.hh +++ b/src/mem/cache/compressors/dictionary_compressor.hh @@ -71,7 +71,7 @@ class BaseDictionaryCompressor : public Base /** Number of valid entries in the dictionary. */ std::size_t numEntries; - struct DictionaryStats : public Stats::Group + struct DictionaryStats : public statistics::Group { const BaseDictionaryCompressor& compressor; @@ -81,7 +81,7 @@ class BaseDictionaryCompressor : public Base void regStats() override; /** Number of data entries that were compressed to each pattern. */ - Stats::Vector patterns; + statistics::Vector patterns; } dictionaryStats; /** diff --git a/src/mem/cache/compressors/multi.cc b/src/mem/cache/compressors/multi.cc index 98d7c32a27..c016142cb5 100644 --- a/src/mem/cache/compressors/multi.cc +++ b/src/mem/cache/compressors/multi.cc @@ -189,8 +189,8 @@ Multi::decompress(const CompressionData* comp_data, } Multi::MultiStats::MultiStats(BaseStats& base_group, Multi& _compressor) - : Stats::Group(&base_group), compressor(_compressor), - ADD_STAT(ranks, Stats::units::Count::get(), + : statistics::Group(&base_group), compressor(_compressor), + ADD_STAT(ranks, statistics::units::Count::get(), "Number of times each compressor had the nth best compression") { } @@ -198,7 +198,7 @@ Multi::MultiStats::MultiStats(BaseStats& base_group, Multi& _compressor) void Multi::MultiStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); const std::size_t num_compressors = compressor.compressors.size(); ranks.init(num_compressors, num_compressors); diff --git a/src/mem/cache/compressors/multi.hh b/src/mem/cache/compressors/multi.hh index ea71ee3f19..c73661aeff 100644 --- a/src/mem/cache/compressors/multi.hh +++ b/src/mem/cache/compressors/multi.hh @@ -84,7 +84,7 @@ class Multi : public Base */ const Cycles extraDecompressionLatency; - struct MultiStats : public Stats::Group + struct MultiStats : public statistics::Group { const Multi& compressor; @@ -95,7 +95,7 @@ class Multi : public Base /** * Number of times each compressor provided the nth best compression. */ - Stats::Vector2d ranks; + statistics::Vector2d ranks; } multiStats; public: diff --git a/src/mem/cache/prefetch/base.cc b/src/mem/cache/prefetch/base.cc index dcf8af6712..75362310ea 100644 --- a/src/mem/cache/prefetch/base.cc +++ b/src/mem/cache/prefetch/base.cc @@ -113,9 +113,11 @@ Base::setCache(BaseCache *_cache) blkSize = cache->getBlockSize(); lBlkSize = floorLog2(blkSize); } -Base::StatGroup::StatGroup(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(pfIssued, Stats::units::Count::get(), "number of hwpf issued") + +Base::StatGroup::StatGroup(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(pfIssued, statistics::units::Count::get(), + "number of hwpf issued") { } diff --git a/src/mem/cache/prefetch/base.hh b/src/mem/cache/prefetch/base.hh index 1042b6ec2a..4e08034c5e 100644 --- a/src/mem/cache/prefetch/base.hh +++ b/src/mem/cache/prefetch/base.hh @@ -321,10 +321,10 @@ class Base : public ClockedObject Addr pageOffset(Addr a) const; /** Build the address of the i-th block inside the page */ Addr pageIthBlockAddress(Addr page, uint32_t i) const; - struct StatGroup : public Stats::Group + struct StatGroup : public statistics::Group { - StatGroup(Stats::Group *parent); - Stats::Scalar pfIssued; + StatGroup(statistics::Group *parent); + statistics::Scalar pfIssued; } prefetchStats; /** Total prefetches issued */ diff --git a/src/mem/cache/prefetch/queued.cc b/src/mem/cache/prefetch/queued.cc index 609c828416..2a74a17a32 100644 --- a/src/mem/cache/prefetch/queued.cc +++ b/src/mem/cache/prefetch/queued.cc @@ -226,17 +226,18 @@ Queued::getPacket() processMissingTranslations(queueSize - pfq.size()); return pkt; } -Queued::QueuedStats::QueuedStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(pfIdentified, Stats::units::Count::get(), + +Queued::QueuedStats::QueuedStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(pfIdentified, statistics::units::Count::get(), "number of prefetch candidates identified"), - ADD_STAT(pfBufferHit, Stats::units::Count::get(), + ADD_STAT(pfBufferHit, statistics::units::Count::get(), "number of redundant prefetches already in prefetch queue"), - ADD_STAT(pfInCache, Stats::units::Count::get(), + ADD_STAT(pfInCache, statistics::units::Count::get(), "number of redundant prefetches already in cache/mshr dropped"), - ADD_STAT(pfRemovedFull, Stats::units::Count::get(), + ADD_STAT(pfRemovedFull, statistics::units::Count::get(), "number of prefetches dropped due to prefetch queue size"), - ADD_STAT(pfSpanPage, Stats::units::Count::get(), + ADD_STAT(pfSpanPage, statistics::units::Count::get(), "number of prefetches that crossed the page") { } diff --git a/src/mem/cache/prefetch/queued.hh b/src/mem/cache/prefetch/queued.hh index 25c8028b82..07b694061d 100644 --- a/src/mem/cache/prefetch/queued.hh +++ b/src/mem/cache/prefetch/queued.hh @@ -171,15 +171,15 @@ class Queued : public Base /** Percentage of requests that can be throttled */ const unsigned int throttleControlPct; - struct QueuedStats : public Stats::Group + struct QueuedStats : public statistics::Group { - QueuedStats(Stats::Group *parent); + QueuedStats(statistics::Group *parent); // STATS - Stats::Scalar pfIdentified; - Stats::Scalar pfBufferHit; - Stats::Scalar pfInCache; - Stats::Scalar pfRemovedFull; - Stats::Scalar pfSpanPage; + statistics::Scalar pfIdentified; + statistics::Scalar pfBufferHit; + statistics::Scalar pfInCache; + statistics::Scalar pfRemovedFull; + statistics::Scalar pfSpanPage; } statsQueued; public: using AddrPriority = std::pair; diff --git a/src/mem/cache/tags/base.cc b/src/mem/cache/tags/base.cc index f6b46842ba..1c0a6a7a17 100644 --- a/src/mem/cache/tags/base.cc +++ b/src/mem/cache/tags/base.cc @@ -213,36 +213,36 @@ BaseTags::print() } BaseTags::BaseTagStats::BaseTagStats(BaseTags &_tags) - : Stats::Group(&_tags), + : statistics::Group(&_tags), tags(_tags), - ADD_STAT(tagsInUse, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(tagsInUse, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average ticks per tags in use"), - ADD_STAT(totalRefs, Stats::units::Count::get(), + ADD_STAT(totalRefs, statistics::units::Count::get(), "Total number of references to valid blocks."), - ADD_STAT(sampledRefs, Stats::units::Count::get(), + ADD_STAT(sampledRefs, statistics::units::Count::get(), "Sample count of references to valid blocks."), - ADD_STAT(avgRefs, Stats::units::Rate< - Stats::units::Count, Stats::units::Count>::get(), + ADD_STAT(avgRefs, statistics::units::Rate< + statistics::units::Count, statistics::units::Count>::get(), "Average number of references to valid blocks."), - ADD_STAT(warmupTick, Stats::units::Tick::get(), + ADD_STAT(warmupTick, statistics::units::Tick::get(), "The tick when the warmup percentage was hit."), - ADD_STAT(occupancies, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(occupancies, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average occupied blocks per tick, per requestor"), - ADD_STAT(avgOccs, Stats::units::Rate< - Stats::units::Ratio, Stats::units::Tick>::get(), + ADD_STAT(avgOccs, statistics::units::Rate< + statistics::units::Ratio, statistics::units::Tick>::get(), "Average percentage of cache occupancy"), - ADD_STAT(occupanciesTaskId, Stats::units::Count::get(), + ADD_STAT(occupanciesTaskId, statistics::units::Count::get(), "Occupied blocks per task id"), - ADD_STAT(ageTaskId, Stats::units::Count::get(), + ADD_STAT(ageTaskId, statistics::units::Count::get(), "Occupied blocks per task id, per block age"), - ADD_STAT(ratioOccsTaskId, Stats::units::Ratio::get(), + ADD_STAT(ratioOccsTaskId, statistics::units::Ratio::get(), "Ratio of occupied blocks and all blocks, per task id"), - ADD_STAT(tagAccesses, Stats::units::Count::get(), + ADD_STAT(tagAccesses, statistics::units::Count::get(), "Number of tag accesses"), - ADD_STAT(dataAccesses, Stats::units::Count::get(), + ADD_STAT(dataAccesses, statistics::units::Count::get(), "Number of data accesses") { } @@ -250,9 +250,9 @@ BaseTags::BaseTagStats::BaseTagStats(BaseTags &_tags) void BaseTags::BaseTagStats::regStats() { - using namespace Stats; + using namespace statistics; - Stats::Group::regStats(); + statistics::Group::regStats(); System *system = tags.system; @@ -271,7 +271,7 @@ BaseTags::BaseTagStats::regStats() avgOccs.subname(i, system->getRequestorName(i)); } - avgOccs = occupancies / Stats::constant(tags.numBlocks); + avgOccs = occupancies / statistics::constant(tags.numBlocks); occupanciesTaskId .init(context_switch_task_id::NumTaskId) @@ -285,13 +285,13 @@ BaseTags::BaseTagStats::regStats() ratioOccsTaskId.flags(nozero); - ratioOccsTaskId = occupanciesTaskId / Stats::constant(tags.numBlocks); + ratioOccsTaskId = occupanciesTaskId / statistics::constant(tags.numBlocks); } void BaseTags::BaseTagStats::preDumpStats() { - Stats::Group::preDumpStats(); + statistics::Group::preDumpStats(); tags.computeStats(); } diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh index 7b187b5c3c..cc5dd990ed 100644 --- a/src/mem/cache/tags/base.hh +++ b/src/mem/cache/tags/base.hh @@ -102,7 +102,7 @@ class BaseTags : public ClockedObject /** * TODO: It would be good if these stats were acquired after warmup. */ - struct BaseTagStats : public Stats::Group + struct BaseTagStats : public statistics::Group { BaseTagStats(BaseTags &tags); @@ -112,46 +112,46 @@ class BaseTags : public ClockedObject BaseTags &tags; /** Per tick average of the number of tags that hold valid data. */ - Stats::Average tagsInUse; + statistics::Average tagsInUse; /** The total number of references to a block before it is replaced. */ - Stats::Scalar totalRefs; + statistics::Scalar totalRefs; /** * The number of reference counts sampled. This is different * from replacements because we sample all the valid blocks * when the simulator exits. */ - Stats::Scalar sampledRefs; + statistics::Scalar sampledRefs; /** * Average number of references to a block before is was replaced. * @todo This should change to an average stat once we have them. */ - Stats::Formula avgRefs; + statistics::Formula avgRefs; /** The tick that the warmup percentage was hit. 0 on failure. */ - Stats::Scalar warmupTick; + statistics::Scalar warmupTick; /** Average occupancy of each requestor using the cache */ - Stats::AverageVector occupancies; + statistics::AverageVector occupancies; /** Average occ % of each requestor using the cache */ - Stats::Formula avgOccs; + statistics::Formula avgOccs; /** Occupancy of each context/cpu using the cache */ - Stats::Vector occupanciesTaskId; + statistics::Vector occupanciesTaskId; /** Occupancy of each context/cpu using the cache */ - Stats::Vector2d ageTaskId; + statistics::Vector2d ageTaskId; /** Occ ratio of each context/cpu using the cache */ - Stats::Formula ratioOccsTaskId; + statistics::Formula ratioOccsTaskId; /** Number of tags consulted over all accesses. */ - Stats::Scalar tagAccesses; + statistics::Scalar tagAccesses; /** Number of data blocks consulted over all accesses. */ - Stats::Scalar dataAccesses; + statistics::Scalar dataAccesses; } stats; public: diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc index e256781512..53d12463b7 100644 --- a/src/mem/cache/tags/fa_lru.cc +++ b/src/mem/cache/tags/fa_lru.cc @@ -292,19 +292,19 @@ printSize(std::ostream &stream, size_t size) } FALRU::CacheTracking::CacheTracking(unsigned min_size, unsigned max_size, - unsigned block_size, Stats::Group *parent) - : Stats::Group(parent), + unsigned block_size, statistics::Group *parent) + : statistics::Group(parent), blkSize(block_size), minTrackedSize(min_size), numTrackedCaches(max_size > min_size ? floorLog2(max_size) - floorLog2(min_size) : 0), inAllCachesMask(mask(numTrackedCaches)), boundaries(numTrackedCaches), - ADD_STAT(hits, Stats::units::Count::get(), + ADD_STAT(hits, statistics::units::Count::get(), "The number of hits in each cache size."), - ADD_STAT(misses, Stats::units::Count::get(), + ADD_STAT(misses, statistics::units::Count::get(), "The number of misses in each cache size."), - ADD_STAT(accesses, Stats::units::Count::get(), + ADD_STAT(accesses, statistics::units::Count::get(), "The number of accesses to the FA LRU cache.") { fatal_if(numTrackedCaches > sizeof(CachesMask) * 8, diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh index 1d7e45abf6..9e45a26575 100644 --- a/src/mem/cache/tags/fa_lru.hh +++ b/src/mem/cache/tags/fa_lru.hh @@ -273,11 +273,11 @@ class FALRU : public BaseTags * caches from a set minimum size of interest up to the actual * cache size. */ - class CacheTracking : public Stats::Group + class CacheTracking : public statistics::Group { public: CacheTracking(unsigned min_size, unsigned max_size, - unsigned block_size, Stats::Group *parent); + unsigned block_size, statistics::Group *parent); /** * Initialiaze cache blocks and the tracking mechanism @@ -356,11 +356,11 @@ class FALRU : public BaseTags */ /** Hits in each cache */ - Stats::Vector hits; + statistics::Vector hits; /** Misses in each cache */ - Stats::Vector misses; + statistics::Vector misses; /** Total number of accesses */ - Stats::Scalar accesses; + statistics::Scalar accesses; /** * @} diff --git a/src/mem/cache/tags/sector_tags.cc b/src/mem/cache/tags/sector_tags.cc index a4ec0bfa9f..eecd026786 100644 --- a/src/mem/cache/tags/sector_tags.cc +++ b/src/mem/cache/tags/sector_tags.cc @@ -337,8 +337,8 @@ SectorTags::regenerateBlkAddr(const CacheBlk* blk) const SectorTags::SectorTagsStats::SectorTagsStats(BaseTagStats &base_group, SectorTags& _tags) - : Stats::Group(&base_group), tags(_tags), - ADD_STAT(evictionsReplacement, Stats::units::Count::get(), + : statistics::Group(&base_group), tags(_tags), + ADD_STAT(evictionsReplacement, statistics::units::Count::get(), "Number of blocks evicted due to a replacement") { } @@ -346,7 +346,7 @@ SectorTags::SectorTagsStats::SectorTagsStats(BaseTagStats &base_group, void SectorTags::SectorTagsStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); evictionsReplacement.init(tags.numBlocksPerSector + 1); for (unsigned i = 0; i <= tags.numBlocksPerSector; ++i) { diff --git a/src/mem/cache/tags/sector_tags.hh b/src/mem/cache/tags/sector_tags.hh index ba142c73e7..f19a4a7b71 100644 --- a/src/mem/cache/tags/sector_tags.hh +++ b/src/mem/cache/tags/sector_tags.hh @@ -91,7 +91,7 @@ class SectorTags : public BaseTags /** Mask out all bits that aren't part of the sector tag. */ const unsigned sectorMask; - struct SectorTagsStats : public Stats::Group + struct SectorTagsStats : public statistics::Group { const SectorTags& tags; @@ -100,7 +100,7 @@ class SectorTags : public BaseTags void regStats() override; /** Number of sub-blocks evicted due to a replacement. */ - Stats::Vector evictionsReplacement; + statistics::Vector evictionsReplacement; } sectorStats; public: diff --git a/src/mem/coherent_xbar.cc b/src/mem/coherent_xbar.cc index d97bff8920..a44fa73855 100644 --- a/src/mem/coherent_xbar.cc +++ b/src/mem/coherent_xbar.cc @@ -60,9 +60,9 @@ CoherentXBar::CoherentXBar(const CoherentXBarParams &p) pointOfCoherency(p.point_of_coherency), pointOfUnification(p.point_of_unification), - ADD_STAT(snoops, Stats::units::Count::get(), "Total snoops"), - ADD_STAT(snoopTraffic, Stats::units::Byte::get(), "Total snoop traffic"), - ADD_STAT(snoopFanout, Stats::units::Count::get(), + ADD_STAT(snoops, statistics::units::Count::get(), "Total snoops"), + ADD_STAT(snoopTraffic, statistics::units::Byte::get(), "Total snoop traffic"), + ADD_STAT(snoopFanout, statistics::units::Count::get(), "Request fanout histogram") { // create the ports based on the size of the memory-side port and diff --git a/src/mem/coherent_xbar.hh b/src/mem/coherent_xbar.hh index 0295c4495d..b657a11f33 100644 --- a/src/mem/coherent_xbar.hh +++ b/src/mem/coherent_xbar.hh @@ -415,9 +415,9 @@ class CoherentXBar : public BaseXBar (pkt->req->isToPOU() && pointOfUnification); } - Stats::Scalar snoops; - Stats::Scalar snoopTraffic; - Stats::Distribution snoopFanout; + statistics::Scalar snoops; + statistics::Scalar snoopTraffic; + statistics::Distribution snoopFanout; public: diff --git a/src/mem/comm_monitor.cc b/src/mem/comm_monitor.cc index 765ccd4fdc..0032a8bf97 100644 --- a/src/mem/comm_monitor.cc +++ b/src/mem/comm_monitor.cc @@ -96,80 +96,80 @@ CommMonitor::recvFunctionalSnoop(PacketPtr pkt) cpuSidePort.sendFunctionalSnoop(pkt); } -CommMonitor::MonitorStats::MonitorStats(Stats::Group *parent, +CommMonitor::MonitorStats::MonitorStats(statistics::Group *parent, const CommMonitorParams ¶ms) - : Stats::Group(parent), + : statistics::Group(parent), disableBurstLengthHists(params.disable_burst_length_hists), - ADD_STAT(readBurstLengthHist, Stats::units::Byte::get(), + ADD_STAT(readBurstLengthHist, statistics::units::Byte::get(), "Histogram of burst lengths of transmitted packets"), - ADD_STAT(writeBurstLengthHist, Stats::units::Byte::get(), + ADD_STAT(writeBurstLengthHist, statistics::units::Byte::get(), "Histogram of burst lengths of transmitted packets"), disableBandwidthHists(params.disable_bandwidth_hists), readBytes(0), - ADD_STAT(readBandwidthHist, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(readBandwidthHist, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Histogram of read bandwidth per sample period"), - ADD_STAT(totalReadBytes, Stats::units::Byte::get(), + ADD_STAT(totalReadBytes, statistics::units::Byte::get(), "Number of bytes read"), - ADD_STAT(averageReadBandwidth, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(averageReadBandwidth, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average read bandwidth", totalReadBytes / simSeconds), writtenBytes(0), - ADD_STAT(writeBandwidthHist, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(writeBandwidthHist, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Histogram of write bandwidth"), - ADD_STAT(totalWrittenBytes, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(totalWrittenBytes, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Number of bytes written"), - ADD_STAT(averageWriteBandwidth, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(averageWriteBandwidth, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average write bandwidth", totalWrittenBytes / simSeconds), disableLatencyHists(params.disable_latency_hists), - ADD_STAT(readLatencyHist, Stats::units::Tick::get(), + ADD_STAT(readLatencyHist, statistics::units::Tick::get(), "Read request-response latency"), - ADD_STAT(writeLatencyHist, Stats::units::Tick::get(), + ADD_STAT(writeLatencyHist, statistics::units::Tick::get(), "Write request-response latency"), disableITTDists(params.disable_itt_dists), - ADD_STAT(ittReadRead, Stats::units::Tick::get(), + ADD_STAT(ittReadRead, statistics::units::Tick::get(), "Read-to-read inter transaction time"), - ADD_STAT(ittWriteWrite, Stats::units::Tick::get(), + ADD_STAT(ittWriteWrite, statistics::units::Tick::get(), "Write-to-write inter transaction time"), - ADD_STAT(ittReqReq, Stats::units::Tick::get(), + ADD_STAT(ittReqReq, statistics::units::Tick::get(), "Request-to-request inter transaction time"), timeOfLastRead(0), timeOfLastWrite(0), timeOfLastReq(0), disableOutstandingHists(params.disable_outstanding_hists), - ADD_STAT(outstandingReadsHist, Stats::units::Count::get(), + ADD_STAT(outstandingReadsHist, statistics::units::Count::get(), "Outstanding read transactions"), outstandingReadReqs(0), - ADD_STAT(outstandingWritesHist, Stats::units::Count::get(), + ADD_STAT(outstandingWritesHist, statistics::units::Count::get(), "Outstanding write transactions"), outstandingWriteReqs(0), disableTransactionHists(params.disable_transaction_hists), - ADD_STAT(readTransHist, Stats::units::Count::get(), + ADD_STAT(readTransHist, statistics::units::Count::get(), "Histogram of read transactions per sample period"), readTrans(0), - ADD_STAT(writeTransHist, Stats::units::Count::get(), + ADD_STAT(writeTransHist, statistics::units::Count::get(), "Histogram of write transactions per sample period"), writeTrans(0), disableAddrDists(params.disable_addr_dists), readAddrMask(params.read_addr_mask), writeAddrMask(params.write_addr_mask), - ADD_STAT(readAddrDist, Stats::units::Count::get(), + ADD_STAT(readAddrDist, statistics::units::Count::get(), "Read address distribution"), - ADD_STAT(writeAddrDist, Stats::units::Count::get(), + ADD_STAT(writeAddrDist, statistics::units::Count::get(), "Write address distribution") { - using namespace Stats; + using namespace statistics; readBurstLengthHist .init(params.burst_length_bins) diff --git a/src/mem/comm_monitor.hh b/src/mem/comm_monitor.hh index fd0e9b0899..80664c7040 100644 --- a/src/mem/comm_monitor.hh +++ b/src/mem/comm_monitor.hh @@ -267,16 +267,16 @@ class CommMonitor : public SimObject bool tryTiming(PacketPtr pkt); /** Stats declarations, all in a struct for convenience. */ - struct MonitorStats : public Stats::Group + struct MonitorStats : public statistics::Group { /** Disable flag for burst length histograms **/ bool disableBurstLengthHists; /** Histogram of read burst lengths */ - Stats::Histogram readBurstLengthHist; + statistics::Histogram readBurstLengthHist; /** Histogram of write burst lengths */ - Stats::Histogram writeBurstLengthHist; + statistics::Histogram writeBurstLengthHist; /** Disable flag for the bandwidth histograms */ bool disableBandwidthHists; @@ -286,27 +286,27 @@ class CommMonitor : public SimObject * internal counter is an unsigned int rather than a stat. */ unsigned int readBytes; - Stats::Histogram readBandwidthHist; - Stats::Scalar totalReadBytes; - Stats::Formula averageReadBandwidth; + statistics::Histogram readBandwidthHist; + statistics::Scalar totalReadBytes; + statistics::Formula averageReadBandwidth; /** * Histogram for write bandwidth per sample window. The * internal counter is an unsigned int rather than a stat. */ unsigned int writtenBytes; - Stats::Histogram writeBandwidthHist; - Stats::Scalar totalWrittenBytes; - Stats::Formula averageWriteBandwidth; + statistics::Histogram writeBandwidthHist; + statistics::Scalar totalWrittenBytes; + statistics::Formula averageWriteBandwidth; /** Disable flag for latency histograms. */ bool disableLatencyHists; /** Histogram of read request-to-response latencies */ - Stats::Histogram readLatencyHist; + statistics::Histogram readLatencyHist; /** Histogram of write request-to-response latencies */ - Stats::Histogram writeLatencyHist; + statistics::Histogram writeLatencyHist; /** Disable flag for ITT distributions. */ bool disableITTDists; @@ -317,9 +317,9 @@ class CommMonitor : public SimObject * accesses. The time of a request is the tick at which the * request is forwarded by the monitor. */ - Stats::Distribution ittReadRead; - Stats::Distribution ittWriteWrite; - Stats::Distribution ittReqReq; + statistics::Distribution ittReadRead; + statistics::Distribution ittWriteWrite; + statistics::Distribution ittReqReq; Tick timeOfLastRead; Tick timeOfLastWrite; Tick timeOfLastReq; @@ -332,7 +332,7 @@ class CommMonitor : public SimObject * outstanding read requests is an unsigned integer because * it should not be reset when stats are reset. */ - Stats::Histogram outstandingReadsHist; + statistics::Histogram outstandingReadsHist; unsigned int outstandingReadReqs; /** @@ -340,18 +340,18 @@ class CommMonitor : public SimObject * outstanding write requests is an unsigned integer because * it should not be reset when stats are reset. */ - Stats::Histogram outstandingWritesHist; + statistics::Histogram outstandingWritesHist; unsigned int outstandingWriteReqs; /** Disable flag for transaction histograms. */ bool disableTransactionHists; /** Histogram of number of read transactions per time bin */ - Stats::Histogram readTransHist; + statistics::Histogram readTransHist; unsigned int readTrans; /** Histogram of number of timing write transactions per time bin */ - Stats::Histogram writeTransHist; + statistics::Histogram writeTransHist; unsigned int writeTrans; /** Disable flag for address distributions. */ @@ -367,20 +367,21 @@ class CommMonitor : public SimObject * Histogram of number of read accesses to addresses over * time. */ - Stats::SparseHistogram readAddrDist; + statistics::SparseHistogram readAddrDist; /** * Histogram of number of write accesses to addresses over * time. */ - Stats::SparseHistogram writeAddrDist; + statistics::SparseHistogram writeAddrDist; /** * Create the monitor stats and initialise all the members * that are not statistics themselves, but used to control the * stats or track values during a sample period. */ - MonitorStats(Stats::Group *parent, const CommMonitorParams ¶ms); + MonitorStats(statistics::Group *parent, + const CommMonitorParams ¶ms); void updateReqStats(const probing::PacketInfo& pkt, bool is_atomic, bool expects_response); diff --git a/src/mem/mem_ctrl.cc b/src/mem/mem_ctrl.cc index a7e7dadd02..f663fa7dcf 100644 --- a/src/mem/mem_ctrl.cc +++ b/src/mem/mem_ctrl.cc @@ -1182,106 +1182,105 @@ MemCtrl::burstAlign(Addr addr, bool is_dram) const } MemCtrl::CtrlStats::CtrlStats(MemCtrl &_ctrl) - : Stats::Group(&_ctrl), + : statistics::Group(&_ctrl), ctrl(_ctrl), - ADD_STAT(readReqs, Stats::units::Count::get(), + ADD_STAT(readReqs, statistics::units::Count::get(), "Number of read requests accepted"), - ADD_STAT(writeReqs, Stats::units::Count::get(), + ADD_STAT(writeReqs, statistics::units::Count::get(), "Number of write requests accepted"), - ADD_STAT(readBursts, Stats::units::Count::get(), + ADD_STAT(readBursts, statistics::units::Count::get(), "Number of controller read bursts, including those serviced by " "the write queue"), - ADD_STAT(writeBursts, Stats::units::Count::get(), + ADD_STAT(writeBursts, statistics::units::Count::get(), "Number of controller write bursts, including those merged in " "the write queue"), - ADD_STAT(servicedByWrQ, Stats::units::Count::get(), + ADD_STAT(servicedByWrQ, statistics::units::Count::get(), "Number of controller read bursts serviced by the write queue"), - ADD_STAT(mergedWrBursts, Stats::units::Count::get(), + ADD_STAT(mergedWrBursts, statistics::units::Count::get(), "Number of controller write bursts merged with an existing one"), - ADD_STAT(neitherReadNorWriteReqs, Stats::units::Count::get(), + ADD_STAT(neitherReadNorWriteReqs, statistics::units::Count::get(), "Number of requests that are neither read nor write"), - ADD_STAT(avgRdQLen, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(avgRdQLen, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average read queue length when enqueuing"), - ADD_STAT(avgWrQLen, Stats::units::Rate< - Stats::units::Count, Stats::units::Tick>::get(), + ADD_STAT(avgWrQLen, statistics::units::Rate< + statistics::units::Count, statistics::units::Tick>::get(), "Average write queue length when enqueuing"), - ADD_STAT(numRdRetry, Stats::units::Count::get(), + ADD_STAT(numRdRetry, statistics::units::Count::get(), "Number of times read queue was full causing retry"), - ADD_STAT(numWrRetry, Stats::units::Count::get(), + ADD_STAT(numWrRetry, statistics::units::Count::get(), "Number of times write queue was full causing retry"), - ADD_STAT(readPktSize, Stats::units::Count::get(), + ADD_STAT(readPktSize, statistics::units::Count::get(), "Read request sizes (log2)"), - ADD_STAT(writePktSize, Stats::units::Count::get(), + ADD_STAT(writePktSize, statistics::units::Count::get(), "Write request sizes (log2)"), - ADD_STAT(rdQLenPdf, Stats::units::Count::get(), + ADD_STAT(rdQLenPdf, statistics::units::Count::get(), "What read queue length does an incoming req see"), - ADD_STAT(wrQLenPdf, Stats::units::Count::get(), + ADD_STAT(wrQLenPdf, statistics::units::Count::get(), "What write queue length does an incoming req see"), - ADD_STAT(rdPerTurnAround, Stats::units::Count::get(), + ADD_STAT(rdPerTurnAround, statistics::units::Count::get(), "Reads before turning the bus around for writes"), - ADD_STAT(wrPerTurnAround, Stats::units::Count::get(), + ADD_STAT(wrPerTurnAround, statistics::units::Count::get(), "Writes before turning the bus around for reads"), - ADD_STAT(bytesReadWrQ, Stats::units::Byte::get(), + ADD_STAT(bytesReadWrQ, statistics::units::Byte::get(), "Total number of bytes read from write queue"), - ADD_STAT(bytesReadSys, Stats::units::Byte::get(), + ADD_STAT(bytesReadSys, statistics::units::Byte::get(), "Total read bytes from the system interface side"), - ADD_STAT(bytesWrittenSys, Stats::units::Byte::get(), + ADD_STAT(bytesWrittenSys, statistics::units::Byte::get(), "Total written bytes from the system interface side"), - ADD_STAT(avgRdBWSys, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(avgRdBWSys, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average system read bandwidth in Byte/s"), - ADD_STAT(avgWrBWSys, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(avgWrBWSys, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average system write bandwidth in Byte/s"), - ADD_STAT(totGap, Stats::units::Tick::get(), "Total gap between requests"), - ADD_STAT(avgGap, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(totGap, statistics::units::Tick::get(), "Total gap between requests"), + ADD_STAT(avgGap, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average gap between requests"), - ADD_STAT(requestorReadBytes, Stats::units::Byte::get(), + ADD_STAT(requestorReadBytes, statistics::units::Byte::get(), "Per-requestor bytes read from memory"), - ADD_STAT(requestorWriteBytes, Stats::units::Byte::get(), + ADD_STAT(requestorWriteBytes, statistics::units::Byte::get(), "Per-requestor bytes write to memory"), - ADD_STAT(requestorReadRate, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(requestorReadRate, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Per-requestor bytes read from memory rate"), - ADD_STAT(requestorWriteRate, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(requestorWriteRate, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Per-requestor bytes write to memory rate"), - ADD_STAT(requestorReadAccesses, Stats::units::Count::get(), + ADD_STAT(requestorReadAccesses, statistics::units::Count::get(), "Per-requestor read serviced memory accesses"), - ADD_STAT(requestorWriteAccesses, Stats::units::Count::get(), + ADD_STAT(requestorWriteAccesses, statistics::units::Count::get(), "Per-requestor write serviced memory accesses"), - ADD_STAT(requestorReadTotalLat, Stats::units::Tick::get(), + ADD_STAT(requestorReadTotalLat, statistics::units::Tick::get(), "Per-requestor read total memory access latency"), - ADD_STAT(requestorWriteTotalLat, Stats::units::Tick::get(), + ADD_STAT(requestorWriteTotalLat, statistics::units::Tick::get(), "Per-requestor write total memory access latency"), - ADD_STAT(requestorReadAvgLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(requestorReadAvgLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Per-requestor read average memory access latency"), - ADD_STAT(requestorWriteAvgLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(requestorWriteAvgLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Per-requestor write average memory access latency") - { } void MemCtrl::CtrlStats::regStats() { - using namespace Stats; + using namespace statistics; assert(ctrl.system()); const auto max_requestors = ctrl.system()->maxRequestors(); diff --git a/src/mem/mem_ctrl.hh b/src/mem/mem_ctrl.hh index d63e021b66..c96f536e1e 100644 --- a/src/mem/mem_ctrl.hh +++ b/src/mem/mem_ctrl.hh @@ -525,7 +525,7 @@ class MemCtrl : public qos::MemCtrl */ Tick nextReqTime; - struct CtrlStats : public Stats::Group + struct CtrlStats : public statistics::Group { CtrlStats(MemCtrl &ctrl); @@ -534,55 +534,55 @@ class MemCtrl : public qos::MemCtrl MemCtrl &ctrl; // All statistics that the model needs to capture - Stats::Scalar readReqs; - Stats::Scalar writeReqs; - Stats::Scalar readBursts; - Stats::Scalar writeBursts; - Stats::Scalar servicedByWrQ; - Stats::Scalar mergedWrBursts; - Stats::Scalar neitherReadNorWriteReqs; + statistics::Scalar readReqs; + statistics::Scalar writeReqs; + statistics::Scalar readBursts; + statistics::Scalar writeBursts; + statistics::Scalar servicedByWrQ; + statistics::Scalar mergedWrBursts; + statistics::Scalar neitherReadNorWriteReqs; // Average queue lengths - Stats::Average avgRdQLen; - Stats::Average avgWrQLen; + statistics::Average avgRdQLen; + statistics::Average avgWrQLen; - Stats::Scalar numRdRetry; - Stats::Scalar numWrRetry; - Stats::Vector readPktSize; - Stats::Vector writePktSize; - Stats::Vector rdQLenPdf; - Stats::Vector wrQLenPdf; - Stats::Histogram rdPerTurnAround; - Stats::Histogram wrPerTurnAround; + statistics::Scalar numRdRetry; + statistics::Scalar numWrRetry; + statistics::Vector readPktSize; + statistics::Vector writePktSize; + statistics::Vector rdQLenPdf; + statistics::Vector wrQLenPdf; + statistics::Histogram rdPerTurnAround; + statistics::Histogram wrPerTurnAround; - Stats::Scalar bytesReadWrQ; - Stats::Scalar bytesReadSys; - Stats::Scalar bytesWrittenSys; + statistics::Scalar bytesReadWrQ; + statistics::Scalar bytesReadSys; + statistics::Scalar bytesWrittenSys; // Average bandwidth - Stats::Formula avgRdBWSys; - Stats::Formula avgWrBWSys; + statistics::Formula avgRdBWSys; + statistics::Formula avgWrBWSys; - Stats::Scalar totGap; - Stats::Formula avgGap; + statistics::Scalar totGap; + statistics::Formula avgGap; // per-requestor bytes read and written to memory - Stats::Vector requestorReadBytes; - Stats::Vector requestorWriteBytes; + statistics::Vector requestorReadBytes; + statistics::Vector requestorWriteBytes; // per-requestor bytes read and written to memory rate - Stats::Formula requestorReadRate; - Stats::Formula requestorWriteRate; + statistics::Formula requestorReadRate; + statistics::Formula requestorWriteRate; // per-requestor read and write serviced memory accesses - Stats::Vector requestorReadAccesses; - Stats::Vector requestorWriteAccesses; + statistics::Vector requestorReadAccesses; + statistics::Vector requestorWriteAccesses; // per-requestor read and write total memory access latency - Stats::Vector requestorReadTotalLat; - Stats::Vector requestorWriteTotalLat; + statistics::Vector requestorReadTotalLat; + statistics::Vector requestorWriteTotalLat; // per-requestor raed and write average memory access latency - Stats::Formula requestorReadAvgLat; - Stats::Formula requestorWriteAvgLat; + statistics::Formula requestorReadAvgLat; + statistics::Formula requestorWriteAvgLat; }; CtrlStats stats; diff --git a/src/mem/mem_interface.cc b/src/mem/mem_interface.cc index d3281c1158..2a2ae18905 100644 --- a/src/mem/mem_interface.cc +++ b/src/mem/mem_interface.cc @@ -1846,69 +1846,69 @@ DRAMInterface::DRAMStats::resetStats() } DRAMInterface::DRAMStats::DRAMStats(DRAMInterface &_dram) - : Stats::Group(&_dram), + : statistics::Group(&_dram), dram(_dram), - ADD_STAT(readBursts, Stats::units::Count::get(), + ADD_STAT(readBursts, statistics::units::Count::get(), "Number of DRAM read bursts"), - ADD_STAT(writeBursts, Stats::units::Count::get(), + ADD_STAT(writeBursts, statistics::units::Count::get(), "Number of DRAM write bursts"), - ADD_STAT(perBankRdBursts, Stats::units::Count::get(), + ADD_STAT(perBankRdBursts, statistics::units::Count::get(), "Per bank write bursts"), - ADD_STAT(perBankWrBursts, Stats::units::Count::get(), + ADD_STAT(perBankWrBursts, statistics::units::Count::get(), "Per bank write bursts"), - ADD_STAT(totQLat, Stats::units::Tick::get(), "Total ticks spent queuing"), - ADD_STAT(totBusLat, Stats::units::Tick::get(), + ADD_STAT(totQLat, statistics::units::Tick::get(), "Total ticks spent queuing"), + ADD_STAT(totBusLat, statistics::units::Tick::get(), "Total ticks spent in databus transfers"), - ADD_STAT(totMemAccLat, Stats::units::Tick::get(), + ADD_STAT(totMemAccLat, statistics::units::Tick::get(), "Total ticks spent from burst creation until serviced " "by the DRAM"), - ADD_STAT(avgQLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgQLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average queueing delay per DRAM burst"), - ADD_STAT(avgBusLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgBusLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average bus latency per DRAM burst"), - ADD_STAT(avgMemAccLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgMemAccLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average memory access latency per DRAM burst"), - ADD_STAT(readRowHits, Stats::units::Count::get(), + ADD_STAT(readRowHits, statistics::units::Count::get(), "Number of row buffer hits during reads"), - ADD_STAT(writeRowHits, Stats::units::Count::get(), + ADD_STAT(writeRowHits, statistics::units::Count::get(), "Number of row buffer hits during writes"), - ADD_STAT(readRowHitRate, Stats::units::Ratio::get(), + ADD_STAT(readRowHitRate, statistics::units::Ratio::get(), "Row buffer hit rate for reads"), - ADD_STAT(writeRowHitRate, Stats::units::Ratio::get(), + ADD_STAT(writeRowHitRate, statistics::units::Ratio::get(), "Row buffer hit rate for writes"), - ADD_STAT(bytesPerActivate, Stats::units::Byte::get(), + ADD_STAT(bytesPerActivate, statistics::units::Byte::get(), "Bytes accessed per row activation"), - ADD_STAT(bytesRead, Stats::units::Byte::get(), + ADD_STAT(bytesRead, statistics::units::Byte::get(), "Total number of bytes read from DRAM"), - ADD_STAT(bytesWritten, Stats::units::Byte::get(), + ADD_STAT(bytesWritten, statistics::units::Byte::get(), "Total number of bytes written to DRAM"), - ADD_STAT(avgRdBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(avgRdBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average DRAM read bandwidth in MiBytes/s"), - ADD_STAT(avgWrBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(avgWrBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average DRAM write bandwidth in MiBytes/s"), - ADD_STAT(peakBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(peakBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Theoretical peak bandwidth in MiByte/s"), - ADD_STAT(busUtil, Stats::units::Ratio::get(), + ADD_STAT(busUtil, statistics::units::Ratio::get(), "Data bus utilization in percentage"), - ADD_STAT(busUtilRead, Stats::units::Ratio::get(), + ADD_STAT(busUtilRead, statistics::units::Ratio::get(), "Data bus utilization in percentage for reads"), - ADD_STAT(busUtilWrite, Stats::units::Ratio::get(), + ADD_STAT(busUtilWrite, statistics::units::Ratio::get(), "Data bus utilization in percentage for writes"), - ADD_STAT(pageHitRate, Stats::units::Ratio::get(), + ADD_STAT(pageHitRate, statistics::units::Ratio::get(), "Row buffer hit rate, read and write combined") { @@ -1917,7 +1917,7 @@ DRAMInterface::DRAMStats::DRAMStats(DRAMInterface &_dram) void DRAMInterface::DRAMStats::regStats() { - using namespace Stats; + using namespace statistics; avgQLat.precision(2); avgBusLat.precision(2); @@ -1963,38 +1963,38 @@ DRAMInterface::DRAMStats::regStats() } DRAMInterface::RankStats::RankStats(DRAMInterface &_dram, Rank &_rank) - : Stats::Group(&_dram, csprintf("rank%d", _rank.rank).c_str()), + : statistics::Group(&_dram, csprintf("rank%d", _rank.rank).c_str()), rank(_rank), - ADD_STAT(actEnergy, Stats::units::Joule::get(), + ADD_STAT(actEnergy, statistics::units::Joule::get(), "Energy for activate commands per rank (pJ)"), - ADD_STAT(preEnergy, Stats::units::Joule::get(), + ADD_STAT(preEnergy, statistics::units::Joule::get(), "Energy for precharge commands per rank (pJ)"), - ADD_STAT(readEnergy, Stats::units::Joule::get(), + ADD_STAT(readEnergy, statistics::units::Joule::get(), "Energy for read commands per rank (pJ)"), - ADD_STAT(writeEnergy, Stats::units::Joule::get(), + ADD_STAT(writeEnergy, statistics::units::Joule::get(), "Energy for write commands per rank (pJ)"), - ADD_STAT(refreshEnergy, Stats::units::Joule::get(), + ADD_STAT(refreshEnergy, statistics::units::Joule::get(), "Energy for refresh commands per rank (pJ)"), - ADD_STAT(actBackEnergy, Stats::units::Joule::get(), + ADD_STAT(actBackEnergy, statistics::units::Joule::get(), "Energy for active background per rank (pJ)"), - ADD_STAT(preBackEnergy, Stats::units::Joule::get(), + ADD_STAT(preBackEnergy, statistics::units::Joule::get(), "Energy for precharge background per rank (pJ)"), - ADD_STAT(actPowerDownEnergy, Stats::units::Joule::get(), + ADD_STAT(actPowerDownEnergy, statistics::units::Joule::get(), "Energy for active power-down per rank (pJ)"), - ADD_STAT(prePowerDownEnergy, Stats::units::Joule::get(), + ADD_STAT(prePowerDownEnergy, statistics::units::Joule::get(), "Energy for precharge power-down per rank (pJ)"), - ADD_STAT(selfRefreshEnergy, Stats::units::Joule::get(), + ADD_STAT(selfRefreshEnergy, statistics::units::Joule::get(), "Energy for self refresh per rank (pJ)"), - ADD_STAT(totalEnergy, Stats::units::Joule::get(), + ADD_STAT(totalEnergy, statistics::units::Joule::get(), "Total energy per rank (pJ)"), - ADD_STAT(averagePower, Stats::units::Watt::get(), + ADD_STAT(averagePower, statistics::units::Watt::get(), "Core power per rank (mW)"), - ADD_STAT(totalIdleTime, Stats::units::Tick::get(), + ADD_STAT(totalIdleTime, statistics::units::Tick::get(), "Total Idle time Per DRAM Rank"), - ADD_STAT(pwrStateTime, Stats::units::Tick::get(), + ADD_STAT(pwrStateTime, statistics::units::Tick::get(), "Time in different power states") { } @@ -2002,7 +2002,7 @@ DRAMInterface::RankStats::RankStats(DRAMInterface &_dram, Rank &_rank) void DRAMInterface::RankStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); pwrStateTime .init(6) @@ -2017,7 +2017,7 @@ DRAMInterface::RankStats::regStats() void DRAMInterface::RankStats::resetStats() { - Stats::Group::resetStats(); + statistics::Group::resetStats(); rank.resetStats(); } @@ -2025,7 +2025,7 @@ DRAMInterface::RankStats::resetStats() void DRAMInterface::RankStats::preDumpStats() { - Stats::Group::preDumpStats(); + statistics::Group::preDumpStats(); rank.computeStats(); } @@ -2513,60 +2513,60 @@ NVMInterface::isBusy(bool read_queue_empty, bool all_writes_nvm) NVMInterface::NVMStats::NVMStats(NVMInterface &_nvm) - : Stats::Group(&_nvm), + : statistics::Group(&_nvm), nvm(_nvm), - ADD_STAT(readBursts, Stats::units::Count::get(), + ADD_STAT(readBursts, statistics::units::Count::get(), "Number of NVM read bursts"), - ADD_STAT(writeBursts, Stats::units::Count::get(), + ADD_STAT(writeBursts, statistics::units::Count::get(), "Number of NVM write bursts"), - ADD_STAT(perBankRdBursts, Stats::units::Count::get(), + ADD_STAT(perBankRdBursts, statistics::units::Count::get(), "Per bank write bursts"), - ADD_STAT(perBankWrBursts, Stats::units::Count::get(), + ADD_STAT(perBankWrBursts, statistics::units::Count::get(), "Per bank write bursts"), - ADD_STAT(totQLat, Stats::units::Tick::get(), "Total ticks spent queuing"), - ADD_STAT(totBusLat, Stats::units::Tick::get(), + ADD_STAT(totQLat, statistics::units::Tick::get(), "Total ticks spent queuing"), + ADD_STAT(totBusLat, statistics::units::Tick::get(), "Total ticks spent in databus transfers"), - ADD_STAT(totMemAccLat, Stats::units::Tick::get(), + ADD_STAT(totMemAccLat, statistics::units::Tick::get(), "Total ticks spent from burst creation until serviced " "by the NVM"), - ADD_STAT(avgQLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgQLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average queueing delay per NVM burst"), - ADD_STAT(avgBusLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgBusLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average bus latency per NVM burst"), - ADD_STAT(avgMemAccLat, Stats::units::Rate< - Stats::units::Tick, Stats::units::Count>::get(), + ADD_STAT(avgMemAccLat, statistics::units::Rate< + statistics::units::Tick, statistics::units::Count>::get(), "Average memory access latency per NVM burst"), - ADD_STAT(bytesRead, Stats::units::Byte::get(), + ADD_STAT(bytesRead, statistics::units::Byte::get(), "Total number of bytes read from DRAM"), - ADD_STAT(bytesWritten, Stats::units::Byte::get(), + ADD_STAT(bytesWritten, statistics::units::Byte::get(), "Total number of bytes written to DRAM"), - ADD_STAT(avgRdBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(avgRdBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average DRAM read bandwidth in MiBytes/s"), - ADD_STAT(avgWrBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(avgWrBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Average DRAM write bandwidth in MiBytes/s"), - ADD_STAT(peakBW, Stats::units::Rate< - Stats::units::Byte, Stats::units::Second>::get(), + ADD_STAT(peakBW, statistics::units::Rate< + statistics::units::Byte, statistics::units::Second>::get(), "Theoretical peak bandwidth in MiByte/s"), - ADD_STAT(busUtil, Stats::units::Ratio::get(), + ADD_STAT(busUtil, statistics::units::Ratio::get(), "NVM Data bus utilization in percentage"), - ADD_STAT(busUtilRead, Stats::units::Ratio::get(), + ADD_STAT(busUtilRead, statistics::units::Ratio::get(), "NVM Data bus read utilization in percentage"), - ADD_STAT(busUtilWrite, Stats::units::Ratio::get(), + ADD_STAT(busUtilWrite, statistics::units::Ratio::get(), "NVM Data bus write utilization in percentage"), - ADD_STAT(pendingReads, Stats::units::Count::get(), + ADD_STAT(pendingReads, statistics::units::Count::get(), "Reads issued to NVM for which data has not been transferred"), - ADD_STAT(pendingWrites, Stats::units::Count::get(), + ADD_STAT(pendingWrites, statistics::units::Count::get(), "Number of outstanding writes to NVM"), - ADD_STAT(bytesPerBank, Stats::units::Byte::get(), + ADD_STAT(bytesPerBank, statistics::units::Byte::get(), "Bytes read within a bank before loading new bank") { @@ -2575,7 +2575,7 @@ NVMInterface::NVMStats::NVMStats(NVMInterface &_nvm) void NVMInterface::NVMStats::regStats() { - using namespace Stats; + using namespace statistics; perBankRdBursts.init(nvm.ranksPerChannel == 0 ? 1 : nvm.banksPerRank * nvm.ranksPerChannel); diff --git a/src/mem/mem_interface.hh b/src/mem/mem_interface.hh index f23a08b534..f580642812 100644 --- a/src/mem/mem_interface.hh +++ b/src/mem/mem_interface.hh @@ -397,7 +397,7 @@ class DRAMInterface : public MemInterface }; class Rank; - struct RankStats : public Stats::Group + struct RankStats : public statistics::Group { RankStats(DRAMInterface &dram, Rank &rank); @@ -410,50 +410,50 @@ class DRAMInterface : public MemInterface /* * Command energies */ - Stats::Scalar actEnergy; - Stats::Scalar preEnergy; - Stats::Scalar readEnergy; - Stats::Scalar writeEnergy; - Stats::Scalar refreshEnergy; + statistics::Scalar actEnergy; + statistics::Scalar preEnergy; + statistics::Scalar readEnergy; + statistics::Scalar writeEnergy; + statistics::Scalar refreshEnergy; /* * Active Background Energy */ - Stats::Scalar actBackEnergy; + statistics::Scalar actBackEnergy; /* * Precharge Background Energy */ - Stats::Scalar preBackEnergy; + statistics::Scalar preBackEnergy; /* * Active Power-Down Energy */ - Stats::Scalar actPowerDownEnergy; + statistics::Scalar actPowerDownEnergy; /* * Precharge Power-Down Energy */ - Stats::Scalar prePowerDownEnergy; + statistics::Scalar prePowerDownEnergy; /* * self Refresh Energy */ - Stats::Scalar selfRefreshEnergy; + statistics::Scalar selfRefreshEnergy; - Stats::Scalar totalEnergy; - Stats::Scalar averagePower; + statistics::Scalar totalEnergy; + statistics::Scalar averagePower; /** * Stat to track total DRAM idle time * */ - Stats::Scalar totalIdleTime; + statistics::Scalar totalIdleTime; /** * Track time spent in each power state. */ - Stats::Vector pwrStateTime; + statistics::Vector pwrStateTime; }; /** @@ -800,7 +800,7 @@ class DRAMInterface : public MemInterface Tick pre_tick, bool auto_or_preall = false, bool trace = true); - struct DRAMStats : public Stats::Group + struct DRAMStats : public statistics::Group { DRAMStats(DRAMInterface &dram); @@ -810,42 +810,42 @@ class DRAMInterface : public MemInterface DRAMInterface &dram; /** total number of DRAM bursts serviced */ - Stats::Scalar readBursts; - Stats::Scalar writeBursts; + statistics::Scalar readBursts; + statistics::Scalar writeBursts; /** DRAM per bank stats */ - Stats::Vector perBankRdBursts; - Stats::Vector perBankWrBursts; + statistics::Vector perBankRdBursts; + statistics::Vector perBankWrBursts; // Latencies summed over all requests - Stats::Scalar totQLat; - Stats::Scalar totBusLat; - Stats::Scalar totMemAccLat; + statistics::Scalar totQLat; + statistics::Scalar totBusLat; + statistics::Scalar totMemAccLat; // Average latencies per request - Stats::Formula avgQLat; - Stats::Formula avgBusLat; - Stats::Formula avgMemAccLat; + statistics::Formula avgQLat; + statistics::Formula avgBusLat; + statistics::Formula avgMemAccLat; // Row hit count and rate - Stats::Scalar readRowHits; - Stats::Scalar writeRowHits; - Stats::Formula readRowHitRate; - Stats::Formula writeRowHitRate; - Stats::Histogram bytesPerActivate; + statistics::Scalar readRowHits; + statistics::Scalar writeRowHits; + statistics::Formula readRowHitRate; + statistics::Formula writeRowHitRate; + statistics::Histogram bytesPerActivate; // Number of bytes transferred to/from DRAM - Stats::Scalar bytesRead; - Stats::Scalar bytesWritten; + statistics::Scalar bytesRead; + statistics::Scalar bytesWritten; // Average bandwidth - Stats::Formula avgRdBW; - Stats::Formula avgWrBW; - Stats::Formula peakBW; + statistics::Formula avgRdBW; + statistics::Formula avgWrBW; + statistics::Formula peakBW; // bus utilization - Stats::Formula busUtil; - Stats::Formula busUtilRead; - Stats::Formula busUtilWrite; - Stats::Formula pageHitRate; + statistics::Formula busUtil; + statistics::Formula busUtilRead; + statistics::Formula busUtilWrite; + statistics::Formula pageHitRate; }; DRAMStats stats; @@ -1058,7 +1058,7 @@ class NVMInterface : public MemInterface const Tick tWRITE; const Tick tSEND; - struct NVMStats : public Stats::Group + struct NVMStats : public statistics::Group { NVMStats(NVMInterface &nvm); @@ -1067,37 +1067,37 @@ class NVMInterface : public MemInterface NVMInterface &nvm; /** NVM stats */ - Stats::Scalar readBursts; - Stats::Scalar writeBursts; + statistics::Scalar readBursts; + statistics::Scalar writeBursts; - Stats::Vector perBankRdBursts; - Stats::Vector perBankWrBursts; + statistics::Vector perBankRdBursts; + statistics::Vector perBankWrBursts; // Latencies summed over all requests - Stats::Scalar totQLat; - Stats::Scalar totBusLat; - Stats::Scalar totMemAccLat; + statistics::Scalar totQLat; + statistics::Scalar totBusLat; + statistics::Scalar totMemAccLat; // Average latencies per request - Stats::Formula avgQLat; - Stats::Formula avgBusLat; - Stats::Formula avgMemAccLat; + statistics::Formula avgQLat; + statistics::Formula avgBusLat; + statistics::Formula avgMemAccLat; - Stats::Scalar bytesRead; - Stats::Scalar bytesWritten; + statistics::Scalar bytesRead; + statistics::Scalar bytesWritten; // Average bandwidth - Stats::Formula avgRdBW; - Stats::Formula avgWrBW; - Stats::Formula peakBW; - Stats::Formula busUtil; - Stats::Formula busUtilRead; - Stats::Formula busUtilWrite; + statistics::Formula avgRdBW; + statistics::Formula avgWrBW; + statistics::Formula peakBW; + statistics::Formula busUtil; + statistics::Formula busUtilRead; + statistics::Formula busUtilWrite; /** NVM stats */ - Stats::Histogram pendingReads; - Stats::Histogram pendingWrites; - Stats::Histogram bytesPerBank; + statistics::Histogram pendingReads; + statistics::Histogram pendingWrites; + statistics::Histogram bytesPerBank; }; NVMStats stats; diff --git a/src/mem/probes/mem_footprint.cc b/src/mem/probes/mem_footprint.cc index db023ae0d0..93aab4c2c2 100644 --- a/src/mem/probes/mem_footprint.cc +++ b/src/mem/probes/mem_footprint.cc @@ -60,21 +60,21 @@ MemFootprintProbe::MemFootprintProbe(const MemFootprintProbeParams &p) "MemFootprintProbe expects page size parameter is power of 2"); } -MemFootprintProbe:: -MemFootprintProbeStats::MemFootprintProbeStats(MemFootprintProbe *parent) - : Stats::Group(parent), - ADD_STAT(cacheLine, Stats::units::Count::get(), +MemFootprintProbe::MemFootprintProbeStats::MemFootprintProbeStats( + MemFootprintProbe *parent) + : statistics::Group(parent), + ADD_STAT(cacheLine, statistics::units::Count::get(), "Memory footprint at cache line granularity"), - ADD_STAT(cacheLineTotal, Stats::units::Count::get(), + ADD_STAT(cacheLineTotal, statistics::units::Count::get(), "Total memory footprint at cache line granularity since " "simulation begin"), - ADD_STAT(page, Stats::units::Count::get(), + ADD_STAT(page, statistics::units::Count::get(), "Memory footprint at page granularity"), - ADD_STAT(pageTotal, Stats::units::Count::get(), + ADD_STAT(pageTotal, statistics::units::Count::get(), "Total memory footprint at page granularity since simulation " "begin") { - using namespace Stats; + using namespace statistics; // clang-format off cacheLine.flags(nozero | nonan); cacheLineTotal.flags(nozero | nonan); diff --git a/src/mem/probes/mem_footprint.hh b/src/mem/probes/mem_footprint.hh index 6792c0f8e6..bdfb17dcdd 100644 --- a/src/mem/probes/mem_footprint.hh +++ b/src/mem/probes/mem_footprint.hh @@ -71,18 +71,18 @@ class MemFootprintProbe : public BaseMemProbe void insertAddr(Addr addr, AddrSet *set, uint64_t limit); void handleRequest(const probing::PacketInfo &pkt_info) override; - struct MemFootprintProbeStats : public Stats::Group + struct MemFootprintProbeStats : public statistics::Group { MemFootprintProbeStats(MemFootprintProbe *parent); /// Footprint at cache line size granularity - Stats::Scalar cacheLine; + statistics::Scalar cacheLine; /// Footprint at cache line size granularity, since simulation begin - Stats::Scalar cacheLineTotal; + statistics::Scalar cacheLineTotal; /// Footprint at page granularity - Stats::Scalar page; + statistics::Scalar page; /// Footprint at page granularity, since simulation begin - Stats::Scalar pageTotal; + statistics::Scalar pageTotal; }; // Addr set to track unique cache lines accessed diff --git a/src/mem/probes/stack_dist.cc b/src/mem/probes/stack_dist.cc index a4c37e791f..d7632318c2 100644 --- a/src/mem/probes/stack_dist.cc +++ b/src/mem/probes/stack_dist.cc @@ -53,21 +53,21 @@ StackDistProbe::StackDistProbe(const StackDistProbeParams &p) "larger or equal to the system's cahce line size."); } -StackDistProbe:: -StackDistProbeStats::StackDistProbeStats(StackDistProbe *parent) - : Stats::Group(parent), - ADD_STAT(readLinearHist, Stats::units::Count::get(), +StackDistProbe::StackDistProbeStats::StackDistProbeStats( + StackDistProbe *parent) + : statistics::Group(parent), + ADD_STAT(readLinearHist, statistics::units::Count::get(), "Reads linear distribution"), - ADD_STAT(readLogHist, Stats::units::Ratio::get(), + ADD_STAT(readLogHist, statistics::units::Ratio::get(), "Reads logarithmic distribution"), - ADD_STAT(writeLinearHist, Stats::units::Count::get(), + ADD_STAT(writeLinearHist, statistics::units::Count::get(), "Writes linear distribution"), - ADD_STAT(writeLogHist, Stats::units::Ratio::get(), + ADD_STAT(writeLogHist, statistics::units::Ratio::get(), "Writes logarithmic distribution"), - ADD_STAT(infiniteSD, Stats::units::Count::get(), + ADD_STAT(infiniteSD, statistics::units::Count::get(), "Number of requests with infinite stack distance") { - using namespace Stats; + using namespace statistics; const StackDistProbeParams &p = dynamic_cast(parent->params()); diff --git a/src/mem/probes/stack_dist.hh b/src/mem/probes/stack_dist.hh index 3bf8ee5c79..48be93cc84 100644 --- a/src/mem/probes/stack_dist.hh +++ b/src/mem/probes/stack_dist.hh @@ -66,24 +66,24 @@ class StackDistProbe : public BaseMemProbe protected: StackDistCalc calc; - struct StackDistProbeStats : public Stats::Group + struct StackDistProbeStats : public statistics::Group { StackDistProbeStats(StackDistProbe* parent); // Reads linear histogram - Stats::Histogram readLinearHist; + statistics::Histogram readLinearHist; // Reads logarithmic histogram - Stats::SparseHistogram readLogHist; + statistics::SparseHistogram readLogHist; // Writes linear histogram - Stats::Histogram writeLinearHist; + statistics::Histogram writeLinearHist; // Writes logarithmic histogram - Stats::SparseHistogram writeLogHist; + statistics::SparseHistogram writeLogHist; // Writes logarithmic histogram - Stats::Scalar infiniteSD; + statistics::Scalar infiniteSD; } stats; }; diff --git a/src/mem/qos/mem_ctrl.cc b/src/mem/qos/mem_ctrl.cc index 7a5a5245f4..7ebf2a7b55 100644 --- a/src/mem/qos/mem_ctrl.cc +++ b/src/mem/qos/mem_ctrl.cc @@ -280,26 +280,26 @@ MemCtrl::addRequestor(RequestorID id) } MemCtrl::MemCtrlStats::MemCtrlStats(MemCtrl &mc) - : Stats::Group(&mc), + : statistics::Group(&mc), memCtrl(mc), - ADD_STAT(avgPriority, Stats::units::Count::get(), + ADD_STAT(avgPriority, statistics::units::Count::get(), "Average QoS priority value for accepted requests"), - ADD_STAT(avgPriorityDistance, Stats::units::Count::get(), + ADD_STAT(avgPriorityDistance, statistics::units::Count::get(), "Average QoS priority distance between assigned and queued " "values"), - ADD_STAT(priorityMinLatency, Stats::units::Second::get(), + ADD_STAT(priorityMinLatency, statistics::units::Second::get(), "per QoS priority minimum request to response latency"), - ADD_STAT(priorityMaxLatency, Stats::units::Second::get(), + ADD_STAT(priorityMaxLatency, statistics::units::Second::get(), "per QoS priority maximum request to response latency"), - ADD_STAT(numReadWriteTurnArounds, Stats::units::Count::get(), + ADD_STAT(numReadWriteTurnArounds, statistics::units::Count::get(), "Number of turnarounds from READ to WRITE"), - ADD_STAT(numWriteReadTurnArounds, Stats::units::Count::get(), + ADD_STAT(numWriteReadTurnArounds, statistics::units::Count::get(), "Number of turnarounds from WRITE to READ"), - ADD_STAT(numStayReadState, Stats::units::Count::get(), + ADD_STAT(numStayReadState, statistics::units::Count::get(), "Number of times bus staying in READ state"), - ADD_STAT(numStayWriteState, Stats::units::Count::get(), + ADD_STAT(numStayWriteState, statistics::units::Count::get(), "Number of times bus staying in WRITE state") { } @@ -307,9 +307,9 @@ MemCtrl::MemCtrlStats::MemCtrlStats(MemCtrl &mc) void MemCtrl::MemCtrlStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); - using namespace Stats; + using namespace statistics; System *system = memCtrl._system; const auto max_requestors = system->maxRequestors(); diff --git a/src/mem/qos/mem_ctrl.hh b/src/mem/qos/mem_ctrl.hh index b2f4ea3c5f..9fc2c1df31 100644 --- a/src/mem/qos/mem_ctrl.hh +++ b/src/mem/qos/mem_ctrl.hh @@ -136,7 +136,7 @@ class MemCtrl : public ClockedObject /** bus state for next request event triggered */ BusState busStateNext; - struct MemCtrlStats : public Stats::Group + struct MemCtrlStats : public statistics::Group { MemCtrlStats(MemCtrl &mc); @@ -145,25 +145,25 @@ class MemCtrl : public ClockedObject const MemCtrl &memCtrl; /** per-requestor average QoS priority */ - Stats::VectorStandardDeviation avgPriority; + statistics::VectorStandardDeviation avgPriority; /** * per-requestor average QoS distance between assigned and * queued values */ - Stats::VectorStandardDeviation avgPriorityDistance; + statistics::VectorStandardDeviation avgPriorityDistance; /** per-priority minimum latency */ - Stats::Vector priorityMinLatency; + statistics::Vector priorityMinLatency; /** per-priority maximum latency */ - Stats::Vector priorityMaxLatency; + statistics::Vector priorityMaxLatency; /** Count the number of turnarounds READ to WRITE */ - Stats::Scalar numReadWriteTurnArounds; + statistics::Scalar numReadWriteTurnArounds; /** Count the number of turnarounds WRITE to READ */ - Stats::Scalar numWriteReadTurnArounds; + statistics::Scalar numWriteReadTurnArounds; /** Count the number of times bus staying in READ state */ - Stats::Scalar numStayReadState; + statistics::Scalar numStayReadState; /** Count the number of times bus staying in WRITE state */ - Stats::Scalar numStayWriteState; + statistics::Scalar numStayWriteState; } stats; /** Pointer to the System object */ diff --git a/src/mem/qos/mem_sink.cc b/src/mem/qos/mem_sink.cc index c7c7cdd6e0..fb50e67d14 100644 --- a/src/mem/qos/mem_sink.cc +++ b/src/mem/qos/mem_sink.cc @@ -336,11 +336,11 @@ MemSinkCtrl::drain() } } -MemSinkCtrl::MemSinkCtrlStats::MemSinkCtrlStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(numReadRetries, Stats::units::Count::get(), +MemSinkCtrl::MemSinkCtrlStats::MemSinkCtrlStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(numReadRetries, statistics::units::Count::get(), "Number of read retries"), - ADD_STAT(numWriteRetries, Stats::units::Count::get(), + ADD_STAT(numWriteRetries, statistics::units::Count::get(), "Number of write retries") { } diff --git a/src/mem/qos/mem_sink.hh b/src/mem/qos/mem_sink.hh index 8db9cb683b..4946115652 100644 --- a/src/mem/qos/mem_sink.hh +++ b/src/mem/qos/mem_sink.hh @@ -188,15 +188,15 @@ class MemSinkCtrl : public MemCtrl /** Next request service time */ Tick nextRequest; - struct MemSinkCtrlStats : public Stats::Group + struct MemSinkCtrlStats : public statistics::Group { - MemSinkCtrlStats(Stats::Group *parent); + MemSinkCtrlStats(statistics::Group *parent); /** Count the number of read retries */ - Stats::Scalar numReadRetries; + statistics::Scalar numReadRetries; /** Count the number of write retries */ - Stats::Scalar numWriteRetries; + statistics::Scalar numWriteRetries; }; /** diff --git a/src/mem/ruby/network/MessageBuffer.cc b/src/mem/ruby/network/MessageBuffer.cc index 206f50df86..6642fbcf3b 100644 --- a/src/mem/ruby/network/MessageBuffer.cc +++ b/src/mem/ruby/network/MessageBuffer.cc @@ -85,19 +85,19 @@ MessageBuffer::MessageBuffer(const Params &p) // stats m_not_avail_count - .flags(Stats::nozero); + .flags(statistics::nozero); m_buf_msgs - .flags(Stats::nozero); + .flags(statistics::nozero); m_stall_count - .flags(Stats::nozero); + .flags(statistics::nozero); m_occupancy - .flags(Stats::nozero); + .flags(statistics::nozero); m_stall_time - .flags(Stats::nozero); + .flags(statistics::nozero); if (m_max_size > 0) { m_occupancy = m_buf_msgs / m_max_size; diff --git a/src/mem/ruby/network/MessageBuffer.hh b/src/mem/ruby/network/MessageBuffer.hh index 4d70f3088e..e2d38512f5 100644 --- a/src/mem/ruby/network/MessageBuffer.hh +++ b/src/mem/ruby/network/MessageBuffer.hh @@ -256,12 +256,12 @@ class MessageBuffer : public SimObject int m_input_link_id; int m_vnet_id; - Stats::Scalar m_not_avail_count; // count the # of times I didn't have N - // slots available - Stats::Average m_buf_msgs; - Stats::Average m_stall_time; - Stats::Scalar m_stall_count; - Stats::Formula m_occupancy; + // Count the # of times I didn't have N slots available + statistics::Scalar m_not_avail_count; + statistics::Average m_buf_msgs; + statistics::Average m_stall_time; + statistics::Scalar m_stall_count; + statistics::Formula m_occupancy; }; Tick random_time(); diff --git a/src/mem/ruby/network/Network.cc b/src/mem/ruby/network/Network.cc index 8be4acef11..58b8ac1434 100644 --- a/src/mem/ruby/network/Network.cc +++ b/src/mem/ruby/network/Network.cc @@ -130,7 +130,7 @@ Network::Network(const Params &p) } // Register a callback function for combining the statistics - Stats::registerDumpCallback([this]() { collateStats(); }); + statistics::registerDumpCallback([this]() { collateStats(); }); for (auto &it : dynamic_cast(this)->params().ext_links) { it->params().ext_node->initNetQueues(); diff --git a/src/mem/ruby/network/garnet/GarnetNetwork.cc b/src/mem/ruby/network/garnet/GarnetNetwork.cc index 12c32fe4e3..d7a761cb2b 100644 --- a/src/mem/ruby/network/garnet/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet/GarnetNetwork.cc @@ -369,25 +369,27 @@ GarnetNetwork::regStats() m_packets_received .init(m_virtual_networks) .name(name() + ".packets_received") - .flags(Stats::pdf | Stats::total | Stats::nozero | Stats::oneline) + .flags(statistics::pdf | statistics::total | statistics::nozero | + statistics::oneline) ; m_packets_injected .init(m_virtual_networks) .name(name() + ".packets_injected") - .flags(Stats::pdf | Stats::total | Stats::nozero | Stats::oneline) + .flags(statistics::pdf | statistics::total | statistics::nozero | + statistics::oneline) ; m_packet_network_latency .init(m_virtual_networks) .name(name() + ".packet_network_latency") - .flags(Stats::oneline) + .flags(statistics::oneline) ; m_packet_queueing_latency .init(m_virtual_networks) .name(name() + ".packet_queueing_latency") - .flags(Stats::oneline) + .flags(statistics::oneline) ; for (int i = 0; i < m_virtual_networks; i++) { @@ -399,13 +401,13 @@ GarnetNetwork::regStats() m_avg_packet_vnet_latency .name(name() + ".average_packet_vnet_latency") - .flags(Stats::oneline); + .flags(statistics::oneline); m_avg_packet_vnet_latency = m_packet_network_latency / m_packets_received; m_avg_packet_vqueue_latency .name(name() + ".average_packet_vqueue_latency") - .flags(Stats::oneline); + .flags(statistics::oneline); m_avg_packet_vqueue_latency = m_packet_queueing_latency / m_packets_received; @@ -428,25 +430,27 @@ GarnetNetwork::regStats() m_flits_received .init(m_virtual_networks) .name(name() + ".flits_received") - .flags(Stats::pdf | Stats::total | Stats::nozero | Stats::oneline) + .flags(statistics::pdf | statistics::total | statistics::nozero | + statistics::oneline) ; m_flits_injected .init(m_virtual_networks) .name(name() + ".flits_injected") - .flags(Stats::pdf | Stats::total | Stats::nozero | Stats::oneline) + .flags(statistics::pdf | statistics::total | statistics::nozero | + statistics::oneline) ; m_flit_network_latency .init(m_virtual_networks) .name(name() + ".flit_network_latency") - .flags(Stats::oneline) + .flags(statistics::oneline) ; m_flit_queueing_latency .init(m_virtual_networks) .name(name() + ".flit_queueing_latency") - .flags(Stats::oneline) + .flags(statistics::oneline) ; for (int i = 0; i < m_virtual_networks; i++) { @@ -458,12 +462,12 @@ GarnetNetwork::regStats() m_avg_flit_vnet_latency .name(name() + ".average_flit_vnet_latency") - .flags(Stats::oneline); + .flags(statistics::oneline); m_avg_flit_vnet_latency = m_flit_network_latency / m_flits_received; m_avg_flit_vqueue_latency .name(name() + ".average_flit_vqueue_latency") - .flags(Stats::oneline); + .flags(statistics::oneline); m_avg_flit_vqueue_latency = m_flit_queueing_latency / m_flits_received; @@ -499,17 +503,20 @@ GarnetNetwork::regStats() m_average_vc_load .init(m_virtual_networks * m_max_vcs_per_vnet) .name(name() + ".avg_vc_load") - .flags(Stats::pdf | Stats::total | Stats::nozero | Stats::oneline) + .flags(statistics::pdf | statistics::total | statistics::nozero | + statistics::oneline) ; // Traffic distribution for (int source = 0; source < m_routers.size(); ++source) { - m_data_traffic_distribution.push_back(std::vector()); - m_ctrl_traffic_distribution.push_back(std::vector()); + m_data_traffic_distribution.push_back( + std::vector()); + m_ctrl_traffic_distribution.push_back( + std::vector()); for (int dest = 0; dest < m_routers.size(); ++dest) { - Stats::Scalar *data_packets = new Stats::Scalar(); - Stats::Scalar *ctrl_packets = new Stats::Scalar(); + statistics::Scalar *data_packets = new statistics::Scalar(); + statistics::Scalar *ctrl_packets = new statistics::Scalar(); data_packets->name(name() + ".data_traffic_distribution." + "n" + std::to_string(source) + "." + "n" + std::to_string(dest)); diff --git a/src/mem/ruby/network/garnet/GarnetNetwork.hh b/src/mem/ruby/network/garnet/GarnetNetwork.hh index 294f0f6427..3f6ebd91ba 100644 --- a/src/mem/ruby/network/garnet/GarnetNetwork.hh +++ b/src/mem/ruby/network/garnet/GarnetNetwork.hh @@ -156,39 +156,39 @@ class GarnetNetwork : public Network bool m_enable_fault_model; // Statistical variables - Stats::Vector m_packets_received; - Stats::Vector m_packets_injected; - Stats::Vector m_packet_network_latency; - Stats::Vector m_packet_queueing_latency; + statistics::Vector m_packets_received; + statistics::Vector m_packets_injected; + statistics::Vector m_packet_network_latency; + statistics::Vector m_packet_queueing_latency; - Stats::Formula m_avg_packet_vnet_latency; - Stats::Formula m_avg_packet_vqueue_latency; - Stats::Formula m_avg_packet_network_latency; - Stats::Formula m_avg_packet_queueing_latency; - Stats::Formula m_avg_packet_latency; + statistics::Formula m_avg_packet_vnet_latency; + statistics::Formula m_avg_packet_vqueue_latency; + statistics::Formula m_avg_packet_network_latency; + statistics::Formula m_avg_packet_queueing_latency; + statistics::Formula m_avg_packet_latency; - Stats::Vector m_flits_received; - Stats::Vector m_flits_injected; - Stats::Vector m_flit_network_latency; - Stats::Vector m_flit_queueing_latency; + statistics::Vector m_flits_received; + statistics::Vector m_flits_injected; + statistics::Vector m_flit_network_latency; + statistics::Vector m_flit_queueing_latency; - Stats::Formula m_avg_flit_vnet_latency; - Stats::Formula m_avg_flit_vqueue_latency; - Stats::Formula m_avg_flit_network_latency; - Stats::Formula m_avg_flit_queueing_latency; - Stats::Formula m_avg_flit_latency; + statistics::Formula m_avg_flit_vnet_latency; + statistics::Formula m_avg_flit_vqueue_latency; + statistics::Formula m_avg_flit_network_latency; + statistics::Formula m_avg_flit_queueing_latency; + statistics::Formula m_avg_flit_latency; - Stats::Scalar m_total_ext_in_link_utilization; - Stats::Scalar m_total_ext_out_link_utilization; - Stats::Scalar m_total_int_link_utilization; - Stats::Scalar m_average_link_utilization; - Stats::Vector m_average_vc_load; + statistics::Scalar m_total_ext_in_link_utilization; + statistics::Scalar m_total_ext_out_link_utilization; + statistics::Scalar m_total_int_link_utilization; + statistics::Scalar m_average_link_utilization; + statistics::Vector m_average_vc_load; - Stats::Scalar m_total_hops; - Stats::Formula m_avg_hops; + statistics::Scalar m_total_hops; + statistics::Formula m_avg_hops; - std::vector> m_data_traffic_distribution; - std::vector> m_ctrl_traffic_distribution; + std::vector> m_data_traffic_distribution; + std::vector> m_ctrl_traffic_distribution; private: GarnetNetwork(const GarnetNetwork& obj); diff --git a/src/mem/ruby/network/garnet/Router.cc b/src/mem/ruby/network/garnet/Router.cc index d545b62272..329598985e 100644 --- a/src/mem/ruby/network/garnet/Router.cc +++ b/src/mem/ruby/network/garnet/Router.cc @@ -185,27 +185,27 @@ Router::regStats() m_buffer_reads .name(name() + ".buffer_reads") - .flags(Stats::nozero) + .flags(statistics::nozero) ; m_buffer_writes .name(name() + ".buffer_writes") - .flags(Stats::nozero) + .flags(statistics::nozero) ; m_crossbar_activity .name(name() + ".crossbar_activity") - .flags(Stats::nozero) + .flags(statistics::nozero) ; m_sw_input_arbiter_activity .name(name() + ".sw_input_arbiter_activity") - .flags(Stats::nozero) + .flags(statistics::nozero) ; m_sw_output_arbiter_activity .name(name() + ".sw_output_arbiter_activity") - .flags(Stats::nozero) + .flags(statistics::nozero) ; } diff --git a/src/mem/ruby/network/garnet/Router.hh b/src/mem/ruby/network/garnet/Router.hh index 31cdd75924..b93da6f7b9 100644 --- a/src/mem/ruby/network/garnet/Router.hh +++ b/src/mem/ruby/network/garnet/Router.hh @@ -145,13 +145,13 @@ class Router : public BasicRouter, public Consumer std::vector> m_output_unit; // Statistical variables required for power computations - Stats::Scalar m_buffer_reads; - Stats::Scalar m_buffer_writes; + statistics::Scalar m_buffer_reads; + statistics::Scalar m_buffer_writes; - Stats::Scalar m_sw_input_arbiter_activity; - Stats::Scalar m_sw_output_arbiter_activity; + statistics::Scalar m_sw_input_arbiter_activity; + statistics::Scalar m_sw_output_arbiter_activity; - Stats::Scalar m_crossbar_activity; + statistics::Scalar m_crossbar_activity; }; #endif // __MEM_RUBY_NETWORK_GARNET_0_ROUTER_HH__ diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc index 0f9056513a..fa1df25b2a 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.cc +++ b/src/mem/ruby/network/simple/SimpleNetwork.cc @@ -144,17 +144,17 @@ SimpleNetwork::regStats() for (MessageSizeType type = MessageSizeType_FIRST; type < MessageSizeType_NUM; ++type) { networkStats.m_msg_counts[(unsigned int) type] = - new Stats::Formula(&networkStats, + new statistics::Formula(&networkStats, csprintf("msg_count.%s", MessageSizeType_to_string(type)).c_str()); networkStats.m_msg_counts[(unsigned int) type] - ->flags(Stats::nozero) + ->flags(statistics::nozero) ; networkStats.m_msg_bytes[(unsigned int) type] = - new Stats::Formula(&networkStats, + new statistics::Formula(&networkStats, csprintf("msg_byte.%s", MessageSizeType_to_string(type)).c_str()); networkStats.m_msg_bytes[(unsigned int) type] - ->flags(Stats::nozero) + ->flags(statistics::nozero) ; // Now state what the formula is. @@ -165,7 +165,7 @@ SimpleNetwork::regStats() *(networkStats.m_msg_bytes[(unsigned int) type]) = *(networkStats.m_msg_counts[(unsigned int) type]) * - Stats::constant(Network::MessageSizeType_to_int(type)); + statistics::constant(Network::MessageSizeType_to_int(type)); } } @@ -234,8 +234,8 @@ SimpleNetwork::functionalWrite(Packet *pkt) } SimpleNetwork:: -NetworkStats::NetworkStats(Stats::Group *parent) - : Stats::Group(parent) +NetworkStats::NetworkStats(statistics::Group *parent) + : statistics::Group(parent) { } diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh index 55546a086b..f6b7d2e60e 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.hh +++ b/src/mem/ruby/network/simple/SimpleNetwork.hh @@ -104,13 +104,13 @@ class SimpleNetwork : public Network const bool m_adaptive_routing; - struct NetworkStats : public Stats::Group + struct NetworkStats : public statistics::Group { - NetworkStats(Stats::Group *parent); + NetworkStats(statistics::Group *parent); //Statistical variables - Stats::Formula* m_msg_counts[MessageSizeType_NUM]; - Stats::Formula* m_msg_bytes[MessageSizeType_NUM]; + statistics::Formula* m_msg_counts[MessageSizeType_NUM]; + statistics::Formula* m_msg_bytes[MessageSizeType_NUM]; } networkStats; }; diff --git a/src/mem/ruby/network/simple/Switch.cc b/src/mem/ruby/network/simple/Switch.cc index 06e173663e..b10f27c71a 100644 --- a/src/mem/ruby/network/simple/Switch.cc +++ b/src/mem/ruby/network/simple/Switch.cc @@ -114,29 +114,29 @@ Switch::regStats() for (const auto& throttle : throttles) { switchStats.m_avg_utilization += throttle.getUtilization(); } - switchStats.m_avg_utilization /= Stats::constant(throttles.size()); + switchStats.m_avg_utilization /= statistics::constant(throttles.size()); for (unsigned int type = MessageSizeType_FIRST; type < MessageSizeType_NUM; ++type) { - switchStats.m_msg_counts[type] = new Stats::Formula(&switchStats, + switchStats.m_msg_counts[type] = new statistics::Formula(&switchStats, csprintf("msg_count.%s", MessageSizeType_to_string(MessageSizeType(type))).c_str()); switchStats.m_msg_counts[type] - ->flags(Stats::nozero) + ->flags(statistics::nozero) ; - switchStats.m_msg_bytes[type] = new Stats::Formula(&switchStats, + switchStats.m_msg_bytes[type] = new statistics::Formula(&switchStats, csprintf("msg_bytes.%s", MessageSizeType_to_string(MessageSizeType(type))).c_str()); switchStats.m_msg_bytes[type] - ->flags(Stats::nozero) + ->flags(statistics::nozero) ; for (const auto& throttle : throttles) { *(switchStats.m_msg_counts[type]) += throttle.getMsgCount(type); } *(switchStats.m_msg_bytes[type]) = - *(switchStats.m_msg_counts[type]) * Stats::constant( + *(switchStats.m_msg_counts[type]) * statistics::constant( Network::MessageSizeType_to_int(MessageSizeType(type))); } } @@ -199,8 +199,8 @@ Switch::functionalWrite(Packet *pkt) } Switch:: -SwitchStats::SwitchStats(Stats::Group *parent) - : Stats::Group(parent), +SwitchStats::SwitchStats(statistics::Group *parent) + : statistics::Group(parent), m_avg_utilization(this, "percent_links_utilized") { diff --git a/src/mem/ruby/network/simple/Switch.hh b/src/mem/ruby/network/simple/Switch.hh index 271d090750..b131b4d82e 100644 --- a/src/mem/ruby/network/simple/Switch.hh +++ b/src/mem/ruby/network/simple/Switch.hh @@ -84,7 +84,7 @@ class Switch : public BasicRouter void resetStats(); void collateStats(); void regStats(); - const Stats::Formula & getMsgCount(unsigned int type) const + const statistics::Formula & getMsgCount(unsigned int type) const { return *(switchStats.m_msg_counts[type]); } void print(std::ostream& out) const; @@ -108,14 +108,14 @@ class Switch : public BasicRouter public: - struct SwitchStats : public Stats::Group + struct SwitchStats : public statistics::Group { - SwitchStats(Stats::Group *parent); + SwitchStats(statistics::Group *parent); // Statistical variables - Stats::Formula m_avg_utilization; - Stats::Formula* m_msg_counts[MessageSizeType_NUM]; - Stats::Formula* m_msg_bytes[MessageSizeType_NUM]; + statistics::Formula m_avg_utilization; + statistics::Formula* m_msg_counts[MessageSizeType_NUM]; + statistics::Formula* m_msg_bytes[MessageSizeType_NUM]; } switchStats; }; diff --git a/src/mem/ruby/network/simple/Throttle.cc b/src/mem/ruby/network/simple/Throttle.cc index 7a5f2fcd51..a39a061a9f 100644 --- a/src/mem/ruby/network/simple/Throttle.cc +++ b/src/mem/ruby/network/simple/Throttle.cc @@ -206,22 +206,22 @@ Throttle::regStats() for (MessageSizeType type = MessageSizeType_FIRST; type < MessageSizeType_NUM; ++type) { throttleStats.m_msg_counts[(unsigned int)type] = - new Stats::Vector(&throttleStats, + new statistics::Vector(&throttleStats, csprintf("msg_count.%s", MessageSizeType_to_string(type)).c_str()); throttleStats.m_msg_counts[(unsigned int)type] ->init(Network::getNumberOfVirtualNetworks()) - .flags(Stats::nozero) + .flags(statistics::nozero) ; throttleStats.m_msg_bytes[(unsigned int) type] = - new Stats::Formula(&throttleStats, + new statistics::Formula(&throttleStats, csprintf("msg_bytes.%s", MessageSizeType_to_string(type)).c_str()); throttleStats.m_msg_bytes[(unsigned int) type] - ->flags(Stats::nozero) + ->flags(statistics::nozero) ; *(throttleStats.m_msg_bytes[(unsigned int) type]) = - *(throttleStats.m_msg_counts[type]) * Stats::constant( + *(throttleStats.m_msg_counts[type]) * statistics::constant( Network::MessageSizeType_to_int(type)); } } @@ -264,8 +264,8 @@ network_message_to_size(Message *net_msg_ptr) } Throttle:: -ThrottleStats::ThrottleStats(Stats::Group *parent, const NodeID &nodeID) - : Stats::Group(parent, csprintf("throttle%02i", nodeID).c_str()), +ThrottleStats::ThrottleStats(statistics::Group *parent, const NodeID &nodeID) + : statistics::Group(parent, csprintf("throttle%02i", nodeID).c_str()), m_link_utilization(this, "link_utilization") { diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh index 0d92041e33..b8e90b78a9 100644 --- a/src/mem/ruby/network/simple/Throttle.hh +++ b/src/mem/ruby/network/simple/Throttle.hh @@ -65,9 +65,9 @@ class Throttle : public Consumer void wakeup(); // The average utilization (a fraction) since last clearStats() - const Stats::Scalar & getUtilization() const + const statistics::Scalar & getUtilization() const { return throttleStats.m_link_utilization; } - const Stats::Vector & getMsgCount(unsigned int type) const + const statistics::Vector & getMsgCount(unsigned int type) const { return *(throttleStats.m_msg_counts[type]); } int getLinkBandwidth() const @@ -108,14 +108,14 @@ class Throttle : public Consumer double m_link_utilization_proxy; - struct ThrottleStats : public Stats::Group + struct ThrottleStats : public statistics::Group { - ThrottleStats(Stats::Group *parent, const NodeID &nodeID); + ThrottleStats(statistics::Group *parent, const NodeID &nodeID); // Statistical variables - Stats::Scalar m_link_utilization; - Stats::Vector* m_msg_counts[MessageSizeType_NUM]; - Stats::Formula* m_msg_bytes[MessageSizeType_NUM]; + statistics::Scalar m_link_utilization; + statistics::Vector* m_msg_counts[MessageSizeType_NUM]; + statistics::Formula* m_msg_bytes[MessageSizeType_NUM]; } throttleStats; }; diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc index 14b8319828..01512e62e2 100644 --- a/src/mem/ruby/profiler/Profiler.cc +++ b/src/mem/ruby/profiler/Profiler.cc @@ -102,8 +102,8 @@ Profiler::~Profiler() } Profiler:: -ProfilerStats::ProfilerStats(Stats::Group *parent, Profiler *profiler) - : Stats::Group(parent), +ProfilerStats::ProfilerStats(statistics::Group *parent, Profiler *profiler) + : statistics::Group(parent), perRequestTypeStats(parent), perMachineTypeStats(parent), perRequestTypeMachineTypeStats(parent), @@ -118,152 +118,155 @@ ProfilerStats::ProfilerStats(Stats::Group *parent, Profiler *profiler) { delayHistogram .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); for (int i = 0; i < profiler->m_num_vnets; i++) { - delayVCHistogram.push_back(new Stats::Histogram(this)); + delayVCHistogram.push_back(new statistics::Histogram(this)); delayVCHistogram[i] ->init(10) .name(csprintf("delayVCHist.vnet_%i", i)) .desc(csprintf("delay histogram for vnet_%i", i)) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); } m_outstandReqHistSeqr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_outstandReqHistCoalsr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_latencyHistSeqr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_latencyHistCoalsr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_hitLatencyHistSeqr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_missLatencyHistSeqr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_missLatencyHistCoalsr .init(10) - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); } Profiler::ProfilerStats:: -PerRequestTypeStats::PerRequestTypeStats(Stats::Group *parent) - : Stats::Group(parent, "RequestType") +PerRequestTypeStats::PerRequestTypeStats(statistics::Group *parent) + : statistics::Group(parent, "RequestType") { for (int i = 0; i < RubyRequestType_NUM; i++) { - m_typeLatencyHistSeqr.push_back(new Stats::Histogram(this)); + m_typeLatencyHistSeqr.push_back(new statistics::Histogram(this)); m_typeLatencyHistSeqr[i] ->init(10) .name(csprintf("%s.latency_hist_seqr", RubyRequestType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_typeLatencyHistCoalsr.push_back(new Stats::Histogram(this)); + m_typeLatencyHistCoalsr.push_back(new statistics::Histogram(this)); m_typeLatencyHistCoalsr[i] ->init(10) .name(csprintf("%s.latency_hist_coalsr", RubyRequestType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_hitTypeLatencyHistSeqr.push_back(new Stats::Histogram(this)); + m_hitTypeLatencyHistSeqr.push_back(new statistics::Histogram(this)); m_hitTypeLatencyHistSeqr[i] ->init(10) .name(csprintf("%s.hit_latency_hist_seqr", RubyRequestType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_missTypeLatencyHistSeqr.push_back(new Stats::Histogram(this)); + m_missTypeLatencyHistSeqr.push_back(new statistics::Histogram(this)); m_missTypeLatencyHistSeqr[i] ->init(10) .name(csprintf("%s.miss_latency_hist_seqr", RubyRequestType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_missTypeLatencyHistCoalsr.push_back(new Stats::Histogram(this)); + m_missTypeLatencyHistCoalsr.push_back(new statistics::Histogram(this)); m_missTypeLatencyHistCoalsr[i] ->init(10) .name(csprintf("%s.miss_latency_hist_coalsr", RubyRequestType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); } } Profiler::ProfilerStats:: -PerMachineTypeStats::PerMachineTypeStats(Stats::Group *parent) - : Stats::Group(parent, "MachineType") +PerMachineTypeStats::PerMachineTypeStats(statistics::Group *parent) + : statistics::Group(parent, "MachineType") { for (int i = 0; i < MachineType_NUM; i++) { - m_hitMachLatencyHistSeqr.push_back(new Stats::Histogram(this)); + m_hitMachLatencyHistSeqr.push_back(new statistics::Histogram(this)); m_hitMachLatencyHistSeqr[i] ->init(10) .name(csprintf("%s.hit_mach_latency_hist_seqr", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_missMachLatencyHistSeqr.push_back(new Stats::Histogram(this)); + m_missMachLatencyHistSeqr.push_back(new statistics::Histogram(this)); m_missMachLatencyHistSeqr[i] ->init(10) .name(csprintf("%s.miss_mach_latency_hist_seqr", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_missMachLatencyHistCoalsr.push_back(new Stats::Histogram(this)); + m_missMachLatencyHistCoalsr.push_back(new statistics::Histogram(this)); m_missMachLatencyHistCoalsr[i] ->init(10) .name(csprintf("%s.miss_mach_latency_hist_coalsr", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_IssueToInitialDelayHistSeqr.push_back(new Stats::Histogram(this)); + m_IssueToInitialDelayHistSeqr.push_back( + new statistics::Histogram(this)); m_IssueToInitialDelayHistSeqr[i] ->init(10) .name(csprintf( "%s.miss_latency_hist_seqr.issue_to_initial_request", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_IssueToInitialDelayHistCoalsr.push_back(new Stats::Histogram(this)); + m_IssueToInitialDelayHistCoalsr.push_back( + new statistics::Histogram(this)); m_IssueToInitialDelayHistCoalsr[i] ->init(10) .name(csprintf( "%s.miss_latency_hist_coalsr.issue_to_initial_request", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_InitialToForwardDelayHistSeqr.push_back(new Stats::Histogram(this)); + m_InitialToForwardDelayHistSeqr.push_back( + new statistics::Histogram(this)); m_InitialToForwardDelayHistSeqr[i] ->init(10) .name(csprintf("%s.miss_latency_hist_seqr.initial_to_forward", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_InitialToForwardDelayHistCoalsr - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_InitialToForwardDelayHistCoalsr[i] ->init(10) .name(csprintf("%s.miss_latency_hist_coalsr.initial_to_forward", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_ForwardToFirstResponseDelayHistSeqr - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_ForwardToFirstResponseDelayHistSeqr[i] ->init(10) @@ -271,86 +274,89 @@ PerMachineTypeStats::PerMachineTypeStats(Stats::Group *parent) "%s.miss_latency_hist_seqr.forward_to_first_response", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_ForwardToFirstResponseDelayHistCoalsr - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_ForwardToFirstResponseDelayHistCoalsr[i] ->init(10) .name(csprintf( "%s.miss_latency_hist_coalsr.forward_to_first_response", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_FirstResponseToCompletionDelayHistSeqr - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_FirstResponseToCompletionDelayHistSeqr[i] ->init(10) .name(csprintf( "%s.miss_latency_hist_seqr.first_response_to_completion", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); m_FirstResponseToCompletionDelayHistCoalsr - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_FirstResponseToCompletionDelayHistCoalsr[i] ->init(10) .name(csprintf( "%s.miss_latency_hist_coalsr.first_response_to_completion", MachineType(i))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | statistics::oneline); - m_IncompleteTimesSeqr.push_back(new Stats::Scalar(this)); + m_IncompleteTimesSeqr.push_back(new statistics::Scalar(this)); m_IncompleteTimesSeqr[i] ->name(csprintf("%s.incomplete_times_seqr", MachineType(i))) .desc("") - .flags(Stats::nozero); + .flags(statistics::nozero); } } Profiler::ProfilerStats:: PerRequestTypeMachineTypeStats:: -PerRequestTypeMachineTypeStats(Stats::Group *parent) - : Stats::Group(parent, "RequestTypeMachineType") +PerRequestTypeMachineTypeStats(statistics::Group *parent) + : statistics::Group(parent, "RequestTypeMachineType") { for (int i = 0; i < RubyRequestType_NUM; i++) { m_hitTypeMachLatencyHistSeqr - .push_back(std::vector()); + .push_back(std::vector()); m_missTypeMachLatencyHistSeqr - .push_back(std::vector()); + .push_back(std::vector()); m_missTypeMachLatencyHistCoalsr - .push_back(std::vector()); + .push_back(std::vector()); for (int j = 0; j < MachineType_NUM; j++) { m_hitTypeMachLatencyHistSeqr[i] - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_hitTypeMachLatencyHistSeqr[i][j] ->init(10) .name(csprintf("%s.%s.hit_type_mach_latency_hist_seqr", RubyRequestType(i), MachineType(j))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | + statistics::oneline); m_missTypeMachLatencyHistSeqr[i] - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_missTypeMachLatencyHistSeqr[i][j] ->init(10) .name(csprintf("%s.%s.miss_type_mach_latency_hist_seqr", RubyRequestType(i), MachineType(j))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | + statistics::oneline); m_missTypeMachLatencyHistCoalsr[i] - .push_back(new Stats::Histogram(this)); + .push_back(new statistics::Histogram(this)); m_missTypeMachLatencyHistCoalsr[i][j] ->init(10) .name(csprintf("%s.%s.miss_type_mach_latency_hist_coalsr", RubyRequestType(i), MachineType(j))) .desc("") - .flags(Stats::nozero | Stats::pdf | Stats::oneline); + .flags(statistics::nozero | statistics::pdf | + statistics::oneline); } } } diff --git a/src/mem/ruby/profiler/Profiler.hh b/src/mem/ruby/profiler/Profiler.hh index aa15487855..7004c9404c 100644 --- a/src/mem/ruby/profiler/Profiler.hh +++ b/src/mem/ruby/profiler/Profiler.hh @@ -91,93 +91,96 @@ class Profiler AddressProfiler* m_address_profiler_ptr; AddressProfiler* m_inst_profiler_ptr; - struct ProfilerStats : public Stats::Group + struct ProfilerStats : public statistics::Group { - ProfilerStats(Stats::Group *parent, Profiler *profiler); + ProfilerStats(statistics::Group *parent, Profiler *profiler); - struct PerRequestTypeStats : public Stats::Group + struct PerRequestTypeStats : public statistics::Group { - PerRequestTypeStats(Stats::Group *parent); + PerRequestTypeStats(statistics::Group *parent); // Histogram of the latency of each request type - std::vector m_typeLatencyHistSeqr; - std::vector m_typeLatencyHistCoalsr; + std::vector m_typeLatencyHistSeqr; + std::vector m_typeLatencyHistCoalsr; // Histogram of the latency of requests that hit in the controller // connected to this sequencer for each type of request - std::vector m_hitTypeLatencyHistSeqr; + std::vector m_hitTypeLatencyHistSeqr; // Histogram of the latency of requests that miss in the controller // connected to this sequencer for each type of request - std::vector m_missTypeLatencyHistSeqr; - std::vector m_missTypeLatencyHistCoalsr; + std::vector m_missTypeLatencyHistSeqr; + std::vector m_missTypeLatencyHistCoalsr; } perRequestTypeStats; - struct PerMachineTypeStats : public Stats::Group + struct PerMachineTypeStats : public statistics::Group { - PerMachineTypeStats(Stats::Group *parent); + PerMachineTypeStats(statistics::Group *parent); //! Histograms for profiling the latencies for requests that //! did not required external messages. - std::vector m_hitMachLatencyHistSeqr; + std::vector m_hitMachLatencyHistSeqr; //! Histograms for profiling the latencies for requests that //! required external messages. - std::vector m_missMachLatencyHistSeqr; - std::vector m_missMachLatencyHistCoalsr; + std::vector m_missMachLatencyHistSeqr; + std::vector m_missMachLatencyHistCoalsr; //! Histograms for recording the breakdown of miss latency - std::vector m_IssueToInitialDelayHistSeqr; - std::vector m_InitialToForwardDelayHistSeqr; - std::vector + std::vector m_IssueToInitialDelayHistSeqr; + std::vector + m_InitialToForwardDelayHistSeqr; + std::vector m_ForwardToFirstResponseDelayHistSeqr; - std::vector + std::vector m_FirstResponseToCompletionDelayHistSeqr; - std::vector m_IncompleteTimesSeqr; - std::vector m_IssueToInitialDelayHistCoalsr; - std::vector m_InitialToForwardDelayHistCoalsr; - std::vector + std::vector m_IncompleteTimesSeqr; + std::vector + m_IssueToInitialDelayHistCoalsr; + std::vector + m_InitialToForwardDelayHistCoalsr; + std::vector m_ForwardToFirstResponseDelayHistCoalsr; - std::vector + std::vector m_FirstResponseToCompletionDelayHistCoalsr; } perMachineTypeStats; - struct PerRequestTypeMachineTypeStats : public Stats::Group + struct PerRequestTypeMachineTypeStats : public statistics::Group { - PerRequestTypeMachineTypeStats(Stats::Group *parent); + PerRequestTypeMachineTypeStats(statistics::Group *parent); //! Histograms for profiling the latencies for requests that //! did not required external messages. - std::vector< std::vector > + std::vector< std::vector > m_hitTypeMachLatencyHistSeqr; //! Histograms for profiling the latencies for requests that //! required external messages. - std::vector< std::vector > + std::vector< std::vector > m_missTypeMachLatencyHistSeqr; - std::vector< std::vector > + std::vector< std::vector > m_missTypeMachLatencyHistCoalsr; } perRequestTypeMachineTypeStats; - Stats::Histogram delayHistogram; - std::vector delayVCHistogram; + statistics::Histogram delayHistogram; + std::vector delayVCHistogram; //! Histogram for number of outstanding requests per cycle. - Stats::Histogram m_outstandReqHistSeqr; - Stats::Histogram m_outstandReqHistCoalsr; + statistics::Histogram m_outstandReqHistSeqr; + statistics::Histogram m_outstandReqHistCoalsr; //! Histogram for holding latency profile of all requests. - Stats::Histogram m_latencyHistSeqr; - Stats::Histogram m_latencyHistCoalsr; + statistics::Histogram m_latencyHistSeqr; + statistics::Histogram m_latencyHistCoalsr; //! Histogram for holding latency profile of all requests that //! hit in the controller connected to this sequencer. - Stats::Histogram m_hitLatencyHistSeqr; + statistics::Histogram m_hitLatencyHistSeqr; //! Histogram for holding latency profile of all requests that //! miss in the controller connected to this sequencer. - Stats::Histogram m_missLatencyHistSeqr; - Stats::Histogram m_missLatencyHistCoalsr; + statistics::Histogram m_missLatencyHistSeqr; + statistics::Histogram m_missLatencyHistCoalsr; }; //added by SS diff --git a/src/mem/ruby/slicc_interface/AbstractController.cc b/src/mem/ruby/slicc_interface/AbstractController.cc index d39d0fbdff..2e323d3850 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.cc +++ b/src/mem/ruby/slicc_interface/AbstractController.cc @@ -62,7 +62,7 @@ AbstractController::AbstractController(const Params &p) if (m_version == 0) { // Combine the statistics from all controllers // of this particular type. - Stats::registerDumpCallback([this]() { collateStats(); }); + statistics::registerDumpCallback([this]() { collateStats(); }); } } @@ -72,7 +72,7 @@ AbstractController::init() stats.delayHistogram.init(10); uint32_t size = Network::getNumberOfVirtualNetworks(); for (uint32_t i = 0; i < size; i++) { - stats.delayVCHistogram.push_back(new Stats::Histogram(this)); + stats.delayVCHistogram.push_back(new statistics::Histogram(this)); stats.delayVCHistogram[i]->init(10); } @@ -446,14 +446,14 @@ AbstractController::MemoryPort::MemoryPort(const std::string &_name, } AbstractController:: -ControllerStats::ControllerStats(Stats::Group *parent) - : Stats::Group(parent), +ControllerStats::ControllerStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(fullyBusyCycles, "cycles for which number of transistions == max transitions"), ADD_STAT(delayHistogram, "delay_histogram") { fullyBusyCycles - .flags(Stats::nozero); + .flags(statistics::nozero); delayHistogram - .flags(Stats::nozero); + .flags(statistics::nozero); } diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh index 4b632db736..4af3136090 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.hh +++ b/src/mem/ruby/slicc_interface/AbstractController.hh @@ -168,8 +168,8 @@ class AbstractController : public ClockedObject, public Consumer MachineID getMachineID() const { return m_machineID; } RequestorID getRequestorId() const { return m_id; } - Stats::Histogram& getDelayHist() { return stats.delayHistogram; } - Stats::Histogram& getDelayVCHist(uint32_t index) + statistics::Histogram& getDelayHist() { return stats.delayHistogram; } + statistics::Histogram& getDelayVCHist(uint32_t index) { return *(stats.delayVCHistogram[index]); } bool respondsTo(Addr addr) @@ -370,30 +370,30 @@ class AbstractController : public ClockedObject, public Consumer NetDest downstreamDestinations; public: - struct ControllerStats : public Stats::Group + struct ControllerStats : public statistics::Group { - ControllerStats(Stats::Group *parent); + ControllerStats(statistics::Group *parent); // Initialized by the SLICC compiler for all combinations of event and // states. Only histograms with samples will appear in the stats - std::vector>> + std::vector>> inTransLatHist; - std::vector inTransLatRetries; - std::vector inTransLatTotal; + std::vector inTransLatRetries; + std::vector inTransLatTotal; // Initialized by the SLICC compiler for all events. // Only histograms with samples will appear in the stats. - std::vector outTransLatHist; - std::vector outTransLatHistRetries; + std::vector outTransLatHist; + std::vector outTransLatHistRetries; //! Counter for the number of cycles when the transitions carried out //! were equal to the maximum allowed - Stats::Scalar fullyBusyCycles; + statistics::Scalar fullyBusyCycles; //! Histogram for profiling delay for the messages this controller //! cares for - Stats::Histogram delayHistogram; - std::vector delayVCHistogram; + statistics::Histogram delayHistogram; + std::vector delayVCHistogram; } stats; }; diff --git a/src/mem/ruby/structures/CacheMemory.cc b/src/mem/ruby/structures/CacheMemory.cc index ffcf1c25b7..fbb9d36aa2 100644 --- a/src/mem/ruby/structures/CacheMemory.cc +++ b/src/mem/ruby/structures/CacheMemory.cc @@ -515,8 +515,8 @@ CacheMemory::isLocked(Addr address, int context) } CacheMemory:: -CacheMemoryStats::CacheMemoryStats(Stats::Group *parent) - : Stats::Group(parent), +CacheMemoryStats::CacheMemoryStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(numDataArrayReads, "Number of data array reads"), ADD_STAT(numDataArrayWrites, "Number of data array writes"), ADD_STAT(numTagArrayReads, "Number of tag array reads"), @@ -541,56 +541,60 @@ CacheMemoryStats::CacheMemoryStats(Stats::Group *parent) ADD_STAT(m_accessModeType, "") { numDataArrayReads - .flags(Stats::nozero); + .flags(statistics::nozero); numDataArrayWrites - .flags(Stats::nozero); + .flags(statistics::nozero); numTagArrayReads - .flags(Stats::nozero); + .flags(statistics::nozero); numTagArrayWrites - .flags(Stats::nozero); + .flags(statistics::nozero); numTagArrayStalls - .flags(Stats::nozero); + .flags(statistics::nozero); numDataArrayStalls - .flags(Stats::nozero); + .flags(statistics::nozero); htmTransCommitReadSet .init(8) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan); htmTransCommitWriteSet .init(8) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan); htmTransAbortReadSet .init(8) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan); htmTransAbortWriteSet .init(8) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan); + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan); m_prefetch_hits - .flags(Stats::nozero); + .flags(statistics::nozero); m_prefetch_misses - .flags(Stats::nozero); + .flags(statistics::nozero); m_prefetch_accesses - .flags(Stats::nozero); + .flags(statistics::nozero); m_accessModeType .init(RubyRequestType_NUM) - .flags(Stats::pdf | Stats::total); + .flags(statistics::pdf | statistics::total); for (int i = 0; i < RubyAccessMode_NUM; i++) { m_accessModeType .subname(i, RubyAccessMode_to_string(RubyAccessMode(i))) - .flags(Stats::nozero) + .flags(statistics::nozero) ; } } diff --git a/src/mem/ruby/structures/CacheMemory.hh b/src/mem/ruby/structures/CacheMemory.hh index 30eeedb4e2..86029db42e 100644 --- a/src/mem/ruby/structures/CacheMemory.hh +++ b/src/mem/ruby/structures/CacheMemory.hh @@ -206,33 +206,33 @@ class CacheMemory : public SimObject bool m_use_occupancy; private: - struct CacheMemoryStats : public Stats::Group + struct CacheMemoryStats : public statistics::Group { - CacheMemoryStats(Stats::Group *parent); + CacheMemoryStats(statistics::Group *parent); - Stats::Scalar numDataArrayReads; - Stats::Scalar numDataArrayWrites; - Stats::Scalar numTagArrayReads; - Stats::Scalar numTagArrayWrites; + statistics::Scalar numDataArrayReads; + statistics::Scalar numDataArrayWrites; + statistics::Scalar numTagArrayReads; + statistics::Scalar numTagArrayWrites; - Stats::Scalar numTagArrayStalls; - Stats::Scalar numDataArrayStalls; + statistics::Scalar numTagArrayStalls; + statistics::Scalar numDataArrayStalls; // hardware transactional memory - Stats::Histogram htmTransCommitReadSet; - Stats::Histogram htmTransCommitWriteSet; - Stats::Histogram htmTransAbortReadSet; - Stats::Histogram htmTransAbortWriteSet; + statistics::Histogram htmTransCommitReadSet; + statistics::Histogram htmTransCommitWriteSet; + statistics::Histogram htmTransAbortReadSet; + statistics::Histogram htmTransAbortWriteSet; - Stats::Scalar m_demand_hits; - Stats::Scalar m_demand_misses; - Stats::Formula m_demand_accesses; + statistics::Scalar m_demand_hits; + statistics::Scalar m_demand_misses; + statistics::Formula m_demand_accesses; - Stats::Scalar m_prefetch_hits; - Stats::Scalar m_prefetch_misses; - Stats::Formula m_prefetch_accesses; + statistics::Scalar m_prefetch_hits; + statistics::Scalar m_prefetch_misses; + statistics::Formula m_prefetch_accesses; - Stats::Vector m_accessModeType; + statistics::Vector m_accessModeType; } cacheMemoryStats; public: diff --git a/src/mem/ruby/structures/RubyPrefetcher.cc b/src/mem/ruby/structures/RubyPrefetcher.cc index 7848b142fd..d52b2f5fb0 100644 --- a/src/mem/ruby/structures/RubyPrefetcher.cc +++ b/src/mem/ruby/structures/RubyPrefetcher.cc @@ -64,8 +64,8 @@ RubyPrefetcher::RubyPrefetcher(const Params &p) } RubyPrefetcher:: -RubyPrefetcherStats::RubyPrefetcherStats(Stats::Group *parent) - : Stats::Group(parent, "RubyPrefetcher"), +RubyPrefetcherStats::RubyPrefetcherStats(statistics::Group *parent) + : statistics::Group(parent, "RubyPrefetcher"), ADD_STAT(numMissObserved, "Number of misses observed"), ADD_STAT(numAllocatedStreams, "Number of streams allocated for " "prefetching"), diff --git a/src/mem/ruby/structures/RubyPrefetcher.hh b/src/mem/ruby/structures/RubyPrefetcher.hh index 1d3028baf5..13989f1acb 100644 --- a/src/mem/ruby/structures/RubyPrefetcher.hh +++ b/src/mem/ruby/structures/RubyPrefetcher.hh @@ -234,24 +234,24 @@ class RubyPrefetcher : public SimObject const Addr m_page_shift; - struct RubyPrefetcherStats : public Stats::Group + struct RubyPrefetcherStats : public statistics::Group { - RubyPrefetcherStats(Stats::Group *parent); + RubyPrefetcherStats(statistics::Group *parent); //! Count of accesses to the prefetcher - Stats::Scalar numMissObserved; + statistics::Scalar numMissObserved; //! Count of prefetch streams allocated - Stats::Scalar numAllocatedStreams; + statistics::Scalar numAllocatedStreams; //! Count of prefetch requests made - Stats::Scalar numPrefetchRequested; + statistics::Scalar numPrefetchRequested; //! Count of successful prefetches - Stats::Scalar numHits; + statistics::Scalar numHits; //! Count of partial successful prefetches - Stats::Scalar numPartialHits; + statistics::Scalar numPartialHits; //! Count of pages crossed - Stats::Scalar numPagesCrossed; + statistics::Scalar numPagesCrossed; //! Count of misses incurred for blocks that were prefetched - Stats::Scalar numMissedPrefetchedBlocks; + statistics::Scalar numMissedPrefetchedBlocks; } rubyPrefetcherStats; }; diff --git a/src/mem/ruby/structures/TBEStorage.cc b/src/mem/ruby/structures/TBEStorage.cc index 11a123083e..868435286f 100644 --- a/src/mem/ruby/structures/TBEStorage.cc +++ b/src/mem/ruby/structures/TBEStorage.cc @@ -37,15 +37,15 @@ #include -TBEStorage::TBEStorage(Stats::Group *parent, int number_of_TBEs) +TBEStorage::TBEStorage(statistics::Group *parent, int number_of_TBEs) : m_reserved(0), m_stats(parent) { for (int i = 0; i < number_of_TBEs; ++i) m_slots_avail.push(i); } -TBEStorage::TBEStorageStats::TBEStorageStats(Stats::Group *parent) - : Stats::Group(parent), +TBEStorage::TBEStorageStats::TBEStorageStats(statistics::Group *parent) + : statistics::Group(parent), ADD_STAT(avg_size, "Avg. number of slots allocated"), ADD_STAT(avg_util, "Avg. utilization"), ADD_STAT(avg_reserved, "Avg. number of slots reserved") diff --git a/src/mem/ruby/structures/TBEStorage.hh b/src/mem/ruby/structures/TBEStorage.hh index 358fa0cdb9..3e29a52628 100644 --- a/src/mem/ruby/structures/TBEStorage.hh +++ b/src/mem/ruby/structures/TBEStorage.hh @@ -73,7 +73,7 @@ class TBEStorage { public: - TBEStorage(Stats::Group *parent, int number_of_TBEs); + TBEStorage(statistics::Group *parent, int number_of_TBEs); // Returns the current number of slots allocated int size() const { return m_slots_used.size(); } @@ -118,14 +118,14 @@ class TBEStorage std::stack m_slots_avail; std::unordered_map m_slots_used; - struct TBEStorageStats : public Stats::Group + struct TBEStorageStats : public statistics::Group { - TBEStorageStats(Stats::Group *parent); + TBEStorageStats(statistics::Group *parent); // Statistical variables - Stats::Average avg_size; - Stats::Average avg_util; - Stats::Average avg_reserved; + statistics::Average avg_size; + statistics::Average avg_util; + statistics::Average avg_reserved; } m_stats; }; diff --git a/src/mem/ruby/system/GPUCoalescer.cc b/src/mem/ruby/system/GPUCoalescer.cc index 43b8fd26e4..d3e44e131a 100644 --- a/src/mem/ruby/system/GPUCoalescer.cc +++ b/src/mem/ruby/system/GPUCoalescer.cc @@ -222,35 +222,39 @@ GPUCoalescer::GPUCoalescer(const Params &p) m_missLatencyHist.init(10); for (int i = 0; i < RubyRequestType_NUM; i++) { - m_typeLatencyHist.push_back(new Stats::Histogram()); + m_typeLatencyHist.push_back(new statistics::Histogram()); m_typeLatencyHist[i]->init(10); - m_missTypeLatencyHist.push_back(new Stats::Histogram()); + m_missTypeLatencyHist.push_back(new statistics::Histogram()); m_missTypeLatencyHist[i]->init(10); } for (int i = 0; i < MachineType_NUM; i++) { - m_missMachLatencyHist.push_back(new Stats::Histogram()); + m_missMachLatencyHist.push_back(new statistics::Histogram()); m_missMachLatencyHist[i]->init(10); - m_IssueToInitialDelayHist.push_back(new Stats::Histogram()); + m_IssueToInitialDelayHist.push_back(new statistics::Histogram()); m_IssueToInitialDelayHist[i]->init(10); - m_InitialToForwardDelayHist.push_back(new Stats::Histogram()); + m_InitialToForwardDelayHist.push_back(new statistics::Histogram()); m_InitialToForwardDelayHist[i]->init(10); - m_ForwardToFirstResponseDelayHist.push_back(new Stats::Histogram()); + m_ForwardToFirstResponseDelayHist.push_back( + new statistics::Histogram()); m_ForwardToFirstResponseDelayHist[i]->init(10); - m_FirstResponseToCompletionDelayHist.push_back(new Stats::Histogram()); + m_FirstResponseToCompletionDelayHist.push_back( + new statistics::Histogram()); m_FirstResponseToCompletionDelayHist[i]->init(10); } for (int i = 0; i < RubyRequestType_NUM; i++) { - m_missTypeMachLatencyHist.push_back(std::vector()); + m_missTypeMachLatencyHist.push_back( + std::vector()); for (int j = 0; j < MachineType_NUM; j++) { - m_missTypeMachLatencyHist[i].push_back(new Stats::Histogram()); + m_missTypeMachLatencyHist[i].push_back( + new statistics::Histogram()); m_missTypeMachLatencyHist[i][j]->init(10); } } diff --git a/src/mem/ruby/system/GPUCoalescer.hh b/src/mem/ruby/system/GPUCoalescer.hh index 01ad1d2f1b..d19fc22c3c 100644 --- a/src/mem/ruby/system/GPUCoalescer.hh +++ b/src/mem/ruby/system/GPUCoalescer.hh @@ -333,36 +333,36 @@ class GPUCoalescer : public RubyPort GMTokenPort& getGMTokenPort() { return gmTokenPort; } - Stats::Histogram& getOutstandReqHist() { return m_outstandReqHist; } + statistics::Histogram& getOutstandReqHist() { return m_outstandReqHist; } - Stats::Histogram& getLatencyHist() { return m_latencyHist; } - Stats::Histogram& getTypeLatencyHist(uint32_t t) + statistics::Histogram& getLatencyHist() { return m_latencyHist; } + statistics::Histogram& getTypeLatencyHist(uint32_t t) { return *m_typeLatencyHist[t]; } - Stats::Histogram& getMissLatencyHist() + statistics::Histogram& getMissLatencyHist() { return m_missLatencyHist; } - Stats::Histogram& getMissTypeLatencyHist(uint32_t t) + statistics::Histogram& getMissTypeLatencyHist(uint32_t t) { return *m_missTypeLatencyHist[t]; } - Stats::Histogram& getMissMachLatencyHist(uint32_t t) const + statistics::Histogram& getMissMachLatencyHist(uint32_t t) const { return *m_missMachLatencyHist[t]; } - Stats::Histogram& + statistics::Histogram& getMissTypeMachLatencyHist(uint32_t r, uint32_t t) const { return *m_missTypeMachLatencyHist[r][t]; } - Stats::Histogram& getIssueToInitialDelayHist(uint32_t t) const + statistics::Histogram& getIssueToInitialDelayHist(uint32_t t) const { return *m_IssueToInitialDelayHist[t]; } - Stats::Histogram& + statistics::Histogram& getInitialToForwardDelayHist(const MachineType t) const { return *m_InitialToForwardDelayHist[t]; } - Stats::Histogram& + statistics::Histogram& getForwardRequestToFirstResponseHist(const MachineType t) const { return *m_ForwardToFirstResponseDelayHist[t]; } - Stats::Histogram& + statistics::Histogram& getFirstResponseToCompletionDelayHist(const MachineType t) const { return *m_FirstResponseToCompletionDelayHist[t]; } @@ -458,63 +458,64 @@ class GPUCoalescer : public RubyPort // TODO - Need to update the following stats once the VIPER protocol // is re-integrated. // // m5 style stats for TCP hit/miss counts -// Stats::Scalar GPU_TCPLdHits; -// Stats::Scalar GPU_TCPLdTransfers; -// Stats::Scalar GPU_TCCLdHits; -// Stats::Scalar GPU_LdMiss; +// statistics::Scalar GPU_TCPLdHits; +// statistics::Scalar GPU_TCPLdTransfers; +// statistics::Scalar GPU_TCCLdHits; +// statistics::Scalar GPU_LdMiss; // -// Stats::Scalar GPU_TCPStHits; -// Stats::Scalar GPU_TCPStTransfers; -// Stats::Scalar GPU_TCCStHits; -// Stats::Scalar GPU_StMiss; +// statistics::Scalar GPU_TCPStHits; +// statistics::Scalar GPU_TCPStTransfers; +// statistics::Scalar GPU_TCCStHits; +// statistics::Scalar GPU_StMiss; // -// Stats::Scalar CP_TCPLdHits; -// Stats::Scalar CP_TCPLdTransfers; -// Stats::Scalar CP_TCCLdHits; -// Stats::Scalar CP_LdMiss; +// statistics::Scalar CP_TCPLdHits; +// statistics::Scalar CP_TCPLdTransfers; +// statistics::Scalar CP_TCCLdHits; +// statistics::Scalar CP_LdMiss; // -// Stats::Scalar CP_TCPStHits; -// Stats::Scalar CP_TCPStTransfers; -// Stats::Scalar CP_TCCStHits; -// Stats::Scalar CP_StMiss; +// statistics::Scalar CP_TCPStHits; +// statistics::Scalar CP_TCPStTransfers; +// statistics::Scalar CP_TCCStHits; +// statistics::Scalar CP_StMiss; //! Histogram for number of outstanding requests per cycle. - Stats::Histogram m_outstandReqHist; + statistics::Histogram m_outstandReqHist; //! Histogram for holding latency profile of all requests. - Stats::Histogram m_latencyHist; - std::vector m_typeLatencyHist; + statistics::Histogram m_latencyHist; + std::vector m_typeLatencyHist; //! Histogram for holding latency profile of all requests that //! miss in the controller connected to this sequencer. - Stats::Histogram m_missLatencyHist; - std::vector m_missTypeLatencyHist; + statistics::Histogram m_missLatencyHist; + std::vector m_missTypeLatencyHist; //! Histograms for profiling the latencies for requests that //! required external messages. - std::vector m_missMachLatencyHist; - std::vector< std::vector > m_missTypeMachLatencyHist; + std::vector m_missMachLatencyHist; + std::vector> + m_missTypeMachLatencyHist; //! Histograms for recording the breakdown of miss latency - std::vector m_IssueToInitialDelayHist; - std::vector m_InitialToForwardDelayHist; - std::vector m_ForwardToFirstResponseDelayHist; - std::vector m_FirstResponseToCompletionDelayHist; + std::vector m_IssueToInitialDelayHist; + std::vector m_InitialToForwardDelayHist; + std::vector m_ForwardToFirstResponseDelayHist; + std::vector m_FirstResponseToCompletionDelayHist; // TODO - Need to update the following stats once the VIPER protocol // is re-integrated. -// Stats::Distribution numHopDelays; -// Stats::Distribution tcpToTccDelay; -// Stats::Distribution tccToSdDelay; -// Stats::Distribution sdToSdDelay; -// Stats::Distribution sdToTccDelay; -// Stats::Distribution tccToTcpDelay; +// statistics::Distribution numHopDelays; +// statistics::Distribution tcpToTccDelay; +// statistics::Distribution tccToSdDelay; +// statistics::Distribution sdToSdDelay; +// statistics::Distribution sdToTccDelay; +// statistics::Distribution tccToTcpDelay; // -// Stats::Average avgTcpToTcc; -// Stats::Average avgTccToSd; -// Stats::Average avgSdToSd; -// Stats::Average avgSdToTcc; -// Stats::Average avgTccToTcp; +// statistics::Average avgTcpToTcc; +// statistics::Average avgTccToSd; +// statistics::Average avgSdToSd; +// statistics::Average avgSdToTcc; +// statistics::Average avgTccToTcp; private: // Token port is used to send/receive tokens to/from GPU's global memory diff --git a/src/mem/ruby/system/HTMSequencer.cc b/src/mem/ruby/system/HTMSequencer.cc index 0d718028f6..f968c25c42 100644 --- a/src/mem/ruby/system/HTMSequencer.cc +++ b/src/mem/ruby/system/HTMSequencer.cc @@ -74,16 +74,19 @@ HTMSequencer::HTMSequencer(const RubyHTMSequencerParams &p) // hardware transactional memory m_htm_transaction_cycles .init(10) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan) + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan) ; m_htm_transaction_instructions .init(10) - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan) + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan) ; auto num_causes = static_cast(HtmFailureFaultCause::NUM_CAUSES); m_htm_transaction_abort_cause .init(num_causes) - .flags(Stats::total | Stats::pdf | Stats::dist | Stats::nozero) + .flags(statistics::total | statistics::pdf | statistics::dist | + statistics::nozero) ; for (unsigned cause_idx = 0; cause_idx < num_causes; ++cause_idx) { @@ -208,20 +211,23 @@ HTMSequencer::regStats() .init(10) .name(name() + ".htm_transaction_cycles") .desc("number of cycles spent in an outer transaction") - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan) + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan) ; m_htm_transaction_instructions .init(10) .name(name() + ".htm_transaction_instructions") .desc("number of instructions spent in an outer transaction") - .flags(Stats::pdf | Stats::dist | Stats::nozero | Stats::nonan) + .flags(statistics::pdf | statistics::dist | statistics::nozero | + statistics::nonan) ; auto num_causes = static_cast(HtmFailureFaultCause::NUM_CAUSES); m_htm_transaction_abort_cause .init(num_causes) .name(name() + ".htm_transaction_abort_cause") .desc("cause of htm transaction abort") - .flags(Stats::total | Stats::pdf | Stats::dist | Stats::nozero) + .flags(statistics::total | statistics::pdf | statistics::dist | + statistics::nozero) ; for (unsigned cause_idx = 0; cause_idx < num_causes; ++cause_idx) { diff --git a/src/mem/ruby/system/HTMSequencer.hh b/src/mem/ruby/system/HTMSequencer.hh index e24cb57ee7..f1c651959c 100644 --- a/src/mem/ruby/system/HTMSequencer.hh +++ b/src/mem/ruby/system/HTMSequencer.hh @@ -95,11 +95,11 @@ class HTMSequencer : public Sequencer Counter m_htmstart_instruction; //! Histogram of cycle latencies of HTM transactions - Stats::Histogram m_htm_transaction_cycles; + statistics::Histogram m_htm_transaction_cycles; //! Histogram of instruction lengths of HTM transactions - Stats::Histogram m_htm_transaction_instructions; + statistics::Histogram m_htm_transaction_instructions; //! Causes for HTM transaction aborts - Stats::Vector m_htm_transaction_abort_cause; + statistics::Vector m_htm_transaction_abort_cause; }; inline std::ostream& diff --git a/src/mem/ruby/system/RubySystem.cc b/src/mem/ruby/system/RubySystem.cc index 5c0b5e4526..239b652eec 100644 --- a/src/mem/ruby/system/RubySystem.cc +++ b/src/mem/ruby/system/RubySystem.cc @@ -85,7 +85,7 @@ RubySystem::RubySystem(const Params &p) m_abstract_controls.resize(MachineType_NUM); // Collate the statistics before they are printed. - Stats::registerDumpCallback([this]() { collateStats(); }); + statistics::registerDumpCallback([this]() { collateStats(); }); // Create the profiler m_profiler = new Profiler(p, this); m_phys_mem = p.phys_mem; diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index 58cace6344..af1149a0ed 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -85,45 +85,50 @@ Sequencer::Sequencer(const Params &p) m_missLatencyHist.init(10); for (int i = 0; i < RubyRequestType_NUM; i++) { - m_typeLatencyHist.push_back(new Stats::Histogram()); + m_typeLatencyHist.push_back(new statistics::Histogram()); m_typeLatencyHist[i]->init(10); - m_hitTypeLatencyHist.push_back(new Stats::Histogram()); + m_hitTypeLatencyHist.push_back(new statistics::Histogram()); m_hitTypeLatencyHist[i]->init(10); - m_missTypeLatencyHist.push_back(new Stats::Histogram()); + m_missTypeLatencyHist.push_back(new statistics::Histogram()); m_missTypeLatencyHist[i]->init(10); } for (int i = 0; i < MachineType_NUM; i++) { - m_hitMachLatencyHist.push_back(new Stats::Histogram()); + m_hitMachLatencyHist.push_back(new statistics::Histogram()); m_hitMachLatencyHist[i]->init(10); - m_missMachLatencyHist.push_back(new Stats::Histogram()); + m_missMachLatencyHist.push_back(new statistics::Histogram()); m_missMachLatencyHist[i]->init(10); - m_IssueToInitialDelayHist.push_back(new Stats::Histogram()); + m_IssueToInitialDelayHist.push_back(new statistics::Histogram()); m_IssueToInitialDelayHist[i]->init(10); - m_InitialToForwardDelayHist.push_back(new Stats::Histogram()); + m_InitialToForwardDelayHist.push_back(new statistics::Histogram()); m_InitialToForwardDelayHist[i]->init(10); - m_ForwardToFirstResponseDelayHist.push_back(new Stats::Histogram()); + m_ForwardToFirstResponseDelayHist.push_back( + new statistics::Histogram()); m_ForwardToFirstResponseDelayHist[i]->init(10); - m_FirstResponseToCompletionDelayHist.push_back(new Stats::Histogram()); + m_FirstResponseToCompletionDelayHist.push_back( + new statistics::Histogram()); m_FirstResponseToCompletionDelayHist[i]->init(10); } for (int i = 0; i < RubyRequestType_NUM; i++) { - m_hitTypeMachLatencyHist.push_back(std::vector()); - m_missTypeMachLatencyHist.push_back(std::vector()); + m_hitTypeMachLatencyHist.push_back( + std::vector()); + m_missTypeMachLatencyHist.push_back( + std::vector()); for (int j = 0; j < MachineType_NUM; j++) { - m_hitTypeMachLatencyHist[i].push_back(new Stats::Histogram()); + m_hitTypeMachLatencyHist[i].push_back(new statistics::Histogram()); m_hitTypeMachLatencyHist[i][j]->init(10); - m_missTypeMachLatencyHist[i].push_back(new Stats::Histogram()); + m_missTypeMachLatencyHist[i].push_back( + new statistics::Histogram()); m_missTypeMachLatencyHist[i][j]->init(10); } } diff --git a/src/mem/ruby/system/Sequencer.hh b/src/mem/ruby/system/Sequencer.hh index d8ffb863c3..6b6aa1f2f8 100644 --- a/src/mem/ruby/system/Sequencer.hh +++ b/src/mem/ruby/system/Sequencer.hh @@ -139,50 +139,50 @@ class Sequencer : public RubyPort virtual int functionalWrite(Packet *func_pkt) override; void recordRequestType(SequencerRequestType requestType); - Stats::Histogram& getOutstandReqHist() { return m_outstandReqHist; } + statistics::Histogram& getOutstandReqHist() { return m_outstandReqHist; } - Stats::Histogram& getLatencyHist() { return m_latencyHist; } - Stats::Histogram& getTypeLatencyHist(uint32_t t) + statistics::Histogram& getLatencyHist() { return m_latencyHist; } + statistics::Histogram& getTypeLatencyHist(uint32_t t) { return *m_typeLatencyHist[t]; } - Stats::Histogram& getHitLatencyHist() { return m_hitLatencyHist; } - Stats::Histogram& getHitTypeLatencyHist(uint32_t t) + statistics::Histogram& getHitLatencyHist() { return m_hitLatencyHist; } + statistics::Histogram& getHitTypeLatencyHist(uint32_t t) { return *m_hitTypeLatencyHist[t]; } - Stats::Histogram& getHitMachLatencyHist(uint32_t t) + statistics::Histogram& getHitMachLatencyHist(uint32_t t) { return *m_hitMachLatencyHist[t]; } - Stats::Histogram& getHitTypeMachLatencyHist(uint32_t r, uint32_t t) + statistics::Histogram& getHitTypeMachLatencyHist(uint32_t r, uint32_t t) { return *m_hitTypeMachLatencyHist[r][t]; } - Stats::Histogram& getMissLatencyHist() + statistics::Histogram& getMissLatencyHist() { return m_missLatencyHist; } - Stats::Histogram& getMissTypeLatencyHist(uint32_t t) + statistics::Histogram& getMissTypeLatencyHist(uint32_t t) { return *m_missTypeLatencyHist[t]; } - Stats::Histogram& getMissMachLatencyHist(uint32_t t) const + statistics::Histogram& getMissMachLatencyHist(uint32_t t) const { return *m_missMachLatencyHist[t]; } - Stats::Histogram& + statistics::Histogram& getMissTypeMachLatencyHist(uint32_t r, uint32_t t) const { return *m_missTypeMachLatencyHist[r][t]; } - Stats::Histogram& getIssueToInitialDelayHist(uint32_t t) const + statistics::Histogram& getIssueToInitialDelayHist(uint32_t t) const { return *m_IssueToInitialDelayHist[t]; } - Stats::Histogram& + statistics::Histogram& getInitialToForwardDelayHist(const MachineType t) const { return *m_InitialToForwardDelayHist[t]; } - Stats::Histogram& + statistics::Histogram& getForwardRequestToFirstResponseHist(const MachineType t) const { return *m_ForwardToFirstResponseDelayHist[t]; } - Stats::Histogram& + statistics::Histogram& getFirstResponseToCompletionDelayHist(const MachineType t) const { return *m_FirstResponseToCompletionDelayHist[t]; } - Stats::Counter getIncompleteTimes(const MachineType t) const + statistics::Counter getIncompleteTimes(const MachineType t) const { return m_IncompleteTimes[t]; } private: @@ -237,38 +237,39 @@ class Sequencer : public RubyPort bool m_runningGarnetStandalone; //! Histogram for number of outstanding requests per cycle. - Stats::Histogram m_outstandReqHist; + statistics::Histogram m_outstandReqHist; //! Histogram for holding latency profile of all requests. - Stats::Histogram m_latencyHist; - std::vector m_typeLatencyHist; + statistics::Histogram m_latencyHist; + std::vector m_typeLatencyHist; //! Histogram for holding latency profile of all requests that //! hit in the controller connected to this sequencer. - Stats::Histogram m_hitLatencyHist; - std::vector m_hitTypeLatencyHist; + statistics::Histogram m_hitLatencyHist; + std::vector m_hitTypeLatencyHist; //! Histograms for profiling the latencies for requests that //! did not required external messages. - std::vector m_hitMachLatencyHist; - std::vector< std::vector > m_hitTypeMachLatencyHist; + std::vector m_hitMachLatencyHist; + std::vector> m_hitTypeMachLatencyHist; //! Histogram for holding latency profile of all requests that //! miss in the controller connected to this sequencer. - Stats::Histogram m_missLatencyHist; - std::vector m_missTypeLatencyHist; + statistics::Histogram m_missLatencyHist; + std::vector m_missTypeLatencyHist; //! Histograms for profiling the latencies for requests that //! required external messages. - std::vector m_missMachLatencyHist; - std::vector< std::vector > m_missTypeMachLatencyHist; + std::vector m_missMachLatencyHist; + std::vector> + m_missTypeMachLatencyHist; //! Histograms for recording the breakdown of miss latency - std::vector m_IssueToInitialDelayHist; - std::vector m_InitialToForwardDelayHist; - std::vector m_ForwardToFirstResponseDelayHist; - std::vector m_FirstResponseToCompletionDelayHist; - std::vector m_IncompleteTimes; + std::vector m_IssueToInitialDelayHist; + std::vector m_InitialToForwardDelayHist; + std::vector m_ForwardToFirstResponseDelayHist; + std::vector m_FirstResponseToCompletionDelayHist; + std::vector m_IncompleteTimes; EventFunctionWrapper deadlockCheckEvent; diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index 747baccaed..77c999d70e 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -391,8 +391,8 @@ int m_counters[${ident}_State_NUM][${ident}_Event_NUM]; int m_event_counters[${ident}_Event_NUM]; bool m_possible[${ident}_State_NUM][${ident}_Event_NUM]; -static std::vector eventVec; -static std::vector > transVec; +static std::vector eventVec; +static std::vector > transVec; static int m_num_controllers; // Internal functions @@ -536,8 +536,8 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr); code(''' int $c_ident::m_num_controllers = 0; -std::vector $c_ident::eventVec; -std::vector > $c_ident::transVec; +std::vector $c_ident::eventVec; +std::vector > $c_ident::transVec; // for adding information to the protocol debug trace std::stringstream ${ident}_transitionComment; @@ -816,17 +816,17 @@ $c_ident::regStats() if (m_version == 0) { Profiler *profiler = params().ruby_system->getProfiler(); - Stats::Group *profilerStatsPtr = &profiler->rubyProfilerStats; + statistics::Group *profilerStatsPtr = &profiler->rubyProfilerStats; for (${ident}_Event event = ${ident}_Event_FIRST; event < ${ident}_Event_NUM; ++event) { std::string stat_name = "${c_ident}." + ${ident}_Event_to_string(event); - Stats::Vector *t = - new Stats::Vector(profilerStatsPtr, stat_name.c_str()); + statistics::Vector *t = + new statistics::Vector(profilerStatsPtr, stat_name.c_str()); t->init(m_num_controllers); - t->flags(Stats::pdf | Stats::total | Stats::oneline | - Stats::nozero); + t->flags(statistics::pdf | statistics::total | + statistics::oneline | statistics::nozero); eventVec.push_back(t); } @@ -834,18 +834,18 @@ $c_ident::regStats() for (${ident}_State state = ${ident}_State_FIRST; state < ${ident}_State_NUM; ++state) { - transVec.push_back(std::vector()); + transVec.push_back(std::vector()); for (${ident}_Event event = ${ident}_Event_FIRST; event < ${ident}_Event_NUM; ++event) { std::string stat_name = "${c_ident}." + ${ident}_State_to_string(state) + "." + ${ident}_Event_to_string(event); - Stats::Vector *t = - new Stats::Vector(profilerStatsPtr, stat_name.c_str()); + statistics::Vector *t = new statistics::Vector( + profilerStatsPtr, stat_name.c_str()); t->init(m_num_controllers); - t->flags(Stats::pdf | Stats::total | Stats::oneline | - Stats::nozero); + t->flags(statistics::pdf | statistics::total | + statistics::oneline | statistics::nozero); transVec[state].push_back(t); } } @@ -855,31 +855,32 @@ $c_ident::regStats() event < ${ident}_Event_NUM; ++event) { std::string stat_name = "outTransLatHist." + ${ident}_Event_to_string(event); - Stats::Histogram* t = new Stats::Histogram(&stats, stat_name.c_str()); + statistics::Histogram* t = + new statistics::Histogram(&stats, stat_name.c_str()); stats.outTransLatHist.push_back(t); t->init(5); - t->flags(Stats::pdf | Stats::total | - Stats::oneline | Stats::nozero); + t->flags(statistics::pdf | statistics::total | + statistics::oneline | statistics::nozero); - Stats::Scalar* r = new Stats::Scalar(&stats, + statistics::Scalar* r = new statistics::Scalar(&stats, (stat_name + ".retries").c_str()); stats.outTransLatHistRetries.push_back(r); - r->flags(Stats::nozero); + r->flags(statistics::nozero); } for (${ident}_Event event = ${ident}_Event_FIRST; event < ${ident}_Event_NUM; ++event) { std::string stat_name = ".inTransLatHist." + ${ident}_Event_to_string(event); - Stats::Scalar* r = new Stats::Scalar(&stats, + statistics::Scalar* r = new statistics::Scalar(&stats, (stat_name + ".total").c_str()); stats.inTransLatTotal.push_back(r); - r->flags(Stats::nozero); + r->flags(statistics::nozero); - r = new Stats::Scalar(&stats, + r = new statistics::Scalar(&stats, (stat_name + ".retries").c_str()); stats.inTransLatRetries.push_back(r); - r->flags(Stats::nozero); + r->flags(statistics::nozero); stats.inTransLatHist.emplace_back(); for (${ident}_State initial_state = ${ident}_State_FIRST; @@ -891,12 +892,12 @@ $c_ident::regStats() ${ident}_Event_to_string(event) + "." + ${ident}_State_to_string(initial_state) + "." + ${ident}_State_to_string(final_state); - Stats::Histogram* t = - new Stats::Histogram(&stats, stat_name.c_str()); + statistics::Histogram* t = + new statistics::Histogram(&stats, stat_name.c_str()); stats.inTransLatHist.back().back().push_back(t); t->init(5); - t->flags(Stats::pdf | Stats::total | - Stats::oneline | Stats::nozero); + t->flags(statistics::pdf | statistics::total | + statistics::oneline | statistics::nozero); } } } diff --git a/src/mem/snoop_filter.cc b/src/mem/snoop_filter.cc index e9e3a9cd41..90fec6f01b 100644 --- a/src/mem/snoop_filter.cc +++ b/src/mem/snoop_filter.cc @@ -387,22 +387,22 @@ SnoopFilter::updateResponse(const Packet* cpkt, const ResponsePort& __func__, sf_item.requested, sf_item.holder); } -SnoopFilter::SnoopFilterStats::SnoopFilterStats(Stats::Group *parent) - : Stats::Group(parent), - ADD_STAT(totRequests, Stats::units::Count::get(), +SnoopFilter::SnoopFilterStats::SnoopFilterStats(statistics::Group *parent) + : statistics::Group(parent), + ADD_STAT(totRequests, statistics::units::Count::get(), "Total number of requests made to the snoop filter."), - ADD_STAT(hitSingleRequests, Stats::units::Count::get(), + ADD_STAT(hitSingleRequests, statistics::units::Count::get(), "Number of requests hitting in the snoop filter with a single " "holder of the requested data."), - ADD_STAT(hitMultiRequests, Stats::units::Count::get(), + ADD_STAT(hitMultiRequests, statistics::units::Count::get(), "Number of requests hitting in the snoop filter with multiple " "(>1) holders of the requested data."), - ADD_STAT(totSnoops, Stats::units::Count::get(), + ADD_STAT(totSnoops, statistics::units::Count::get(), "Total number of snoops made to the snoop filter."), - ADD_STAT(hitSingleSnoops, Stats::units::Count::get(), + ADD_STAT(hitSingleSnoops, statistics::units::Count::get(), "Number of snoops hitting in the snoop filter with a single " "holder of the requested data."), - ADD_STAT(hitMultiSnoops, Stats::units::Count::get(), + ADD_STAT(hitMultiSnoops, statistics::units::Count::get(), "Number of snoops hitting in the snoop filter with multiple " "(>1) holders of the requested data.") {} diff --git a/src/mem/snoop_filter.hh b/src/mem/snoop_filter.hh index a560ecee12..d85b3f5eef 100644 --- a/src/mem/snoop_filter.hh +++ b/src/mem/snoop_filter.hh @@ -315,17 +315,17 @@ class SnoopFilter : public SimObject }; /** Statistics */ - struct SnoopFilterStats : public Stats::Group + struct SnoopFilterStats : public statistics::Group { - SnoopFilterStats(Stats::Group *parent); + SnoopFilterStats(statistics::Group *parent); - Stats::Scalar totRequests; - Stats::Scalar hitSingleRequests; - Stats::Scalar hitMultiRequests; + statistics::Scalar totRequests; + statistics::Scalar hitSingleRequests; + statistics::Scalar hitMultiRequests; - Stats::Scalar totSnoops; - Stats::Scalar hitSingleSnoops; - Stats::Scalar hitMultiSnoops; + statistics::Scalar totSnoops; + statistics::Scalar hitSingleSnoops; + statistics::Scalar hitMultiSnoops; } stats; }; diff --git a/src/mem/xbar.cc b/src/mem/xbar.cc index 5c99cc52f2..ca746f577b 100644 --- a/src/mem/xbar.cc +++ b/src/mem/xbar.cc @@ -63,11 +63,11 @@ BaseXBar::BaseXBar(const BaseXBarParams &p) gotAllAddrRanges(false), defaultPortID(InvalidPortID), useDefaultRange(p.use_default_range), - ADD_STAT(transDist, Stats::units::Count::get(), + ADD_STAT(transDist, statistics::units::Count::get(), "Transaction distribution"), - ADD_STAT(pktCount, Stats::units::Count::get(), + ADD_STAT(pktCount, statistics::units::Count::get(), "Packet count per connected requestor and responder"), - ADD_STAT(pktSize, Stats::units::Byte::get(), + ADD_STAT(pktSize, statistics::units::Byte::get(), "Cumulative packet size per connected requestor and responder") { } @@ -139,18 +139,18 @@ BaseXBar::calcPacketTiming(PacketPtr pkt, Tick header_delay) template BaseXBar::Layer::Layer(DstType& _port, BaseXBar& _xbar, const std::string& _name) : - Stats::Group(&_xbar, _name.c_str()), + statistics::Group(&_xbar, _name.c_str()), port(_port), xbar(_xbar), _name(xbar.name() + "." + _name), state(IDLE), waitingForPeer(NULL), releaseEvent([this]{ releaseLayer(); }, name()), - ADD_STAT(occupancy, Stats::units::Tick::get(), "Layer occupancy (ticks)"), - ADD_STAT(utilization, Stats::units::Ratio::get(), "Layer utilization") + ADD_STAT(occupancy, statistics::units::Tick::get(), "Layer occupancy (ticks)"), + ADD_STAT(utilization, statistics::units::Ratio::get(), "Layer utilization") { occupancy - .flags(Stats::nozero); + .flags(statistics::nozero); utilization .precision(1) - .flags(Stats::nozero); + .flags(statistics::nozero); utilization = occupancy / simTicks; } @@ -542,7 +542,7 @@ BaseXBar::regStats() { ClockedObject::regStats(); - using namespace Stats; + using namespace statistics; transDist .init(MemCmd::NUM_MEM_CMDS) diff --git a/src/mem/xbar.hh b/src/mem/xbar.hh index 88be87f59c..640cacfe59 100644 --- a/src/mem/xbar.hh +++ b/src/mem/xbar.hh @@ -85,7 +85,7 @@ class BaseXBar : public ClockedObject * CPU-side ports, whereas a response layer holds memory-side ports. */ template - class Layer : public Drainable, public Stats::Group + class Layer : public Drainable, public statistics::Group { public: @@ -226,8 +226,8 @@ class BaseXBar : public ClockedObject * the time the layer spends in the busy state and are thus only * relevant when the memory system is in timing mode. */ - Stats::Scalar occupancy; - Stats::Formula utilization; + statistics::Scalar occupancy; + statistics::Formula utilization; }; @@ -396,9 +396,9 @@ class BaseXBar : public ClockedObject * ports and neighbouring CPU-side ports), summing up both directions * (request and response). */ - Stats::Vector transDist; - Stats::Vector2d pktCount; - Stats::Vector2d pktSize; + statistics::Vector transDist; + statistics::Vector2d pktCount; + statistics::Vector2d pktSize; public: diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 29350ea737..bb17a38304 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -1179,7 +1179,7 @@ class SimObject(object, metaclass=MetaSimObject): abstract = True cxx_header = "sim/sim_object.hh" - cxx_extra_bases = [ "Drainable", "Serializable", "Stats::Group" ] + cxx_extra_bases = [ "Drainable", "Serializable", "statistics::Group" ] eventq_index = Param.UInt32(Parent.eventq_index, "Event Queue Index") cxx_exports = [ diff --git a/src/python/pybind11/stats.cc b/src/python/pybind11/stats.cc index faa2f0e10f..91bf28caa5 100644 --- a/src/python/pybind11/stats.cc +++ b/src/python/pybind11/stats.cc @@ -55,7 +55,7 @@ namespace py = pybind11; static const py::object -cast_stat_info(const Stats::Info *info) +cast_stat_info(const statistics::Info *info) { /* PyBind11 gets confused by the InfoProxy magic, so we need to * explicitly cast to the right wrapper type. */ @@ -66,21 +66,23 @@ cast_stat_info(const Stats::Info *info) return py::cast(_stat); \ } while (0) - TRY_CAST(Stats::ScalarInfo); + TRY_CAST(statistics::ScalarInfo); /* FormulaInfo is a subclass of VectorInfo. Therefore, a cast to * FormulaInfo must be attempted before a cast to VectorInfo. Otherwise * instances of ForumlaInfo will be cast to VectorInfo. */ - TRY_CAST(Stats::FormulaInfo); - TRY_CAST(Stats::VectorInfo); - TRY_CAST(Stats::DistInfo); + TRY_CAST(statistics::FormulaInfo); + TRY_CAST(statistics::VectorInfo); + TRY_CAST(statistics::DistInfo); return py::cast(info); #undef TRY_CAST } -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ void pythonDump() @@ -104,130 +106,120 @@ pybind_init_stats(py::module_ &m_native) py::module_ m = m_native.def_submodule("stats"); m - .def("initSimStats", &Stats::initSimStats) - .def("initText", &Stats::initText, py::return_value_policy::reference) + .def("initSimStats", &statistics::initSimStats) + .def("initText", &statistics::initText, + py::return_value_policy::reference) #if HAVE_HDF5 - .def("initHDF5", &Stats::initHDF5) + .def("initHDF5", &statistics::initHDF5) #endif .def("registerPythonStatsHandlers", - &Stats::registerPythonStatsHandlers) - .def("schedStatEvent", &Stats::schedStatEvent) - .def("periodicStatDump", &Stats::periodicStatDump) - .def("updateEvents", &Stats::updateEvents) - .def("processResetQueue", &Stats::processResetQueue) - .def("processDumpQueue", &Stats::processDumpQueue) - .def("enable", &Stats::enable) - .def("enabled", &Stats::enabled) - .def("statsList", &Stats::statsList) + &statistics::registerPythonStatsHandlers) + .def("schedStatEvent", &statistics::schedStatEvent) + .def("periodicStatDump", &statistics::periodicStatDump) + .def("updateEvents", &statistics::updateEvents) + .def("processResetQueue", &statistics::processResetQueue) + .def("processDumpQueue", &statistics::processDumpQueue) + .def("enable", &statistics::enable) + .def("enabled", &statistics::enabled) + .def("statsList", &statistics::statsList) ; - py::class_(m, "Output") - .def("begin", &Stats::Output::begin) - .def("end", &Stats::Output::end) - .def("valid", &Stats::Output::valid) - .def("beginGroup", &Stats::Output::beginGroup) - .def("endGroup", &Stats::Output::endGroup) + py::class_(m, "Output") + .def("begin", &statistics::Output::begin) + .def("end", &statistics::Output::end) + .def("valid", &statistics::Output::valid) + .def("beginGroup", &statistics::Output::beginGroup) + .def("endGroup", &statistics::Output::endGroup) ; - py::class_>( - m, "Info") - .def_readwrite("name", &Stats::Info::name) - .def_property_readonly("unit", [](const Stats::Info &info) { + py::class_>(m, "Info") + .def_readwrite("name", &statistics::Info::name) + .def_property_readonly("unit", [](const statistics::Info &info) { return info.unit->getUnitString(); }) - .def_readonly("desc", &Stats::Info::desc) - .def_readonly("id", &Stats::Info::id) - .def_property_readonly("flags", [](const Stats::Info &info) { - return (Stats::FlagsType)info.flags; + .def_readonly("desc", &statistics::Info::desc) + .def_readonly("id", &statistics::Info::id) + .def_property_readonly("flags", [](const statistics::Info &info) { + return (statistics::FlagsType)info.flags; }) - .def("check", &Stats::Info::check) - .def("baseCheck", &Stats::Info::baseCheck) - .def("enable", &Stats::Info::enable) - .def("prepare", &Stats::Info::prepare) - .def("reset", &Stats::Info::reset) - .def("zero", &Stats::Info::zero) - .def("visit", &Stats::Info::visit) + .def("check", &statistics::Info::check) + .def("baseCheck", &statistics::Info::baseCheck) + .def("enable", &statistics::Info::enable) + .def("prepare", &statistics::Info::prepare) + .def("reset", &statistics::Info::reset) + .def("zero", &statistics::Info::zero) + .def("visit", &statistics::Info::visit) ; - py::class_>( + py::class_>( m, "ScalarInfo") - .def_property_readonly("value", [](const Stats::ScalarInfo &info) { - return info.value(); - }) - .def_property_readonly("result", [](const Stats::ScalarInfo &info) { - return info.result(); - }) - .def_property_readonly("total", [](const Stats::ScalarInfo &info) { - return info.total(); - }) + .def_property_readonly("value", + [](const statistics::ScalarInfo &info) { return info.value(); }) + .def_property_readonly("result", + [](const statistics::ScalarInfo &info) { return info.result(); }) + .def_property_readonly("total", + [](const statistics::ScalarInfo &info) { return info.total(); }) ; - py::class_>( + py::class_>( m, "VectorInfo") - .def_readwrite("subnames", &Stats::VectorInfo::subnames) - .def_readwrite("subdescs", &Stats::VectorInfo::subdescs) - .def_property_readonly("size", [](const Stats::VectorInfo &info) { - return info.size(); - }) - .def_property_readonly("value", [](const Stats::VectorInfo &info) { - return info.value(); - }) - .def_property_readonly("result", [](const Stats::VectorInfo &info) { - return info.result(); - }) - .def_property_readonly("total", [](const Stats::VectorInfo &info) { - return info.total(); - }) + .def_readwrite("subnames", &statistics::VectorInfo::subnames) + .def_readwrite("subdescs", &statistics::VectorInfo::subdescs) + .def_property_readonly("size", + [](const statistics::VectorInfo &info) { return info.size(); }) + .def_property_readonly("value", + [](const statistics::VectorInfo &info) { return info.value(); }) + .def_property_readonly("result", + [](const statistics::VectorInfo &info) { return info.result(); }) + .def_property_readonly("total", + [](const statistics::VectorInfo &info) { return info.total(); }) ; - py::class_>( + py::class_>( m, "FormulaInfo") - .def_property_readonly("str", [](const Stats::FormulaInfo &info) { - return info.str(); - }) + .def_property_readonly("str", + [](const statistics::FormulaInfo &info) { return info.str(); }) ; - py::class_>( + py::class_>( m, "DistInfo") - .def_property_readonly("min_val", [](const Stats::DistInfo &info) { - return info.data.min_val; - }) - .def_property_readonly("max_val", [](const Stats::DistInfo &info) { - return info.data.max_val; - }) - .def_property_readonly("bucket_size", [](const Stats::DistInfo &info) { + .def_property_readonly("min_val", + [](const statistics::DistInfo &info) { return info.data.min_val; }) + .def_property_readonly("max_val", + [](const statistics::DistInfo &info) { return info.data.max_val; }) + .def_property_readonly("bucket_size", + [](const statistics::DistInfo &info) { return info.data.bucket_size; }) - .def_property_readonly("values", [](const Stats::DistInfo &info) { - return info.data.cvec; - }) - .def_property_readonly("overflow", [](const Stats::DistInfo &info) { + .def_property_readonly("values", + [](const statistics::DistInfo &info) { return info.data.cvec; }) + .def_property_readonly("overflow", + [](const statistics::DistInfo &info) { return info.data.overflow; }) - .def_property_readonly("underflow", [](const Stats::DistInfo &info) { + .def_property_readonly("underflow", + [](const statistics::DistInfo &info) { return info.data.underflow; }) - .def_property_readonly("sum", [](const Stats::DistInfo &info) { - return info.data.sum; - }) - .def_property_readonly("logs", [](const Stats::DistInfo &info) { - return info.data.logs; - }) - .def_property_readonly("squares", [](const Stats::DistInfo &info) { - return info.data.squares; - }) + .def_property_readonly("sum", + [](const statistics::DistInfo &info) { return info.data.sum; }) + .def_property_readonly("logs", + [](const statistics::DistInfo &info) { return info.data.logs; }) + .def_property_readonly("squares", + [](const statistics::DistInfo &info) { return info.data.squares; }) ; - py::class_>( - m, "Group") - .def("regStats", &Stats::Group::regStats) - .def("resetStats", &Stats::Group::resetStats) - .def("preDumpStats", &Stats::Group::preDumpStats) - .def("getStats", [](const Stats::Group &self) + py::class_>(m, "Group") + .def("regStats", &statistics::Group::regStats) + .def("resetStats", &statistics::Group::resetStats) + .def("preDumpStats", &statistics::Group::preDumpStats) + .def("getStats", [](const statistics::Group &self) -> std::vector { auto stats = self.getStats(); @@ -238,11 +230,11 @@ pybind_init_stats(py::module_ &m_native) cast_stat_info); return py_stats; }) - .def("getStatGroups", &Stats::Group::getStatGroups) - .def("addStatGroup", &Stats::Group::addStatGroup) - .def("resolveStat", [](const Stats::Group &self, + .def("getStatGroups", &statistics::Group::getStatGroups) + .def("addStatGroup", &statistics::Group::addStatGroup) + .def("resolveStat", [](const statistics::Group &self, const std::string &name) -> py::object { - const Stats::Info *stat = self.resolveStat(name); + const statistics::Info *stat = self.resolveStat(name); if (!stat) throw pybind11::key_error("Unknown stat name"); diff --git a/src/sim/clock_domain.cc b/src/sim/clock_domain.cc index 1f6470f079..9d691e198a 100644 --- a/src/sim/clock_domain.cc +++ b/src/sim/clock_domain.cc @@ -52,8 +52,8 @@ #include "sim/voltage_domain.hh" ClockDomain::ClockDomainStats::ClockDomainStats(ClockDomain &cd) - : Stats::Group(&cd), - ADD_STAT(clock, Stats::units::Tick::get(), "Clock period in ticks") + : statistics::Group(&cd), + ADD_STAT(clock, statistics::units::Tick::get(), "Clock period in ticks") { // Expose the current clock period as a stat for observability in // the dumps diff --git a/src/sim/clock_domain.hh b/src/sim/clock_domain.hh index 9296c1ada6..12ad6deeec 100644 --- a/src/sim/clock_domain.hh +++ b/src/sim/clock_domain.hh @@ -140,14 +140,14 @@ class ClockDomain : public SimObject { children.push_back(clock_domain); } private: - struct ClockDomainStats : public Stats::Group + struct ClockDomainStats : public statistics::Group { ClockDomainStats(ClockDomain &cd); /** * Stat to report clock period of clock domain */ - Stats::Value clock; + statistics::Value clock; } stats; }; diff --git a/src/sim/dvfs_handler.cc b/src/sim/dvfs_handler.cc index 53b4271a89..5213e0f380 100644 --- a/src/sim/dvfs_handler.cc +++ b/src/sim/dvfs_handler.cc @@ -156,8 +156,8 @@ DVFSHandler::UpdateEvent::updatePerfLevel() { // Perform explicit stats dump for power estimation before performance // level migration - Stats::dump(); - Stats::reset(); + statistics::dump(); + statistics::reset(); // Update the performance level in the clock domain auto d = dvfsHandler->findDomain(domainIDToSet); diff --git a/src/sim/faults.hh b/src/sim/faults.hh index aaa689efeb..fc19b8e1c1 100644 --- a/src/sim/faults.hh +++ b/src/sim/faults.hh @@ -50,7 +50,7 @@ class ThreadContext; typedef const char *FaultName; -typedef Stats::Scalar FaultStat; +typedef statistics::Scalar FaultStat; class FaultBase { diff --git a/src/sim/power/mathexpr_powermodel.cc b/src/sim/power/mathexpr_powermodel.cc index e66d8d9935..9d26237ec5 100644 --- a/src/sim/power/mathexpr_powermodel.cc +++ b/src/sim/power/mathexpr_powermodel.cc @@ -62,7 +62,7 @@ MathExprPowerModel::startup() continue; } - auto *info = Stats::resolve(var); + auto *info = statistics::resolve(var); fatal_if(!info, "Failed to evaluate %s in expression:\n%s\n", var, expr.toStr()); statsMap[var] = info; @@ -82,7 +82,7 @@ MathExprPowerModel::eval(const MathExpr &expr) const double MathExprPowerModel::getStatValue(const std::string &name) const { - using namespace Stats; + using namespace statistics; // Automatic variables: if (name == "temp") { diff --git a/src/sim/power/mathexpr_powermodel.hh b/src/sim/power/mathexpr_powermodel.hh index deb425978a..ec1b90f438 100644 --- a/src/sim/power/mathexpr_powermodel.hh +++ b/src/sim/power/mathexpr_powermodel.hh @@ -44,7 +44,9 @@ #include "sim/mathexpr.hh" #include "sim/power/power_model.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ class Info; } @@ -99,7 +101,7 @@ class MathExprPowerModel : public PowerModelState MathExpr dyn_expr, st_expr; // Map that contains relevant stats for this power model - std::unordered_map statsMap; + std::unordered_map statsMap; }; #endif diff --git a/src/sim/power/power_model.cc b/src/sim/power/power_model.cc index 23e978ec0e..38ab08e83d 100644 --- a/src/sim/power/power_model.cc +++ b/src/sim/power/power_model.cc @@ -45,9 +45,9 @@ PowerModelState::PowerModelState(const Params &p) : SimObject(p), _temp(0), clocked_object(NULL), - ADD_STAT(dynamicPower, Stats::units::Watt::get(), + ADD_STAT(dynamicPower, statistics::units::Watt::get(), "Dynamic power for this object (Watts)"), - ADD_STAT(staticPower, Stats::units::Watt::get(), + ADD_STAT(staticPower, statistics::units::Watt::get(), "Static power for this object (Watts)") { dynamicPower @@ -59,9 +59,9 @@ PowerModelState::PowerModelState(const Params &p) PowerModel::PowerModel(const Params &p) : SimObject(p), states_pm(p.pm), subsystem(p.subsystem), clocked_object(NULL), power_model_type(p.pm_type), - ADD_STAT(dynamicPower, Stats::units::Watt::get(), + ADD_STAT(dynamicPower, statistics::units::Watt::get(), "Dynamic power for this power state"), - ADD_STAT(staticPower, Stats::units::Watt::get(), + ADD_STAT(staticPower, statistics::units::Watt::get(), "Static power for this power state") { panic_if(subsystem == NULL, diff --git a/src/sim/power/power_model.hh b/src/sim/power/power_model.hh index 5ee894d124..21bc968bbb 100644 --- a/src/sim/power/power_model.hh +++ b/src/sim/power/power_model.hh @@ -92,7 +92,7 @@ class PowerModelState : public SimObject /** The clocked object we belong to */ ClockedObject * clocked_object; - Stats::Value dynamicPower, staticPower; + statistics::Value dynamicPower, staticPower; }; /** @@ -161,7 +161,7 @@ class PowerModel : public SimObject /** The type of power model - collects all power, static or dynamic only */ enums::PMType power_model_type; - Stats::Value dynamicPower, staticPower; + statistics::Value dynamicPower, staticPower; }; #endif diff --git a/src/sim/power/thermal_domain.cc b/src/sim/power/thermal_domain.cc index 056abf532f..70721c97e3 100644 --- a/src/sim/power/thermal_domain.cc +++ b/src/sim/power/thermal_domain.cc @@ -51,7 +51,7 @@ ThermalDomain::ThermalDomain(const Params &p) : SimObject(p), _initTemperature(p.initial_temperature), node(NULL), subsystem(NULL), - ADD_STAT(currentTemp, Stats::units::DegreeCelsius::get(), "Temperature") + ADD_STAT(currentTemp, statistics::units::DegreeCelsius::get(), "Temperature") { currentTemp .functor([this]() { return currentTemperature().toCelsius(); }); diff --git a/src/sim/power/thermal_domain.hh b/src/sim/power/thermal_domain.hh index dcec15f4d0..1c58cb336d 100644 --- a/src/sim/power/thermal_domain.hh +++ b/src/sim/power/thermal_domain.hh @@ -100,7 +100,7 @@ class ThermalDomain : public SimObject, public ThermalEntity SubSystem * subsystem; /** Stat for reporting voltage of the domain */ - Stats::Value currentTemp; + statistics::Value currentTemp; /** Probe to signal for temperature changes in this domain */ ProbePointArg *ppThermalUpdate; diff --git a/src/sim/power_domain.cc b/src/sim/power_domain.cc index f9d234164a..9e48ba9e48 100644 --- a/src/sim/power_domain.cc +++ b/src/sim/power_domain.cc @@ -242,10 +242,10 @@ PowerDomain::pwrStateChangeCallback(enums::PwrState new_pwr_state, } PowerDomain::PowerDomainStats::PowerDomainStats(PowerDomain &pd) - : Stats::Group(&pd), - ADD_STAT(numLeaderCalls, Stats::units::Count::get(), + : statistics::Group(&pd), + ADD_STAT(numLeaderCalls, statistics::units::Count::get(), "Number of calls by leaders to change power domain state"), - ADD_STAT(numLeaderCallsChangingState, Stats::units::Count::get(), + ADD_STAT(numLeaderCallsChangingState, statistics::units::Count::get(), "Number of calls by leader to change power domain state actually " "resulting in a power state change") { @@ -254,12 +254,12 @@ PowerDomain::PowerDomainStats::PowerDomainStats(PowerDomain &pd) void PowerDomain::PowerDomainStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); numLeaderCalls - .flags(Stats::nozero) + .flags(statistics::nozero) ; numLeaderCallsChangingState - .flags(Stats::nozero) + .flags(statistics::nozero) ; } diff --git a/src/sim/power_domain.hh b/src/sim/power_domain.hh index a7d12d7293..7a68e81658 100644 --- a/src/sim/power_domain.hh +++ b/src/sim/power_domain.hh @@ -152,14 +152,14 @@ class PowerDomain : public PowerState pwrStateUpdateEvent; protected: - struct PowerDomainStats : public Stats::Group + struct PowerDomainStats : public statistics::Group { PowerDomainStats(PowerDomain &pd); void regStats() override; - Stats::Scalar numLeaderCalls; - Stats::Scalar numLeaderCallsChangingState; + statistics::Scalar numLeaderCalls; + statistics::Scalar numLeaderCallsChangingState; } stats; }; diff --git a/src/sim/power_state.cc b/src/sim/power_state.cc index 3416b50127..8603cc7f2a 100644 --- a/src/sim/power_state.cc +++ b/src/sim/power_state.cc @@ -202,7 +202,7 @@ PowerState::getWeights() const { // Get residency stats std::vector ret; - Stats::VCounter residencies; + statistics::VCounter residencies; stats.pwrStateResidencyTicks.value(residencies); // Account for current state too! @@ -218,15 +218,15 @@ PowerState::getWeights() const } PowerState::PowerStateStats::PowerStateStats(PowerState &co) - : Stats::Group(&co), + : statistics::Group(&co), powerState(co), - ADD_STAT(numTransitions, Stats::units::Count::get(), + ADD_STAT(numTransitions, statistics::units::Count::get(), "Number of power state transitions"), - ADD_STAT(numPwrMatchStateTransitions, Stats::units::Count::get(), + ADD_STAT(numPwrMatchStateTransitions, statistics::units::Count::get(), "Number of power state transitions due match request"), - ADD_STAT(ticksClkGated, Stats::units::Tick::get(), + ADD_STAT(ticksClkGated, statistics::units::Tick::get(), "Distribution of time spent in the clock gated state"), - ADD_STAT(pwrStateResidencyTicks, Stats::units::Tick::get(), + ADD_STAT(pwrStateResidencyTicks, statistics::units::Tick::get(), "Cumulative time (in ticks) in various power states") { } @@ -234,9 +234,9 @@ PowerState::PowerStateStats::PowerStateStats(PowerState &co) void PowerState::PowerStateStats::regStats() { - Stats::Group::regStats(); + statistics::Group::regStats(); - using namespace Stats; + using namespace statistics; const PowerStateParams &p = powerState.params(); @@ -265,7 +265,7 @@ PowerState::PowerStateStats::regStats() void PowerState::PowerStateStats::preDumpStats() { - Stats::Group::preDumpStats(); + statistics::Group::preDumpStats(); /** * For every stats dump, the power state residency and other distribution diff --git a/src/sim/power_state.hh b/src/sim/power_state.hh index 410405722b..40b2724a16 100644 --- a/src/sim/power_state.hh +++ b/src/sim/power_state.hh @@ -131,7 +131,7 @@ class PowerState : public SimObject */ PowerDomain* controlledDomain = nullptr; - struct PowerStateStats : public Stats::Group + struct PowerStateStats : public statistics::Group { PowerStateStats(PowerState &ps); @@ -140,11 +140,11 @@ class PowerState : public SimObject PowerState &powerState; - Stats::Scalar numTransitions; - Stats::Scalar numPwrMatchStateTransitions; - Stats::Distribution ticksClkGated; + statistics::Scalar numTransitions; + statistics::Scalar numPwrMatchStateTransitions; + statistics::Distribution ticksClkGated; /** Tracks the time spent in each of the power states */ - Stats::Vector pwrStateResidencyTicks; + statistics::Vector pwrStateResidencyTicks; } stats; }; diff --git a/src/sim/process.cc b/src/sim/process.cc index 86f84ebc97..4902a13634 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -126,7 +126,7 @@ Process::Process(const ProcessParams ¶ms, EmulationPageTable *pTable, fds(std::make_shared( params.input, params.output, params.errout)), childClearTID(0), - ADD_STAT(numSyscalls, Stats::units::Count::get(), + ADD_STAT(numSyscalls, statistics::units::Count::get(), "Number of system calls") { if (_pid >= System::maxPID) diff --git a/src/sim/process.hh b/src/sim/process.hh index 44b0bff676..9686b3f4c9 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -281,7 +281,8 @@ class Process : public SimObject // Process was forked with SIGCHLD set. bool *sigchld; - Stats::Scalar numSyscalls; // track how many system calls are executed + // Track how many system calls are executed + statistics::Scalar numSyscalls; }; #endif // __PROCESS_HH__ diff --git a/src/sim/pseudo_inst.cc b/src/sim/pseudo_inst.cc index 4b8db3e823..2c7deb7550 100644 --- a/src/sim/pseudo_inst.cc +++ b/src/sim/pseudo_inst.cc @@ -68,7 +68,7 @@ #include "sim/stats.hh" #include "sim/system.hh" -using namespace Stats; +using namespace statistics; GEM5_DEPRECATED_NAMESPACE(PseudoInst, pseudo_inst); namespace pseudo_inst @@ -307,7 +307,7 @@ resetstats(ThreadContext *tc, Tick delay, Tick period) Tick when = curTick() + delay * sim_clock::as_int::ns; Tick repeat = period * sim_clock::as_int::ns; - Stats::schedStatEvent(false, true, when, repeat); + statistics::schedStatEvent(false, true, when, repeat); } void @@ -321,7 +321,7 @@ dumpstats(ThreadContext *tc, Tick delay, Tick period) Tick when = curTick() + delay * sim_clock::as_int::ns; Tick repeat = period * sim_clock::as_int::ns; - Stats::schedStatEvent(true, false, when, repeat); + statistics::schedStatEvent(true, false, when, repeat); } void @@ -336,7 +336,7 @@ dumpresetstats(ThreadContext *tc, Tick delay, Tick period) Tick when = curTick() + delay * sim_clock::as_int::ns; Tick repeat = period * sim_clock::as_int::ns; - Stats::schedStatEvent(true, true, when, repeat); + statistics::schedStatEvent(true, true, when, repeat); } void diff --git a/src/sim/root.cc b/src/sim/root.cc index a22ae4b77c..72c2fba80d 100644 --- a/src/sim/root.cc +++ b/src/sim/root.cc @@ -53,23 +53,23 @@ Root::RootStats Root::RootStats::instance; Root::RootStats &rootStats = Root::RootStats::instance; Root::RootStats::RootStats() - : Stats::Group(nullptr), - ADD_STAT(simSeconds, Stats::units::Second::get(), + : statistics::Group(nullptr), + ADD_STAT(simSeconds, statistics::units::Second::get(), "Number of seconds simulated"), - ADD_STAT(simTicks, Stats::units::Tick::get(), + ADD_STAT(simTicks, statistics::units::Tick::get(), "Number of ticks simulated"), - ADD_STAT(finalTick, Stats::units::Tick::get(), + ADD_STAT(finalTick, statistics::units::Tick::get(), "Number of ticks from beginning of simulation " "(restored from checkpoints and never reset)"), - ADD_STAT(simFreq, Stats::units::Rate< - Stats::units::Tick, Stats::units::Second>::get(), + ADD_STAT(simFreq, statistics::units::Rate< + statistics::units::Tick, statistics::units::Second>::get(), "The number of ticks per simulated second"), - ADD_STAT(hostSeconds, Stats::units::Second::get(), + ADD_STAT(hostSeconds, statistics::units::Second::get(), "Real time elapsed on the host"), - ADD_STAT(hostTickRate, Stats::units::Rate< - Stats::units::Tick, Stats::units::Second>::get(), + ADD_STAT(hostTickRate, statistics::units::Rate< + statistics::units::Tick, statistics::units::Second>::get(), "The number of ticks simulated per host second (ticks/s)"), - ADD_STAT(hostMemory, Stats::units::Byte::get(), + ADD_STAT(hostMemory, statistics::units::Byte::get(), "Number of bytes of host memory used"), statTime(true), @@ -105,7 +105,7 @@ Root::RootStats::resetStats() statTime.setTimer(); startTick = curTick(); - Stats::Group::resetStats(); + statistics::Group::resetStats(); } /* diff --git a/src/sim/root.hh b/src/sim/root.hh index fd3b97d72f..b795746044 100644 --- a/src/sim/root.hh +++ b/src/sim/root.hh @@ -91,18 +91,18 @@ class Root : public SimObject } public: // Global statistics - struct RootStats : public Stats::Group + struct RootStats : public statistics::Group { void resetStats() override; - Stats::Formula simSeconds; - Stats::Value simTicks; - Stats::Value finalTick; - Stats::Value simFreq; - Stats::Value hostSeconds; + statistics::Formula simSeconds; + statistics::Value simTicks; + statistics::Value finalTick; + statistics::Value simFreq; + statistics::Value hostSeconds; - Stats::Formula hostTickRate; - Stats::Value hostMemory; + statistics::Formula hostTickRate; + statistics::Value hostMemory; static RootStats instance; diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc index b6bc532527..13d279d132 100644 --- a/src/sim/sim_object.cc +++ b/src/sim/sim_object.cc @@ -54,7 +54,7 @@ SimObjectResolver *SimObject::_objNameResolver = NULL; // SimObject::SimObject(const Params &p) : EventManager(getEventQueue(p.eventq_index)), - Stats::Group(nullptr), + statistics::Group(nullptr), _params(p) { #ifdef DEBUG diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh index cad68702b0..dad2217835 100644 --- a/src/sim/sim_object.hh +++ b/src/sim/sim_object.hh @@ -140,7 +140,7 @@ class SimObjectResolver; * \endcode */ class SimObject : public EventManager, public Serializable, public Drainable, - public Stats::Group + public statistics::Group { private: typedef std::vector SimObjectList; diff --git a/src/sim/simulate.cc b/src/sim/simulate.cc index c0d1055fe2..be0048bbbd 100644 --- a/src/sim/simulate.cc +++ b/src/sim/simulate.cc @@ -192,7 +192,7 @@ doSimLoop(EventQueue *eventq) // routines want to schedule new events. std::lock_guard lock(*eventq); if (async_statdump || async_statreset) { - Stats::schedStatEvent(async_statdump, async_statreset); + statistics::schedStatEvent(async_statdump, async_statreset); async_statdump = false; async_statreset = false; } diff --git a/src/sim/stat_control.cc b/src/sim/stat_control.cc index a78e69c409..c38bcd3baf 100644 --- a/src/sim/stat_control.cc +++ b/src/sim/stat_control.cc @@ -54,7 +54,9 @@ #include "base/time.hh" #include "sim/global_event.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ GlobalEvent *dumpEvent; @@ -84,13 +86,14 @@ class StatEvent : public GlobalEvent process() { if (dump) - Stats::dump(); + statistics::dump(); if (reset) - Stats::reset(); + statistics::reset(); if (repeat) { - Stats::schedStatEvent(dump, reset, curTick() + repeat, repeat); + statistics::schedStatEvent(dump, reset, curTick() + repeat, + repeat); } } @@ -112,10 +115,10 @@ periodicStatDump(Tick period) { /* * If the period is set to 0, then we do not want to dump periodically, - * thus we deschedule the event. Else, if the period is not 0, but the event - * has already been scheduled, we need to get rid of the old event before we - * create a new one, as the old event will no longer be moved forward in the - * event that we resume from a checkpoint. + * thus we deschedule the event. Else, if the period is not 0, but the + * event has already been scheduled, we need to get rid of the old event + * before we create a new one, as the old event will no longer be moved + * forward in the event that we resume from a checkpoint. */ if (dumpEvent != NULL && (period == 0 || dumpEvent->scheduled())) { // Event should AutoDelete, so we do not need to free it. @@ -153,4 +156,4 @@ updateEvents() } } -} // namespace Stats +} // namespace statistics diff --git a/src/sim/stat_control.hh b/src/sim/stat_control.hh index 55930b4561..71d5614cae 100644 --- a/src/sim/stat_control.hh +++ b/src/sim/stat_control.hh @@ -44,7 +44,9 @@ #include "base/types.hh" #include "sim/core.hh" -namespace Stats { +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics +{ void initSimStats(); @@ -76,6 +78,6 @@ void schedStatEvent(bool dump, bool reset, Tick when = curTick(), * @param period The period at which the dumping should occur. */ void periodicStatDump(Tick period = 0); -} // namespace Stats +} // namespace statistics #endif // __SIM_STAT_CONTROL_HH__ diff --git a/src/sim/stat_register.cc b/src/sim/stat_register.cc index d7242a6357..b31f2c204a 100644 --- a/src/sim/stat_register.cc +++ b/src/sim/stat_register.cc @@ -39,7 +39,8 @@ #include "base/statistics.hh" -namespace Stats +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics { extern void pythonDump(); @@ -50,4 +51,4 @@ void registerPythonStatsHandlers() registerHandlers(pythonReset, pythonDump); } -} // namespace Stats +} // namespace statistics diff --git a/src/sim/stat_register.hh b/src/sim/stat_register.hh index bc77072d14..2ff1411882 100644 --- a/src/sim/stat_register.hh +++ b/src/sim/stat_register.hh @@ -42,12 +42,15 @@ #ifndef __SIM_STAT_REGISTER_H__ #define __SIM_STAT_REGISTER_H__ -namespace Stats +#include "base/compiler.hh" + +GEM5_DEPRECATED_NAMESPACE(Stats, statistics); +namespace statistics { /** Register py_... functions as the statistics handlers */ void registerPythonStatsHandlers(); -} // namespace Stats +} // namespace statistics #endif // __SIM_STAT_REGISTER_H__ diff --git a/src/sim/stats.cc b/src/sim/stats.cc index b5a3ca18e9..ff13e0876d 100644 --- a/src/sim/stats.cc +++ b/src/sim/stats.cc @@ -39,7 +39,7 @@ #include "sim/root.hh" -Stats::Formula &simSeconds = rootStats.simSeconds; -Stats::Value &simTicks = rootStats.simTicks; -Stats::Value &simFreq = rootStats.simFreq; -Stats::Value &hostSeconds = rootStats.hostSeconds; +statistics::Formula &simSeconds = rootStats.simSeconds; +statistics::Value &simTicks = rootStats.simTicks; +statistics::Value &simFreq = rootStats.simFreq; +statistics::Value &hostSeconds = rootStats.hostSeconds; diff --git a/src/sim/stats.hh b/src/sim/stats.hh index a46539e27d..9c1ebeadbd 100644 --- a/src/sim/stats.hh +++ b/src/sim/stats.hh @@ -31,9 +31,9 @@ #include "base/statistics.hh" -extern Stats::Formula &simSeconds; -extern Stats::Value &simTicks; -extern Stats::Value &simFreq; -extern Stats::Value &hostSeconds; +extern statistics::Formula &simSeconds; +extern statistics::Value &simTicks; +extern statistics::Value &simFreq; +extern statistics::Value &hostSeconds; #endif // __SIM_SIM_STATS_HH__ diff --git a/src/sim/system.cc b/src/sim/system.cc index 52b322a9f4..2726663976 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -460,7 +460,7 @@ System::regStats() SimObject::regStats(); for (uint32_t j = 0; j < numWorkIds ; j++) { - workItemStats[j] = new Stats::Histogram(this); + workItemStats[j] = new statistics::Histogram(this); std::stringstream namestr; ccprintf(namestr, "work_item_type%d", j); workItemStats[j]->init(20) @@ -592,7 +592,7 @@ System::_getRequestorId(const SimObject* requestor, // Otherwise objects will have sized their stat buckets and // they will be too small - if (Stats::enabled()) { + if (statistics::enabled()) { fatal("Can't request a requestorId after regStats(). " "You must do so in init().\n"); } diff --git a/src/sim/system.hh b/src/sim/system.hh index 351e67e50c..6beba1f472 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -597,7 +597,7 @@ class System : public SimObject, public PCEventScope public: std::map, Tick> lastWorkItemStarted; - std::map workItemStats; + std::map workItemStats; //////////////////////////////////////////// // diff --git a/src/sim/ticked_object.cc b/src/sim/ticked_object.cc index 79cbd41a90..e6bd1467e5 100644 --- a/src/sim/ticked_object.cc +++ b/src/sim/ticked_object.cc @@ -42,14 +42,14 @@ #include "sim/serialize.hh" Ticked::Ticked(ClockedObject &object_, - Stats::Scalar *imported_num_cycles, + statistics::Scalar *imported_num_cycles, Event::Priority priority) : object(object_), event([this]{ processClockEvent(); }, object_.name(), false, priority), running(false), lastStopped(0), /* Allocate numCycles if an external stat wasn't passed in */ - numCyclesLocal((imported_num_cycles ? NULL : new Stats::Scalar)), + numCyclesLocal((imported_num_cycles ? NULL : new statistics::Scalar)), numCycles((imported_num_cycles ? *imported_num_cycles : *numCyclesLocal)) { } diff --git a/src/sim/ticked_object.hh b/src/sim/ticked_object.hh index abfa801dab..33402ad5d8 100644 --- a/src/sim/ticked_object.hh +++ b/src/sim/ticked_object.hh @@ -75,21 +75,21 @@ class Ticked : public Serializable private: /** Locally allocated stats */ - Stats::Scalar *numCyclesLocal; + statistics::Scalar *numCyclesLocal; protected: /** Total number of cycles either ticked or spend stopped */ - Stats::Scalar &numCycles; + statistics::Scalar &numCycles; /** Number of cycles ticked */ - Stats::Scalar tickCycles; + statistics::Scalar tickCycles; /** Number of cycles stopped */ - Stats::Formula idleCycles; + statistics::Formula idleCycles; public: Ticked(ClockedObject &object_, - Stats::Scalar *imported_num_cycles = NULL, + statistics::Scalar *imported_num_cycles = NULL, Event::Priority priority = Event::CPU_Tick_Pri); virtual ~Ticked() { } diff --git a/src/sim/voltage_domain.cc b/src/sim/voltage_domain.cc index e710704e6b..ce9de476a4 100644 --- a/src/sim/voltage_domain.cc +++ b/src/sim/voltage_domain.cc @@ -138,8 +138,8 @@ VoltageDomain::unserialize(CheckpointIn &cp) } VoltageDomain::VoltageDomainStats::VoltageDomainStats(VoltageDomain &vd) - : Stats::Group(&vd), - ADD_STAT(voltage, Stats::units::Volt::get(), "Voltage in Volts") + : statistics::Group(&vd), + ADD_STAT(voltage, statistics::units::Volt::get(), "Voltage in Volts") { voltage.method(&vd, &VoltageDomain::voltage); } diff --git a/src/sim/voltage_domain.hh b/src/sim/voltage_domain.hh index ebda786b57..7b227fa159 100644 --- a/src/sim/voltage_domain.hh +++ b/src/sim/voltage_domain.hh @@ -138,14 +138,14 @@ class VoltageDomain : public SimObject const Voltages voltageOpPoints; PerfLevel _perfLevel; - struct VoltageDomainStats : public Stats::Group + struct VoltageDomainStats : public statistics::Group { VoltageDomainStats(VoltageDomain &vd); /** * Stat for reporting voltage of the domain */ - Stats::Value voltage; + statistics::Value voltage; } stats; /** diff --git a/src/sim/workload.hh b/src/sim/workload.hh index bec5aaab4b..a30020a5ae 100644 --- a/src/sim/workload.hh +++ b/src/sim/workload.hh @@ -46,23 +46,24 @@ class Workload : public SimObject protected: virtual Addr fixFuncEventAddr(Addr addr) const { return addr; } - struct WorkloadStats : public Stats::Group + struct WorkloadStats : public statistics::Group { - struct InstStats: public Stats::Group + struct InstStats: public statistics::Group { - Stats::Scalar arm; - Stats::Scalar quiesce; + statistics::Scalar arm; + statistics::Scalar quiesce; - InstStats(Stats::Group *parent) : Stats::Group(parent, "inst"), - ADD_STAT(arm, Stats::units::Count::get(), + InstStats(statistics::Group *parent) + : statistics::Group(parent, "inst"), + ADD_STAT(arm, statistics::units::Count::get(), "number of arm instructions executed"), - ADD_STAT(quiesce, Stats::units::Count::get(), + ADD_STAT(quiesce, statistics::units::Count::get(), "number of quiesce instructions executed") {} } instStats; - WorkloadStats(Workload *workload) : Stats::Group(workload), + WorkloadStats(Workload *workload) : statistics::Group(workload), instStats(workload) {} } stats;