changeset 0cd13910b063 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=0cd13910b063
description:
ruby: profiler: provide the number of vnets through ruby system
The aim is to ultimately do away with the static function
Network::getNumberOfVirtualNetworks().
diffstat:
configs/ruby/Ruby.py | 1 +
src/mem/ruby/profiler/Profiler.cc | 13 +++++--------
src/mem/ruby/profiler/Profiler.hh | 9 +++++----
src/mem/ruby/system/RubySystem.py | 10 ++++++----
4 files changed, 17 insertions(+), 16 deletions(-)
diffs (103 lines):
diff -r 0bffd44521f5 -r 0cd13910b063 configs/ruby/Ruby.py
--- a/configs/ruby/Ruby.py Fri Aug 14 19:28:44 2015 -0500
+++ b/configs/ruby/Ruby.py Fri Aug 14 19:28:44 2015 -0500
@@ -231,6 +231,7 @@
if buildEnv['TARGET_ISA'] == "x86":
cpu_seq.pio_slave_port = piobus.master
+ ruby.number_of_virtual_networks = ruby.network.number_of_virtual_networks
ruby._cpu_ports = cpu_sequencers
ruby.num_of_sequencers = len(cpu_sequencers)
diff -r 0bffd44521f5 -r 0cd13910b063 src/mem/ruby/profiler/Profiler.cc
--- a/src/mem/ruby/profiler/Profiler.cc Fri Aug 14 19:28:44 2015 -0500
+++ b/src/mem/ruby/profiler/Profiler.cc Fri Aug 14 19:28:44 2015 -0500
@@ -61,11 +61,10 @@
using m5::stl_helpers::operator<<;
Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
- : m_ruby_system(rs)
+ : m_ruby_system(rs), m_hot_lines(p->hot_lines),
+ m_all_instructions(p->all_instructions),
+ m_num_vnets(p->number_of_virtual_networks)
{
- m_hot_lines = p->hot_lines;
- m_all_instructions = p->all_instructions;
-
m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
m_address_profiler_ptr->setHotLines(m_hot_lines);
m_address_profiler_ptr->setAllInstructions(m_all_instructions);
@@ -98,8 +97,7 @@
.desc("delay histogram for all message")
.flags(Stats::nozero | Stats::pdf | Stats::oneline);
- uint32_t numVNets = Network::getNumberOfVirtualNetworks();
- for (int i = 0; i < numVNets; i++) {
+ for (int i = 0; i < m_num_vnets; i++) {
delayVCHistogram.push_back(new Stats::Histogram());
delayVCHistogram[i]
->init(10)
@@ -251,7 +249,6 @@
m_inst_profiler_ptr->collateStats();
}
- uint32_t numVNets = Network::getNumberOfVirtualNetworks();
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (map<uint32_t, AbstractController*>::iterator it =
m_ruby_system->m_abstract_controls[i].begin();
@@ -260,7 +257,7 @@
AbstractController *ctr = (*it).second;
delayHistogram.add(ctr->getDelayHist());
- for (uint32_t i = 0; i < numVNets; i++) {
+ for (uint32_t i = 0; i < m_num_vnets; i++) {
delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
}
}
diff -r 0bffd44521f5 -r 0cd13910b063 src/mem/ruby/profiler/Profiler.hh
--- a/src/mem/ruby/profiler/Profiler.hh Fri Aug 14 19:28:44 2015 -0500
+++ b/src/mem/ruby/profiler/Profiler.hh Fri Aug 14 19:28:44 2015 -0500
@@ -80,8 +80,8 @@
void addAddressTraceSample(const RubyRequest& msg, NodeID id);
// added by SS
- bool getHotLines() { return m_hot_lines; }
- bool getAllInstructions() { return m_all_instructions; }
+ bool getHotLines() const { return m_hot_lines; }
+ bool getAllInstructions() const { return m_all_instructions; }
private:
// Private copy constructor and assignment operator
@@ -129,8 +129,9 @@
Stats::Scalar m_IncompleteTimes[MachineType_NUM];
//added by SS
- bool m_hot_lines;
- bool m_all_instructions;
+ const bool m_hot_lines;
+ const bool m_all_instructions;
+ const uint32_t m_num_vnets;
};
#endif // __MEM_RUBY_PROFILER_PROFILER_HH__
diff -r 0bffd44521f5 -r 0cd13910b063 src/mem/ruby/system/RubySystem.py
--- a/src/mem/ruby/system/RubySystem.py Fri Aug 14 19:28:44 2015 -0500
+++ b/src/mem/ruby/system/RubySystem.py Fri Aug 14 19:28:44 2015 -0500
@@ -41,11 +41,13 @@
memory_size_bits = Param.UInt32(64,
"number of bits that a memory address requires");
+ phys_mem = Param.SimpleMemory(NULL, "")
+
+ access_backing_store = Param.Bool(False, "Use phys_mem as the functional \
+ store and only use ruby for timing.")
+
# Profiler related configuration variables
hot_lines = Param.Bool(False, "")
all_instructions = Param.Bool(False, "")
num_of_sequencers = Param.Int("")
- phys_mem = Param.SimpleMemory(NULL, "")
-
- access_backing_store = Param.Bool(False, "Use phys_mem as the functional \
- store and only use ruby for timing.")
+ number_of_virtual_networks = Param.Unsigned("")
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev