#include "mem/ruby/network/Topology.hh"
#include "mem/ruby/system/System.hh"
+uint32_t Network::m_virtual_networks;
+uint32_t Network::m_control_msg_size;
+uint32_t Network::m_data_msg_size;
+
Network::Network(const Params *p)
: SimObject(p)
{
m_data_msg_size = RubySystem::getBlockSizeBytes() + m_control_msg_size;
}
-int
+uint32_t
Network::MessageSizeType_to_int(MessageSizeType size_type)
{
switch(size_type) {
virtual void init();
- int getNumberOfVirtualNetworks() { return m_virtual_networks; }
- int MessageSizeType_to_int(MessageSizeType size_type);
+ static int getNumberOfVirtualNetworks() { return m_virtual_networks; }
+ static uint32_t MessageSizeType_to_int(MessageSizeType size_type);
// returns the queue requested for the given component
virtual MessageBuffer* getToNetQueue(NodeID id, bool ordered,
protected:
const std::string m_name;
int m_nodes;
- int m_virtual_networks;
+ static uint32_t m_virtual_networks;
Topology* m_topology_ptr;
- int m_control_msg_size;
- int m_data_msg_size;
+ static uint32_t m_control_msg_size;
+ static uint32_t m_data_msg_size;
};
inline std::ostream&
{
assert(net_msg_ptr != NULL);
- int size = RubySystem::getNetwork()->
- MessageSizeType_to_int(net_msg_ptr->getMessageSize());
+ int size = Network::MessageSizeType_to_int(net_msg_ptr->getMessageSize());
size *= MESSAGE_SIZE_MULTIPLIER;
// Artificially increase the size of broadcast messages
m_delayedCyclesHistogram.clear();
m_delayedCyclesNonPFHistogram.clear();
- int size = RubySystem::getNetwork()->getNumberOfVirtualNetworks();
+ int size = Network::getNumberOfVirtualNetworks();
m_delayedCyclesVCHistograms.resize(size);
for (int i = 0; i < size; i++) {
m_delayedCyclesVCHistograms[i].clear();
uint64 RubySystem::m_memory_size_bytes;
int RubySystem::m_memory_size_bits;
-Network* RubySystem::m_network_ptr;
-Profiler* RubySystem::m_profiler_ptr;
-MemoryVector* RubySystem::m_mem_vec_ptr;
-
RubySystem::RubySystem(const Params *p)
: ClockedObject(p)
{
m_mem_vec_ptr->resize(m_memory_size_bytes);
}
- //
// Print ruby configuration and stats at exit
- //
- RubyExitCallback* rubyExitCB = new RubyExitCallback(p->stats_filename);
- registerExitCallback(rubyExitCB);
+ registerExitCallback(new RubyExitCallback(p->stats_filename, this));
+
m_warmup_enabled = false;
m_cooldown_enabled = false;
}
RubyExitCallback::process()
{
std::ostream *os = simout.create(stats_filename);
- RubySystem::printStats(*os);
+ ruby_system->printStats(*os);
}
Cycles getTime() const { return curCycle(); }
// Public Methods
- static Network*
+ Network*
getNetwork()
{
assert(m_network_ptr != NULL);
return m_profiler_ptr;
}
- static MemoryVector*
+ MemoryVector*
getMemoryVector()
{
assert(m_mem_vec_ptr != NULL);
return m_mem_vec_ptr;
}
- static void printStats(std::ostream& out);
+ void printStats(std::ostream& out);
void clearStats() const;
uint64 getInstructionCount(int thread) { return 1; }
static int m_block_size_bits;
static uint64 m_memory_size_bytes;
static int m_memory_size_bits;
- static Network* m_network_ptr;
+ Network* m_network_ptr;
MemoryControl *m_memory_controller;
public:
- static Profiler* m_profiler_ptr;
- static MemoryVector* m_mem_vec_ptr;
+ Profiler* m_profiler_ptr;
+ MemoryVector* m_mem_vec_ptr;
std::vector<AbstractController*> m_abs_cntrl_vec;
bool m_warmup_enabled;
bool m_cooldown_enabled;
{
private:
std::string stats_filename;
+ RubySystem *ruby_system;
public:
virtual ~RubyExitCallback() {}
- RubyExitCallback(const std::string& _stats_filename)
+ RubyExitCallback(const std::string& _stats_filename, RubySystem *system)
{
stats_filename = _stats_filename;
+ ruby_system = system;
}
- virtual void process();
+ void process();
};
#endif // __MEM_RUBY_SYSTEM_SYSTEM_HH__