ruby: get "using namespace" out of headers
In addition to obvious changes, this required a slight change to the slicc grammar to allow types with :: in them. Otherwise slicc barfs on std::string which we need for the headers that slicc generates.
This commit is contained in:
parent
be10204729
commit
f1c3f3044b
|
@ -334,7 +334,7 @@ Check::pickInitiatingNode()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Check::print(ostream& out) const
|
Check::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "["
|
out << "["
|
||||||
<< m_address << ", value: "
|
<< m_address << ", value: "
|
||||||
|
@ -342,7 +342,7 @@ Check::print(ostream& out) const
|
||||||
<< m_status << ", initiating node: "
|
<< m_status << ", initiating node: "
|
||||||
<< m_initiatingNode << ", store_count: "
|
<< m_initiatingNode << ", store_count: "
|
||||||
<< m_store_count
|
<< m_store_count
|
||||||
<< "]" << flush;
|
<< "]" << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#ifndef __CPU_RUBYTEST_CHECK_HH__
|
#ifndef __CPU_RUBYTEST_CHECK_HH__
|
||||||
#define __CPU_RUBYTEST_CHECK_HH__
|
#define __CPU_RUBYTEST_CHECK_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "cpu/rubytest/RubyTester.hh"
|
#include "cpu/rubytest/RubyTester.hh"
|
||||||
#include "mem/protocol/AccessModeType.hh"
|
#include "mem/protocol/AccessModeType.hh"
|
||||||
#include "mem/protocol/TesterStatus.hh"
|
#include "mem/protocol/TesterStatus.hh"
|
||||||
|
@ -53,7 +55,7 @@ class Check
|
||||||
const Address& getAddress() { return m_address; }
|
const Address& getAddress() { return m_address; }
|
||||||
void changeAddress(const Address& address);
|
void changeAddress(const Address& address);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initiatePrefetch();
|
void initiatePrefetch();
|
||||||
|
@ -76,11 +78,11 @@ class Check
|
||||||
RubyTester* m_tester_ptr;
|
RubyTester* m_tester_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const Check& obj)
|
operator<<(std::ostream& out, const Check& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,6 @@ CheckTable::getCheck(const Address& address)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CheckTable::print(ostream& out) const
|
CheckTable::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,9 +183,9 @@ RubyTester::checkForDeadlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RubyTester::print(ostream& out) const
|
RubyTester::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[RubyTester]" << endl;
|
out << "[RubyTester]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
RubyTester *
|
RubyTester *
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
#ifndef __CPU_RUBYTEST_RUBYTESTER_HH__
|
#ifndef __CPU_RUBYTEST_RUBYTESTER_HH__
|
||||||
#define __CPU_RUBYTEST_RUBYTESTER_HH__
|
#define __CPU_RUBYTEST_RUBYTESTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "cpu/rubytest/CheckTable.hh"
|
#include "cpu/rubytest/CheckTable.hh"
|
||||||
#include "mem/mem_object.hh"
|
#include "mem/mem_object.hh"
|
||||||
#include "mem/packet.hh"
|
#include "mem/packet.hh"
|
||||||
|
@ -91,11 +94,11 @@ class RubyTester : public MemObject
|
||||||
|
|
||||||
void incrementCheckCompletions() { m_checks_completed++; }
|
void incrementCheckCompletions() { m_checks_completed++; }
|
||||||
|
|
||||||
void printStats(ostream& out) const {}
|
void printStats(std::ostream& out) const {}
|
||||||
void clearStats() {}
|
void clearStats() {}
|
||||||
void printConfig(ostream& out) const {}
|
void printConfig(std::ostream& out) const {}
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class CheckStartEvent : public Event
|
class CheckStartEvent : public Event
|
||||||
|
@ -133,11 +136,11 @@ class RubyTester : public MemObject
|
||||||
int m_wakeup_frequency;
|
int m_wakeup_frequency;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const RubyTester& obj)
|
operator<<(std::ostream& out, const RubyTester& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#ifndef VECTOR_H
|
#ifndef VECTOR_H
|
||||||
#define VECTOR_H
|
#define VECTOR_H
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -184,7 +185,7 @@ template <class TYPE>
|
||||||
inline
|
inline
|
||||||
void Vector<TYPE>::sortVector()
|
void Vector<TYPE>::sortVector()
|
||||||
{
|
{
|
||||||
sort(&m_vec[0], &m_vec[m_size]);
|
std::sort(&m_vec[0], &m_vec[m_size]);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class TYPE>
|
template <class TYPE>
|
||||||
|
|
|
@ -166,7 +166,7 @@ machine(L2Cache, "MESI Directory L2 Cache CMP")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
||||||
return CoherenceRequestType_to_string(type);
|
return CoherenceRequestType_to_string(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ machine(L2Cache, "MESI Directory L2 Cache CMP")
|
||||||
return State:NP;
|
return State:NP;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getStateStr(Address addr) {
|
std::string getStateStr(Address addr) {
|
||||||
return L2Cache_State_to_string(getState(addr));
|
return L2Cache_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
||||||
return CoherenceRequestType_to_string(type);
|
return CoherenceRequestType_to_string(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
|
||||||
return State:NP;
|
return State:NP;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getStateStr(Address addr) {
|
std::string getStateStr(Address addr) {
|
||||||
return L2Cache_State_to_string(getState(addr));
|
return L2Cache_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -457,11 +457,11 @@ machine(L2Cache, "Token protocol")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string getStateStr(Address addr) {
|
std::string getStateStr(Address addr) {
|
||||||
return L2Cache_State_to_string(getState(addr));
|
return L2Cache_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
||||||
return CoherenceRequestType_to_string(type);
|
return CoherenceRequestType_to_string(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ machine(L2Cache, "Token protocol")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string getStateStr(Address addr) {
|
std::string getStateStr(Address addr) {
|
||||||
return L2Cache_State_to_string(getState(addr));
|
return L2Cache_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ machine(L1Cache, "MSI Directory L1 Cache CMP") {
|
||||||
return State:NP;
|
return State:NP;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getStateStr(Address addr) {
|
std::string getStateStr(Address addr) {
|
||||||
return L1Cache_State_to_string(getState(addr));
|
return L1Cache_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
|
||||||
return CoherenceRequestType_to_string(type);
|
return CoherenceRequestType_to_string(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ machine(L2Cache, "MOSI Directory L2 Cache CMP") {
|
||||||
return State:L2_NP;
|
return State:L2_NP;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getStateStr(Address addr) {
|
std::string getStateStr(Address addr) {
|
||||||
return L2Cache_State_to_string(getState(addr));
|
return L2Cache_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,11 +100,11 @@ machine(Directory, "MOSI Directory Optimized") {
|
||||||
return State:NP;
|
return State:NP;
|
||||||
}
|
}
|
||||||
|
|
||||||
string getDirStateStr(Address addr) {
|
std::string getDirStateStr(Address addr) {
|
||||||
return Directory_State_to_string(getState(addr));
|
return Directory_State_to_string(getState(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
string getRequestTypeStr(CoherenceRequestType type) {
|
std::string getRequestTypeStr(CoherenceRequestType type) {
|
||||||
return CoherenceRequestType_to_string(type);
|
return CoherenceRequestType_to_string(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@ structure(RequestMsg, desc="...", interface="NetworkMessage") {
|
||||||
DataBlock DataBlk, desc="Data for the cache line (if PUTX)";
|
DataBlock DataBlk, desc="Data for the cache line (if PUTX)";
|
||||||
int NumPendingExtAcks, desc="Number of acks to wait for"; // Needed for forwarded responses only
|
int NumPendingExtAcks, desc="Number of acks to wait for"; // Needed for forwarded responses only
|
||||||
MessageSizeType MessageSize, desc="size category of the message";
|
MessageSizeType MessageSize, desc="size category of the message";
|
||||||
string L1CacheStateStr, desc="describes L1 cache block state";
|
std::string L1CacheStateStr, desc="describes L1 cache block state";
|
||||||
string L2CacheStateStr, desc="describes L2 cache block state";
|
std::string L2CacheStateStr, desc="describes L2 cache block state";
|
||||||
PrefetchBit Prefetch, desc="Is this a prefetch request";
|
PrefetchBit Prefetch, desc="Is this a prefetch request";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
// defines
|
// defines
|
||||||
external_type(int, primitive="yes", default="0");
|
external_type(int, primitive="yes", default="0");
|
||||||
external_type(bool, primitive="yes", default="false");
|
external_type(bool, primitive="yes", default="false");
|
||||||
external_type(string, primitive="yes");
|
external_type(std::string, primitive="yes");
|
||||||
external_type(uint64, primitive="yes");
|
external_type(uint64, primitive="yes");
|
||||||
external_type(Time, primitive="yes", default="0");
|
external_type(Time, primitive="yes", default="0");
|
||||||
external_type(Address);
|
external_type(Address);
|
||||||
|
|
|
@ -41,7 +41,8 @@ void profile_L1Cache_miss(CacheMsg msg, NodeID l1cacheID);
|
||||||
|
|
||||||
// used by CMP protocols
|
// used by CMP protocols
|
||||||
void profile_L2Cache_miss(GenericRequestType requestType, AccessModeType type, int msgSize, PrefetchBit pfBit, NodeID l2cacheID);
|
void profile_L2Cache_miss(GenericRequestType requestType, AccessModeType type, int msgSize, PrefetchBit pfBit, NodeID l2cacheID);
|
||||||
void profile_request(string L1CacheStateStr, string L2CacheStateStr, string directoryStateStr, string requestTypeStr);
|
void profile_request(std::string L1CacheStateStr, std::string L2CacheStateStr,
|
||||||
|
std::string directoryStateStr, std::string requestTypeStr);
|
||||||
void profileMessageReordering(bool wasReordered);
|
void profileMessageReordering(bool wasReordered);
|
||||||
void profileMessageReorderingByNetwork(int vnet, bool wasReordered);
|
void profileMessageReorderingByNetwork(int vnet, bool wasReordered);
|
||||||
void profile_token_retry(Address addr, AccessType type, int count);
|
void profile_token_retry(Address addr, AccessType type, int count);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
// Miscallaneous Functions
|
// Miscallaneous Functions
|
||||||
|
|
||||||
void error(string msg);
|
void error(std::string msg);
|
||||||
void assert(bool condition);
|
void assert(bool condition);
|
||||||
int random(int number);
|
int random(int number);
|
||||||
Time get_time();
|
Time get_time();
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include "mem/ruby/buffers/MessageBuffer.hh"
|
#include "mem/ruby/buffers/MessageBuffer.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
MessageBuffer::MessageBuffer(const string &name)
|
MessageBuffer::MessageBuffer(const string &name)
|
||||||
{
|
{
|
||||||
m_msg_counter = 0;
|
m_msg_counter = 0;
|
||||||
|
|
|
@ -29,23 +29,23 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
|
|
||||||
void
|
void
|
||||||
Address::output(ostream& out) const
|
Address::output(std::ostream& out) const
|
||||||
{
|
{
|
||||||
// Note: this outputs addresses in the form "ffff", not "0xffff".
|
// Note: this outputs addresses in the form "ffff", not "0xffff".
|
||||||
// This code should always be able to write out addresses in a
|
// This code should always be able to write out addresses in a
|
||||||
// format that can be read in by the below input() method. Please
|
// format that can be read in by the below input() method. Please
|
||||||
// don't change this without talking to Milo first.
|
// don't change this without talking to Milo first.
|
||||||
out << hex << m_address << dec;
|
out << std::hex << m_address << std::dec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Address::input(istream& in)
|
Address::input(std::istream& in)
|
||||||
{
|
{
|
||||||
// Note: this only works with addresses in the form "ffff", not
|
// Note: this only works with addresses in the form "ffff", not
|
||||||
// "0xffff". This code should always be able to read in addresses
|
// "0xffff". This code should always be able to read in addresses
|
||||||
// written out by the above output() method. Please don't change
|
// written out by the above output() method. Please don't change
|
||||||
// this without talking to Milo first.
|
// this without talking to Milo first.
|
||||||
in >> hex >> m_address >> dec;
|
in >> std::hex >> m_address >> std::dec;
|
||||||
}
|
}
|
||||||
|
|
||||||
Address::Address(const Address& obj)
|
Address::Address(const Address& obj)
|
||||||
|
|
|
@ -98,9 +98,9 @@ class Address
|
||||||
|
|
||||||
Index memoryModuleIndex() const;
|
Index memoryModuleIndex() const;
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
void output(ostream& out) const;
|
void output(std::ostream& out) const;
|
||||||
void input(istream& in);
|
void input(std::istream& in);
|
||||||
|
|
||||||
void
|
void
|
||||||
setOffset(int offset)
|
setOffset(int offset)
|
||||||
|
@ -128,11 +128,11 @@ operator<(const Address& obj1, const Address& obj2)
|
||||||
return obj1.getAddress() < obj2.getAddress();
|
return obj1.getAddress() < obj2.getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const Address& obj)
|
operator<<(std::ostream& out, const Address& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ ADDRESS_WIDTH MEMORY_SIZE_BITS PAGE_SIZE_BITS DATA_BLOCK_BITS
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
Address::print(ostream& out) const
|
Address::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
using namespace std;
|
using namespace std;
|
||||||
out << "[" << hex << "0x" << m_address << "," << " line 0x"
|
out << "[" << hex << "0x" << m_address << "," << " line 0x"
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#ifndef __MEM_RUBY_COMMON_DRIVER_HH__
|
#ifndef __MEM_RUBY_COMMON_DRIVER_HH__
|
||||||
#define __MEM_RUBY_COMMON_DRIVER_HH__
|
#define __MEM_RUBY_COMMON_DRIVER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -51,10 +53,10 @@ class Driver
|
||||||
int conflict_thread) const;
|
int conflict_thread) const;
|
||||||
virtual void printDebug(); //called by Sequencer
|
virtual void printDebug(); //called by Sequencer
|
||||||
|
|
||||||
virtual void printStats(ostream& out) const = 0;
|
virtual void printStats(std::ostream& out) const = 0;
|
||||||
virtual void clearStats() = 0;
|
virtual void clearStats() = 0;
|
||||||
|
|
||||||
virtual void printConfig(ostream& out) const = 0;
|
virtual void printConfig(std::ostream& out) const = 0;
|
||||||
|
|
||||||
virtual integer_t readPhysicalMemory(int procID, physical_address_t addr,
|
virtual integer_t readPhysicalMemory(int procID, physical_address_t addr,
|
||||||
int len);
|
int len);
|
||||||
|
|
|
@ -260,7 +260,7 @@ NetDest::setSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetDest::print(ostream& out) const
|
NetDest::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[NetDest (" << m_bits.size() << ") ";
|
out << "[NetDest (" << m_bits.size() << ") ";
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,14 @@
|
||||||
#ifndef __MEM_RUBY_COMMON_NETDEST_HH__
|
#ifndef __MEM_RUBY_COMMON_NETDEST_HH__
|
||||||
#define __MEM_RUBY_COMMON_NETDEST_HH__
|
#define __MEM_RUBY_COMMON_NETDEST_HH__
|
||||||
|
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
#include "mem/ruby/system/NodeID.hh"
|
|
||||||
#include "mem/ruby/system/MachineID.hh"
|
|
||||||
#include "mem/ruby/common/Set.hh"
|
|
||||||
#include "mem/protocol/MachineType.hh"
|
#include "mem/protocol/MachineType.hh"
|
||||||
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
#include "mem/ruby/common/Set.hh"
|
||||||
|
#include "mem/ruby/system/MachineID.hh"
|
||||||
|
#include "mem/ruby/system/NodeID.hh"
|
||||||
|
|
||||||
class NetDest
|
class NetDest
|
||||||
{
|
{
|
||||||
|
@ -98,7 +100,7 @@ class NetDest
|
||||||
// get element for a index
|
// get element for a index
|
||||||
NodeID elementAt(MachineID index);
|
NodeID elementAt(MachineID index);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// returns a value >= MachineType_base_level("this machine")
|
// returns a value >= MachineType_base_level("this machine")
|
||||||
|
@ -120,11 +122,11 @@ class NetDest
|
||||||
Vector <Set> m_bits; // a Vector of bit vectors - i.e. Sets
|
Vector <Set> m_bits; // a Vector of bit vectors - i.e. Sets
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const NetDest& obj)
|
operator<<(std::ostream& out, const NetDest& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -557,7 +557,7 @@ Set& Set::operator=(const Set& obj) {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set::print(ostream& out) const
|
void Set::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
if(m_p_nArray==NULL) {
|
if(m_p_nArray==NULL) {
|
||||||
out << "[Set {Empty}]";
|
out << "[Set {Empty}]";
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
#ifndef SET_H
|
#ifndef SET_H
|
||||||
#define SET_H
|
#define SET_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
|
@ -164,7 +166,7 @@ public:
|
||||||
void setBroadcast() { broadcast(); } // Deprecated
|
void setBroadcast() { broadcast(); } // Deprecated
|
||||||
bool presentInSet(NodeID element) const { return isElement(element); } // Deprecated
|
bool presentInSet(NodeID element) const { return isElement(element); } // Deprecated
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
private:
|
private:
|
||||||
// Private Methods
|
// Private Methods
|
||||||
|
|
||||||
|
@ -185,16 +187,16 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Output operator declaration
|
// Output operator declaration
|
||||||
ostream& operator<<(ostream& out, const Set& obj);
|
std::ostream& operator<<(std::ostream& out, const Set& obj);
|
||||||
|
|
||||||
// ******************* Definitions *******************
|
// ******************* Definitions *******************
|
||||||
|
|
||||||
// Output operator definition
|
// Output operator definition
|
||||||
extern inline
|
extern inline
|
||||||
ostream& operator<<(ostream& out, const Set& obj)
|
std::ostream& operator<<(std::ostream& out, const Set& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ SubBlock::internalMergeTo(DataBlock& data) const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SubBlock::print(ostream& out) const
|
SubBlock::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[" << m_address << ", " << getSize() << ", " << m_data << "]";
|
out << "[" << m_address << ", " << getSize() << ", " << m_data << "]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#ifndef __MEM_RUBY_COMMON_SUBBLOCK_HH__
|
#ifndef __MEM_RUBY_COMMON_SUBBLOCK_HH__
|
||||||
#define __MEM_RUBY_COMMON_SUBBLOCK_HH__
|
#define __MEM_RUBY_COMMON_SUBBLOCK_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/DataBlock.hh"
|
#include "mem/ruby/common/DataBlock.hh"
|
||||||
|
@ -58,7 +60,7 @@ class SubBlock
|
||||||
void mergeTo(DataBlock& data) const { internalMergeTo(data); }
|
void mergeTo(DataBlock& data) const { internalMergeTo(data); }
|
||||||
void mergeFrom(const DataBlock& data) { internalMergeFrom(data); }
|
void mergeFrom(const DataBlock& data) { internalMergeFrom(data); }
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void internalMergeTo(DataBlock& data) const;
|
void internalMergeTo(DataBlock& data) const;
|
||||||
|
@ -69,11 +71,11 @@ class SubBlock
|
||||||
Vector<uint8_t> m_data;
|
Vector<uint8_t> m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const SubBlock& obj)
|
operator<<(std::ostream& out, const SubBlock& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ RubyEventQueue::scheduleEventAbsolute(Consumer* consumer, Time timeAbs)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RubyEventQueue::print(ostream& out) const
|
RubyEventQueue::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[Event Queue:]";
|
out << "[Event Queue:]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_ABSTRACTBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
|
||||||
|
@ -47,7 +49,7 @@ class AbstractBloomFilter
|
||||||
virtual int getCount(const Address& addr) = 0;
|
virtual int getCount(const Address& addr) = 0;
|
||||||
virtual int getTotalCount() = 0;
|
virtual int getTotalCount() = 0;
|
||||||
|
|
||||||
virtual void print(ostream& out) const = 0;
|
virtual void print(std::ostream& out) const = 0;
|
||||||
|
|
||||||
virtual int getIndex(const Address& addr) = 0;
|
virtual int getIndex(const Address& addr) = 0;
|
||||||
virtual int readBit(const int index) = 0;
|
virtual int readBit(const int index) = 0;
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/BlockBloomFilter.hh"
|
#include "mem/ruby/filters/BlockBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
BlockBloomFilter::BlockBloomFilter(string str)
|
BlockBloomFilter::BlockBloomFilter(string str)
|
||||||
{
|
{
|
||||||
string tail(str);
|
string tail(str);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_BLOCKBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
class BlockBloomFilter : public AbstractBloomFilter
|
class BlockBloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlockBloomFilter(string config);
|
BlockBloomFilter(std::string config);
|
||||||
~BlockBloomFilter();
|
~BlockBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -54,7 +57,7 @@ class BlockBloomFilter : public AbstractBloomFilter
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
void writeBit(const int index, const int value);
|
void writeBit(const int index, const int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int get_index(const Address& addr);
|
int get_index(const Address& addr);
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/BulkBloomFilter.hh"
|
#include "mem/ruby/filters/BulkBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
BulkBloomFilter::BulkBloomFilter(string str)
|
BulkBloomFilter::BulkBloomFilter(string str)
|
||||||
{
|
{
|
||||||
string tail(str);
|
string tail(str);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_BULKBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
class BulkBloomFilter : public AbstractBloomFilter
|
class BulkBloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BulkBloomFilter(string config);
|
BulkBloomFilter(std::string config);
|
||||||
~BulkBloomFilter();
|
~BulkBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -54,7 +57,7 @@ class BulkBloomFilter : public AbstractBloomFilter
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
void writeBit(const int index, const int value);
|
void writeBit(const int index, const int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int get_index(const Address& addr);
|
int get_index(const Address& addr);
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
|
#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
|
||||||
#include "mem/ruby/filters/NonCountingBloomFilter.hh"
|
#include "mem/ruby/filters/NonCountingBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
GenericBloomFilter::GenericBloomFilter(string config)
|
GenericBloomFilter::GenericBloomFilter(string config)
|
||||||
{
|
{
|
||||||
string tail(config);
|
string tail(config);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_GENERICBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_GENERICBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_GENERICBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_GENERICBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/AbstractBloomFilter.hh"
|
#include "mem/ruby/filters/AbstractBloomFilter.hh"
|
||||||
|
@ -36,7 +39,7 @@
|
||||||
class GenericBloomFilter
|
class GenericBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GenericBloomFilter(string config);
|
GenericBloomFilter(std::string config);
|
||||||
~GenericBloomFilter();
|
~GenericBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -61,18 +64,22 @@ class GenericBloomFilter
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
void writeBit(const int index, const int value);
|
void writeBit(const int index, const int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
void printConfig(ostream& out) { out << "GenericBloomFilter" << endl; }
|
void
|
||||||
|
printConfig(std::ostream& out)
|
||||||
|
{
|
||||||
|
out << "GenericBloomFilter" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AbstractBloomFilter* m_filter;
|
AbstractBloomFilter* m_filter;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const GenericBloomFilter& obj)
|
operator<<(std::ostream& out, const GenericBloomFilter& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/H3BloomFilter.hh"
|
#include "mem/ruby/filters/H3BloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
static int H3[64][16] = {
|
static int H3[64][16] = {
|
||||||
{ 33268410, 395488709, 311024285, 456111753,
|
{ 33268410, 395488709, 311024285, 456111753,
|
||||||
181495008, 119997521, 220697869, 433891432,
|
181495008, 119997521, 220697869, 433891432,
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_H3BLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -39,7 +42,7 @@
|
||||||
class H3BloomFilter : public AbstractBloomFilter
|
class H3BloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
H3BloomFilter(string config);
|
H3BloomFilter(std::string config);
|
||||||
~H3BloomFilter();
|
~H3BloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -52,7 +55,7 @@ class H3BloomFilter : public AbstractBloomFilter
|
||||||
bool isSet(const Address& addr);
|
bool isSet(const Address& addr);
|
||||||
int getCount(const Address& addr);
|
int getCount(const Address& addr);
|
||||||
int getTotalCount();
|
int getTotalCount();
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
int getIndex(const Address& addr);
|
int getIndex(const Address& addr);
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/LSB_CountingBloomFilter.hh"
|
#include "mem/ruby/filters/LSB_CountingBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
LSB_CountingBloomFilter::LSB_CountingBloomFilter(string str)
|
LSB_CountingBloomFilter::LSB_CountingBloomFilter(string str)
|
||||||
{
|
{
|
||||||
string tail(str);
|
string tail(str);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_LSBCOUNTINGBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_LSBCOUNTINGBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_LSBCOUNTINGBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_LSBCOUNTINGBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
class LSB_CountingBloomFilter : public AbstractBloomFilter
|
class LSB_CountingBloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LSB_CountingBloomFilter(string config);
|
LSB_CountingBloomFilter(std::string config);
|
||||||
~LSB_CountingBloomFilter();
|
~LSB_CountingBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -54,7 +57,7 @@ class LSB_CountingBloomFilter : public AbstractBloomFilter
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
void writeBit(const int index, const int value);
|
void writeBit(const int index, const int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int get_index(const Address& addr);
|
int get_index(const Address& addr);
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/MultiBitSelBloomFilter.hh"
|
#include "mem/ruby/filters/MultiBitSelBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
MultiBitSelBloomFilter::MultiBitSelBloomFilter(string str)
|
MultiBitSelBloomFilter::MultiBitSelBloomFilter(string str)
|
||||||
{
|
{
|
||||||
string tail(str);
|
string tail(str);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_MULTIBITSELBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -39,7 +42,7 @@
|
||||||
class MultiBitSelBloomFilter : public AbstractBloomFilter
|
class MultiBitSelBloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MultiBitSelBloomFilter(string config);
|
MultiBitSelBloomFilter(std::string config);
|
||||||
~MultiBitSelBloomFilter();
|
~MultiBitSelBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -52,7 +55,7 @@ class MultiBitSelBloomFilter : public AbstractBloomFilter
|
||||||
bool isSet(const Address& addr);
|
bool isSet(const Address& addr);
|
||||||
int getCount(const Address& addr);
|
int getCount(const Address& addr);
|
||||||
int getTotalCount();
|
int getTotalCount();
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
int getIndex(const Address& addr);
|
int getIndex(const Address& addr);
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
|
#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
MultiGrainBloomFilter::MultiGrainBloomFilter(string str)
|
MultiGrainBloomFilter::MultiGrainBloomFilter(string str)
|
||||||
{
|
{
|
||||||
string tail(str);
|
string tail(str);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_MULTIGRAINBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
class MultiGrainBloomFilter : public AbstractBloomFilter
|
class MultiGrainBloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MultiGrainBloomFilter(string str);
|
MultiGrainBloomFilter(std::string str);
|
||||||
~MultiGrainBloomFilter();
|
~MultiGrainBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -54,7 +57,7 @@ class MultiGrainBloomFilter : public AbstractBloomFilter
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
void writeBit(const int index, const int value);
|
void writeBit(const int index, const int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int get_block_index(const Address& addr);
|
int get_block_index(const Address& addr);
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/filters/NonCountingBloomFilter.hh"
|
#include "mem/ruby/filters/NonCountingBloomFilter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
NonCountingBloomFilter::NonCountingBloomFilter(string str)
|
NonCountingBloomFilter::NonCountingBloomFilter(string str)
|
||||||
{
|
{
|
||||||
string tail(str);
|
string tail(str);
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef __MEM_RUBY_FILTERS_NONCOUNTINGBLOOMFILTER_HH__
|
#ifndef __MEM_RUBY_FILTERS_NONCOUNTINGBLOOMFILTER_HH__
|
||||||
#define __MEM_RUBY_FILTERS_NONCOUNTINGBLOOMFILTER_HH__
|
#define __MEM_RUBY_FILTERS_NONCOUNTINGBLOOMFILTER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/gems_common/Map.hh"
|
#include "mem/gems_common/Map.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
class NonCountingBloomFilter : public AbstractBloomFilter
|
class NonCountingBloomFilter : public AbstractBloomFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NonCountingBloomFilter(string config);
|
NonCountingBloomFilter(std::string config);
|
||||||
~NonCountingBloomFilter();
|
~NonCountingBloomFilter();
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -55,7 +58,7 @@ class NonCountingBloomFilter : public AbstractBloomFilter
|
||||||
int readBit(const int index);
|
int readBit(const int index);
|
||||||
void writeBit(const int index, const int value);
|
void writeBit(const int index, const int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
int
|
int
|
||||||
operator[](const int index) const
|
operator[](const int index) const
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#include "mem/ruby/system/RubyPort.hh"
|
#include "mem/ruby/system/RubyPort.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
string
|
string
|
||||||
RubyRequestType_to_string(const RubyRequestType& obj)
|
RubyRequestType_to_string(const RubyRequestType& obj)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +66,7 @@ RubyRequestType_to_string(const RubyRequestType& obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
RubyRequestType
|
RubyRequestType
|
||||||
string_to_RubyRequestType(std::string str)
|
string_to_RubyRequestType(string str)
|
||||||
{
|
{
|
||||||
if (str == "IFETCH")
|
if (str == "IFETCH")
|
||||||
return RubyRequestType_IFETCH;
|
return RubyRequestType_IFETCH;
|
||||||
|
@ -94,7 +96,7 @@ operator<<(ostream& out, const RubyRequestType& obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
ostream&
|
ostream&
|
||||||
operator<<(std::ostream& out, const RubyRequest& obj)
|
operator<<(ostream& out, const RubyRequest& obj)
|
||||||
{
|
{
|
||||||
out << hex << "0x" << obj.paddr << " data: 0x" << flush;
|
out << hex << "0x" << obj.paddr << " data: 0x" << flush;
|
||||||
for (int i = 0; i < obj.len; i++) {
|
for (int i = 0; i < obj.len; i++) {
|
||||||
|
@ -147,8 +149,8 @@ libruby_init(const char* cfg_filename)
|
||||||
assert(tokens.size() >= 2);
|
assert(tokens.size() >= 2);
|
||||||
vector<string> argv;
|
vector<string> argv;
|
||||||
for (size_t i=2; i<tokens.size(); i++) {
|
for (size_t i=2; i<tokens.size(); i++) {
|
||||||
std::replace(tokens[i].begin(), tokens[i].end(), '%', ' ');
|
replace(tokens[i].begin(), tokens[i].end(), '%', ' ');
|
||||||
std::replace(tokens[i].begin(), tokens[i].end(), '#', '\n');
|
replace(tokens[i].begin(), tokens[i].end(), '#', '\n');
|
||||||
argv.push_back(tokens[i]);
|
argv.push_back(tokens[i]);
|
||||||
}
|
}
|
||||||
sys_conf->push_back(RubyObjConf(tokens[0], tokens[1], argv));
|
sys_conf->push_back(RubyObjConf(tokens[0], tokens[1], argv));
|
||||||
|
@ -224,13 +226,13 @@ libruby_last_error()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
libruby_print_config(std::ostream & out)
|
libruby_print_config(ostream & out)
|
||||||
{
|
{
|
||||||
RubySystem::printConfig(out);
|
RubySystem::printConfig(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
libruby_print_stats(std::ostream & out)
|
libruby_print_stats(ostream & out)
|
||||||
{
|
{
|
||||||
RubySystem::printStats(out);
|
RubySystem::printStats(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
#ifndef __MEM_RUBY_NETWORK_NETWORK_HH__
|
#ifndef __MEM_RUBY_NETWORK_NETWORK_HH__
|
||||||
#define __MEM_RUBY_NETWORK_NETWORK_HH__
|
#define __MEM_RUBY_NETWORK_NETWORK_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/protocol/MessageSizeType.hh"
|
#include "mem/protocol/MessageSizeType.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/ruby/system/NodeID.hh"
|
#include "mem/ruby/system/NodeID.hh"
|
||||||
|
@ -88,10 +91,10 @@ class Network : public SimObject
|
||||||
|
|
||||||
virtual void reset() = 0;
|
virtual void reset() = 0;
|
||||||
|
|
||||||
virtual void printStats(ostream& out) const = 0;
|
virtual void printStats(std::ostream& out) const = 0;
|
||||||
virtual void clearStats() = 0;
|
virtual void clearStats() = 0;
|
||||||
virtual void printConfig(ostream& out) const = 0;
|
virtual void printConfig(std::ostream& out) const = 0;
|
||||||
virtual void print(ostream& out) const = 0;
|
virtual void print(std::ostream& out) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Private copy constructor and assignment operator
|
// Private copy constructor and assignment operator
|
||||||
|
@ -99,7 +102,7 @@ class Network : public SimObject
|
||||||
Network& operator=(const Network& obj);
|
Network& operator=(const Network& obj);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const string m_name;
|
const std::string m_name;
|
||||||
int m_nodes;
|
int m_nodes;
|
||||||
int m_virtual_networks;
|
int m_virtual_networks;
|
||||||
int m_buffer_size;
|
int m_buffer_size;
|
||||||
|
@ -111,11 +114,11 @@ class Network : public SimObject
|
||||||
int m_data_msg_size;
|
int m_data_msg_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const Network& obj)
|
operator<<(std::ostream& out, const Network& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,6 @@
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/ruby/system/NodeID.hh"
|
#include "mem/ruby/system/NodeID.hh"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace __gnu_cxx;
|
|
||||||
|
|
||||||
enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
|
enum flit_type {HEAD_, BODY_, TAIL_, HEAD_TAIL_, NUM_FLIT_TYPE_};
|
||||||
enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
|
enum VC_state_type {IDLE_, VC_AB_, ACTIVE_, NUM_VC_STATE_TYPE_};
|
||||||
enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
|
enum flit_stage {I_, VA_, SA_, ST_, LT_, NUM_FLIT_STAGE_};
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/CreditLink_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/CreditLink_d.hh"
|
||||||
#include "mem/ruby/common/NetDest.hh"
|
#include "mem/ruby/common/NetDest.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
GarnetNetwork_d::GarnetNetwork_d(const Params *p)
|
GarnetNetwork_d::GarnetNetwork_d(const Params *p)
|
||||||
: BaseGarnetNetwork(p)
|
: BaseGarnetNetwork(p)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef GARNETNETWORK_D_H
|
#ifndef GARNETNETWORK_D_H
|
||||||
#define GARNETNETWORK_D_H
|
#define GARNETNETWORK_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
|
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
|
||||||
|
@ -61,9 +63,9 @@ public:
|
||||||
MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
|
MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
|
||||||
|
|
||||||
void clearStats();
|
void clearStats();
|
||||||
void printStats(ostream& out) const;
|
void printStats(std::ostream& out) const;
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
inline void increment_injected_flits()
|
inline void increment_injected_flits()
|
||||||
{
|
{
|
||||||
|
@ -125,17 +127,12 @@ private:
|
||||||
Time m_ruby_start;
|
Time m_ruby_start;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Output operator declaration
|
inline std::ostream&
|
||||||
ostream& operator<<(ostream& out, const GarnetNetwork_d& obj);
|
operator<<(std::ostream& out, const GarnetNetwork_d& obj)
|
||||||
|
|
||||||
// ******************* Definitions *******************
|
|
||||||
// Output operator definition
|
|
||||||
extern inline
|
|
||||||
ostream& operator<<(ostream& out, const GarnetNetwork_d& obj)
|
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //GARNETNETWORK_D_H
|
#endif //GARNETNETWORK_D_H
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/InputUnit_d.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
InputUnit_d::InputUnit_d(int id, Router_d *router)
|
InputUnit_d::InputUnit_d(int id, Router_d *router)
|
||||||
{
|
{
|
||||||
m_id = id;
|
m_id = id;
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef INPUT_UNIT_D_H
|
#ifndef INPUT_UNIT_D_H
|
||||||
#define INPUT_UNIT_D_H
|
#define INPUT_UNIT_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
|
@ -47,9 +49,9 @@ public:
|
||||||
~InputUnit_d();
|
~InputUnit_d();
|
||||||
|
|
||||||
void wakeup();
|
void wakeup();
|
||||||
void printConfig(ostream& out);
|
void printConfig(std::ostream& out);
|
||||||
flitBuffer_d* getCreditQueue() { return creditQueue; }
|
flitBuffer_d* getCreditQueue() { return creditQueue; }
|
||||||
void print(ostream& out) const {};
|
void print(std::ostream& out) const {};
|
||||||
|
|
||||||
inline int get_inlink_id()
|
inline int get_inlink_id()
|
||||||
{
|
{
|
||||||
|
|
|
@ -335,14 +335,14 @@ void NetworkInterface_d::checkReschedule()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkInterface_d::printConfig(ostream& out) const
|
void NetworkInterface_d::printConfig(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[Network Interface " << m_id << "] - ";
|
out << "[Network Interface " << m_id << "] - ";
|
||||||
out << "[inLink " << inNetLink->get_id() << "] - ";
|
out << "[inLink " << inNetLink->get_id() << "] - ";
|
||||||
out << "[outLink " << outNetLink->get_id() << "]" << endl;
|
out << "[outLink " << outNetLink->get_id() << "]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkInterface_d::print(ostream& out) const
|
void NetworkInterface_d::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[Network Interface]";
|
out << "[Network Interface]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef NET_INTERFACE_D_H
|
#ifndef NET_INTERFACE_D_H
|
||||||
#define NET_INTERFACE_D_H
|
#define NET_INTERFACE_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.hh"
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
|
@ -55,8 +57,8 @@ public:
|
||||||
|
|
||||||
void wakeup();
|
void wakeup();
|
||||||
void addNode(Vector<MessageBuffer *> &inNode, Vector<MessageBuffer *> &outNode);
|
void addNode(Vector<MessageBuffer *> &inNode, Vector<MessageBuffer *> &outNode);
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
int get_vnet(int vc);
|
int get_vnet(int vc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef NETWORK_LINK_D_H
|
#ifndef NETWORK_LINK_D_H
|
||||||
#define NETWORK_LINK_D_H
|
#define NETWORK_LINK_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
||||||
|
@ -47,7 +49,7 @@ public:
|
||||||
NetworkLink_d(int id, int link_latency, GarnetNetwork_d *net_ptr);
|
NetworkLink_d(int id, int link_latency, GarnetNetwork_d *net_ptr);
|
||||||
void setLinkConsumer(Consumer *consumer);
|
void setLinkConsumer(Consumer *consumer);
|
||||||
void setSourceQueue(flitBuffer_d *srcQueue);
|
void setSourceQueue(flitBuffer_d *srcQueue);
|
||||||
void print(ostream& out) const{}
|
void print(std::ostream& out) const{}
|
||||||
int getLinkUtilization();
|
int getLinkUtilization();
|
||||||
Vector<int> getVcLoad();
|
Vector<int> getVcLoad();
|
||||||
int get_id(){return m_id;}
|
int get_id(){return m_id;}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/OutputUnit_d.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/Router_d.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
OutputUnit_d::OutputUnit_d(int id, Router_d *router)
|
OutputUnit_d::OutputUnit_d(int id, Router_d *router)
|
||||||
{
|
{
|
||||||
m_id = id;
|
m_id = id;
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef OUTPUT_UNIT_D_H
|
#ifndef OUTPUT_UNIT_D_H
|
||||||
#define OUTPUT_UNIT_D_H
|
#define OUTPUT_UNIT_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
||||||
|
@ -48,9 +50,9 @@ public:
|
||||||
void set_credit_link(CreditLink_d *credit_link);
|
void set_credit_link(CreditLink_d *credit_link);
|
||||||
void wakeup();
|
void wakeup();
|
||||||
flitBuffer_d* getOutQueue();
|
flitBuffer_d* getOutQueue();
|
||||||
void printConfig(ostream& out);
|
void printConfig(std::ostream& out);
|
||||||
void update_vc(int vc, int in_port, int in_vc);
|
void update_vc(int vc, int in_port, int in_vc);
|
||||||
void print(ostream& out) const {};
|
void print(std::ostream& out) const {};
|
||||||
int get_credit_cnt(int vc) { return m_outvc_state[vc]->get_credit_count(); }
|
int get_credit_cnt(int vc) { return m_outvc_state[vc]->get_credit_count(); }
|
||||||
void decrement_credit(int out_vc);
|
void decrement_credit(int out_vc);
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/SWallocator_d.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/Switch_d.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
Router_d::Router_d(int id, GarnetNetwork_d *network_ptr)
|
Router_d::Router_d(int id, GarnetNetwork_d *network_ptr)
|
||||||
{
|
{
|
||||||
m_id = id;
|
m_id = id;
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef ROUTER_D_H
|
#ifndef ROUTER_D_H
|
||||||
#define ROUTER_D_H
|
#define ROUTER_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
|
||||||
|
@ -60,7 +62,7 @@ public:
|
||||||
int get_vc_per_vnet() {return m_vc_per_vnet; }
|
int get_vc_per_vnet() {return m_vc_per_vnet; }
|
||||||
int get_num_inports() { return m_input_unit.size(); }
|
int get_num_inports() { return m_input_unit.size(); }
|
||||||
int get_num_outports() { return m_output_unit.size(); }
|
int get_num_outports() { return m_output_unit.size(); }
|
||||||
void printConfig(ostream& out);
|
void printConfig(std::ostream& out);
|
||||||
int get_id() { return m_id; }
|
int get_id() { return m_id; }
|
||||||
GarnetNetwork_d* get_net_ptr() { return m_network_ptr; }
|
GarnetNetwork_d* get_net_ptr() { return m_network_ptr; }
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef SW_ALLOCATOR_D_H
|
#ifndef SW_ALLOCATOR_D_H
|
||||||
#define SW_ALLOCATOR_D_H
|
#define SW_ALLOCATOR_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
|
|
||||||
|
@ -46,7 +48,7 @@ public:
|
||||||
void clear_request_vector();
|
void clear_request_vector();
|
||||||
void check_for_wakeup();
|
void check_for_wakeup();
|
||||||
int get_vnet (int invc);
|
int get_vnet (int invc);
|
||||||
void print(ostream& out) const {};
|
void print(std::ostream& out) const {};
|
||||||
void arbitrate_inports();
|
void arbitrate_inports();
|
||||||
void arbitrate_outports();
|
void arbitrate_outports();
|
||||||
bool is_candidate_inport(int inport, int invc);
|
bool is_candidate_inport(int inport, int invc);
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef SWITCH_D_H
|
#ifndef SWITCH_D_H
|
||||||
#define SWITCH_D_H
|
#define SWITCH_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
||||||
|
@ -45,7 +47,7 @@ public:
|
||||||
void wakeup();
|
void wakeup();
|
||||||
void init();
|
void init();
|
||||||
void check_for_wakeup();
|
void check_for_wakeup();
|
||||||
void print(ostream& out) const {};
|
void print(std::ostream& out) const {};
|
||||||
inline void update_sw_winner(int inport, flit_d *t_flit)
|
inline void update_sw_winner(int inport, flit_d *t_flit)
|
||||||
{
|
{
|
||||||
m_switch_buffer[inport]->insert(t_flit);
|
m_switch_buffer[inport]->insert(t_flit);
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#ifndef VC_ALLOCATOR_D_H
|
#ifndef VC_ALLOCATOR_D_H
|
||||||
#define VC_ALLOCATOR_D_H
|
#define VC_ALLOCATOR_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
|
|
||||||
|
@ -46,7 +49,7 @@ public:
|
||||||
void check_for_wakeup();
|
void check_for_wakeup();
|
||||||
void clear_request_vector();
|
void clear_request_vector();
|
||||||
int get_vnet(int invc);
|
int get_vnet(int invc);
|
||||||
void print(ostream& out) const {};
|
void print(std::ostream& out) const {};
|
||||||
void arbitrate_invcs();
|
void arbitrate_invcs();
|
||||||
void arbitrate_outvcs();
|
void arbitrate_outvcs();
|
||||||
bool is_invc_candidate(int inport_iter, int invc_iter);
|
bool is_invc_candidate(int inport_iter, int invc_iter);
|
||||||
|
@ -69,7 +72,7 @@ private:
|
||||||
|
|
||||||
Router_d *m_router;
|
Router_d *m_router;
|
||||||
Vector<Vector <int > > m_round_robin_invc; // First stage of arbitration where all vcs select an output vc to content for
|
Vector<Vector <int > > m_round_robin_invc; // First stage of arbitration where all vcs select an output vc to content for
|
||||||
Vector<Vector <pair<int, int> > > m_round_robin_outvc; // Arbiter for every output vc
|
Vector<Vector <std::pair<int, int> > > m_round_robin_outvc; // Arbiter for every output vc
|
||||||
Vector<Vector<Vector<Vector<bool > > > > m_outvc_req; // [outport][outvc][inpotr][invc]. set true in the first phase of allocation
|
Vector<Vector<Vector<Vector<bool > > > > m_outvc_req; // [outport][outvc][inpotr][invc]. set true in the first phase of allocation
|
||||||
Vector<Vector<bool > > m_outvc_is_req;
|
Vector<Vector<bool > > m_outvc_is_req;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VIRTUAL_CHANNEL_D_H
|
#ifndef VIRTUAL_CHANNEL_D_H
|
||||||
#define VIRTUAL_CHANNEL_D_H
|
#define VIRTUAL_CHANNEL_D_H
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flitBuffer_d.hh"
|
||||||
|
|
||||||
|
@ -105,7 +107,7 @@ public:
|
||||||
private:
|
private:
|
||||||
int m_id;
|
int m_id;
|
||||||
flitBuffer_d *m_input_buffer;
|
flitBuffer_d *m_input_buffer;
|
||||||
pair<VC_state_type, Time> m_vc_state; // I/R/V/A/C
|
std::pair<VC_state_type, Time> m_vc_state; // I/R/V/A/C
|
||||||
int route;
|
int route;
|
||||||
Time m_enqueue_time;
|
Time m_enqueue_time;
|
||||||
int m_output_vc;
|
int m_output_vc;
|
||||||
|
|
|
@ -67,10 +67,10 @@ bool flitBuffer_d::isReadyForNext()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flitBuffer_d::print(ostream& out) const
|
void flitBuffer_d::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[flitBuffer: ";
|
out << "[flitBuffer: ";
|
||||||
out << m_buffer.size() << "] " << endl;
|
out << m_buffer.size() << "] " << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool flitBuffer_d::isFull()
|
bool flitBuffer_d::isFull()
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef FLIT_BUFFER_D_H
|
#ifndef FLIT_BUFFER_D_H
|
||||||
#define FLIT_BUFFER_D_H
|
#define FLIT_BUFFER_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/gems_common/PrioHeap.hh"
|
#include "mem/gems_common/PrioHeap.hh"
|
||||||
#include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
|
#include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh"
|
||||||
|
@ -43,7 +45,7 @@ public:
|
||||||
bool isReady();
|
bool isReady();
|
||||||
bool isReadyForNext();
|
bool isReadyForNext();
|
||||||
bool isEmpty();
|
bool isEmpty();
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
bool isFull();
|
bool isFull();
|
||||||
void setMaxSize(int maximum);
|
void setMaxSize(int maximum);
|
||||||
|
|
||||||
|
@ -65,17 +67,12 @@ private:
|
||||||
int size, max_size;
|
int size, max_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
ostream& operator<<(ostream& out, const flitBuffer_d& obj);
|
inline std::ostream&
|
||||||
|
operator<<(std::ostream& out, const flitBuffer_d& obj)
|
||||||
// ******************* Definitions *******************
|
|
||||||
|
|
||||||
// Output operator definition
|
|
||||||
extern inline
|
|
||||||
ostream& operator<<(ostream& out, const flitBuffer_d& obj)
|
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -117,7 +117,7 @@ void flit_d::advance_stage(flit_stage t_stage)
|
||||||
m_stage.second = g_eventQueue_ptr->getTime() + 1;
|
m_stage.second = g_eventQueue_ptr->getTime() + 1;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
void flit_d::print(ostream& out) const
|
void flit_d::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[flit:: ";
|
out << "[flit:: ";
|
||||||
out << "Id=" << m_id << " ";
|
out << "Id=" << m_id << " ";
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef FLIT_D_H
|
#ifndef FLIT_D_H
|
||||||
#define FLIT_D_H
|
#define FLIT_D_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/slicc_interface/Message.hh"
|
#include "mem/ruby/slicc_interface/Message.hh"
|
||||||
|
|
||||||
|
@ -40,7 +42,7 @@ public:
|
||||||
flit_d(int vc, bool is_free_signal);
|
flit_d(int vc, bool is_free_signal);
|
||||||
void set_outport(int port) { m_outport = port; }
|
void set_outport(int port) { m_outport = port; }
|
||||||
int get_outport() {return m_outport; }
|
int get_outport() {return m_outport; }
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
bool is_free_signal()
|
bool is_free_signal()
|
||||||
{
|
{
|
||||||
return m_is_free_signal;
|
return m_is_free_signal;
|
||||||
|
@ -99,7 +101,7 @@ public:
|
||||||
m_stage.first = t_stage;
|
m_stage.first = t_stage;
|
||||||
m_stage.second = g_eventQueue_ptr->getTime() + 1;
|
m_stage.second = g_eventQueue_ptr->getTime() + 1;
|
||||||
}
|
}
|
||||||
inline pair<flit_stage, Time> get_stage()
|
inline std::pair<flit_stage, Time> get_stage()
|
||||||
{
|
{
|
||||||
return m_stage;
|
return m_stage;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +128,7 @@ private:
|
||||||
MsgPtr m_msg_ptr;
|
MsgPtr m_msg_ptr;
|
||||||
int m_outport;
|
int m_outport;
|
||||||
int src_delay;
|
int src_delay;
|
||||||
pair<flit_stage, Time> m_stage;
|
std::pair<flit_stage, Time> m_stage;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -143,18 +145,12 @@ bool node_less_then_eq(flit_d* n1, flit_d* n2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output operator declaration
|
inline std::ostream&
|
||||||
ostream& operator<<(ostream& out, const flit_d& obj);
|
operator<<(std::ostream& out, const flit_d& obj)
|
||||||
|
|
||||||
// ******************* Definitions *******************
|
|
||||||
|
|
||||||
// Output operator definition
|
|
||||||
extern inline
|
|
||||||
ostream& operator<<(ostream& out, const flit_d& obj)
|
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/NetworkLink.hh"
|
||||||
#include "mem/ruby/common/NetDest.hh"
|
#include "mem/ruby/common/NetDest.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
GarnetNetwork::GarnetNetwork(const Params *p)
|
GarnetNetwork::GarnetNetwork(const Params *p)
|
||||||
: BaseGarnetNetwork(p)
|
: BaseGarnetNetwork(p)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef GARNET_NETWORK_H
|
#ifndef GARNET_NETWORK_H
|
||||||
#define GARNET_NETWORK_H
|
#define GARNET_NETWORK_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
|
#include "mem/ruby/network/garnet/BaseGarnetNetwork.hh"
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
|
@ -58,9 +60,9 @@ public:
|
||||||
MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
|
MessageBuffer* getFromNetQueue(NodeID id, bool ordered, int network_num);
|
||||||
|
|
||||||
void clearStats();
|
void clearStats();
|
||||||
void printStats(ostream& out) const;
|
void printStats(std::ostream& out) const;
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
|
bool isVNetOrdered(int vnet) { return m_ordered[vnet]; }
|
||||||
bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
|
bool validVirtualNetwork(int vnet) { return m_in_use[vnet]; }
|
||||||
|
@ -101,17 +103,12 @@ private:
|
||||||
Time m_ruby_start;
|
Time m_ruby_start;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Output operator declaration
|
inline std::ostream&
|
||||||
ostream& operator<<(ostream& out, const GarnetNetwork& obj);
|
operator<<(std::ostream& out, const GarnetNetwork& obj)
|
||||||
|
|
||||||
// ******************* Definitions *******************
|
|
||||||
// Output operator definition
|
|
||||||
extern inline
|
|
||||||
ostream& operator<<(ostream& out, const GarnetNetwork& obj)
|
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //NETWORK_H
|
#endif //NETWORK_H
|
||||||
|
|
|
@ -290,14 +290,14 @@ void NetworkInterface::checkReschedule()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkInterface::printConfig(ostream& out) const
|
void NetworkInterface::printConfig(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[Network Interface " << m_id << "] - ";
|
out << "[Network Interface " << m_id << "] - ";
|
||||||
out << "[inLink " << inNetLink->get_id() << "] - ";
|
out << "[inLink " << inNetLink->get_id() << "] - ";
|
||||||
out << "[outLink " << outNetLink->get_id() << "]" << endl;
|
out << "[outLink " << outNetLink->get_id() << "]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkInterface::print(ostream& out) const
|
void NetworkInterface::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[Network Interface]";
|
out << "[Network Interface]";
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef NET_INTERFACE_H
|
#ifndef NET_INTERFACE_H
|
||||||
#define NET_INTERFACE_H
|
#define NET_INTERFACE_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
|
@ -62,8 +64,8 @@ public:
|
||||||
}
|
}
|
||||||
void request_vc(int in_vc, int in_port, NetDest destination, Time request_time);
|
void request_vc(int in_vc, int in_port, NetDest destination, Time request_time);
|
||||||
|
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**************Data Members*************/
|
/**************Data Members*************/
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef NETWORK_LINK_H
|
#ifndef NETWORK_LINK_H
|
||||||
#define NETWORK_LINK_H
|
#define NETWORK_LINK_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/flitBuffer.hh"
|
||||||
|
@ -50,7 +52,7 @@ public:
|
||||||
flit* peekLink();
|
flit* peekLink();
|
||||||
flit* consumeLink();
|
flit* consumeLink();
|
||||||
|
|
||||||
void print(ostream& out) const {}
|
void print(std::ostream& out) const {}
|
||||||
|
|
||||||
bool is_vc_ready(flit *t_flit);
|
bool is_vc_ready(flit *t_flit);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/OutVcState.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/OutVcState.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/VCarbiter.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
Router::Router(int id, GarnetNetwork *network_ptr)
|
Router::Router(int id, GarnetNetwork *network_ptr)
|
||||||
{
|
{
|
||||||
m_id = id;
|
m_id = id;
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef ROUTER_H
|
#ifndef ROUTER_H
|
||||||
#define ROUTER_H
|
#define ROUTER_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/GarnetNetwork.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/FlexibleConsumer.hh"
|
||||||
|
@ -58,8 +60,8 @@ public:
|
||||||
void release_vc(int out_port, int vc, Time release_time);
|
void release_vc(int out_port, int vc, Time release_time);
|
||||||
void vc_arbitrate();
|
void vc_arbitrate();
|
||||||
|
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/***************Data Members******************/
|
/***************Data Members******************/
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VC_ARBITER_H
|
#ifndef VC_ARBITER_H
|
||||||
#define VC_ARBITER_H
|
#define VC_ARBITER_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
|
|
||||||
|
@ -41,7 +43,7 @@ public:
|
||||||
VCarbiter(Router *router);
|
VCarbiter(Router *router);
|
||||||
~VCarbiter() {}
|
~VCarbiter() {}
|
||||||
|
|
||||||
void print(ostream& out) const {}
|
void print(std::ostream& out) const {}
|
||||||
void wakeup();
|
void wakeup();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -96,7 +96,7 @@ flit_type flit::get_type()
|
||||||
return m_type;
|
return m_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flit::print(ostream& out) const
|
void flit::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[flit:: ";
|
out << "[flit:: ";
|
||||||
out << "Id=" << m_id << " ";
|
out << "Id=" << m_id << " ";
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
* Authors: Niket Agarwal
|
* Authors: Niket Agarwal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/ruby/slicc_interface/Message.hh"
|
#include "mem/ruby/slicc_interface/Message.hh"
|
||||||
|
|
||||||
|
@ -48,7 +50,7 @@ public:
|
||||||
void set_vc(int vc);
|
void set_vc(int vc);
|
||||||
MsgPtr& get_msg_ptr();
|
MsgPtr& get_msg_ptr();
|
||||||
flit_type get_type();
|
flit_type get_type();
|
||||||
void print(ostream&out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/************Data Members*************/
|
/************Data Members*************/
|
||||||
|
@ -75,18 +77,12 @@ bool node_less_then_eq(flit* n1, flit* n2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output operator declaration
|
inline std::ostream&
|
||||||
ostream& operator<<(ostream& out, const flit& obj);
|
operator<<(std::ostream& out, const flit& obj)
|
||||||
|
|
||||||
// ******************* Definitions *******************
|
|
||||||
|
|
||||||
// Output operator definition
|
|
||||||
extern inline
|
|
||||||
ostream& operator<<(ostream& out, const flit& obj)
|
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -92,8 +92,8 @@ void flitBuffer::insert(flit *flt)
|
||||||
m_buffer.insert(flt);
|
m_buffer.insert(flt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void flitBuffer::print(ostream& out) const
|
void flitBuffer::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << "[flitBuffer: ";
|
out << "[flitBuffer: ";
|
||||||
out << m_buffer.size() << "] " << endl;
|
out << m_buffer.size() << "] " << std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef FLIT_BUFFER_H
|
#ifndef FLIT_BUFFER_H
|
||||||
#define FLIT_BUFFER_H
|
#define FLIT_BUFFER_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
#include "mem/ruby/network/garnet/NetworkHeader.hh"
|
||||||
#include "mem/gems_common/PrioHeap.hh"
|
#include "mem/gems_common/PrioHeap.hh"
|
||||||
#include "mem/ruby/network/garnet/flexible-pipeline/flit.hh"
|
#include "mem/ruby/network/garnet/flexible-pipeline/flit.hh"
|
||||||
|
@ -48,7 +50,7 @@ public:
|
||||||
flit *getTopFlit();
|
flit *getTopFlit();
|
||||||
flit *peekTopFlit();
|
flit *peekTopFlit();
|
||||||
void insert(flit *flt);
|
void insert(flit *flt);
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
/**********Data Members*********/
|
/**********Data Members*********/
|
||||||
private:
|
private:
|
||||||
|
@ -56,17 +58,12 @@ private:
|
||||||
int size, max_size;
|
int size, max_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
ostream& operator<<(ostream& out, const flitBuffer& obj);
|
inline std::ostream&
|
||||||
|
operator<<(std::ostream& out, const flitBuffer& obj)
|
||||||
// ******************* Definitions *******************
|
|
||||||
|
|
||||||
// Output operator definition
|
|
||||||
extern inline
|
|
||||||
ostream& operator<<(ostream& out, const flitBuffer& obj)
|
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
|
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
const int PRIORITY_SWITCH_LIMIT = 128;
|
const int PRIORITY_SWITCH_LIMIT = 128;
|
||||||
|
|
||||||
// Operator for helper class
|
// Operator for helper class
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#include "mem/ruby/profiler/Profiler.hh"
|
#include "mem/ruby/profiler/Profiler.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// ***BIG HACK*** - This is actually code that _should_ be in Network.cc
|
// ***BIG HACK*** - This is actually code that _should_ be in Network.cc
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
#ifndef __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
|
#ifndef __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
|
||||||
#define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
|
#define __MEM_RUBY_NETWORK_SIMPLE_SIMPLENETWORK_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/ruby/network/Network.hh"
|
#include "mem/ruby/network/Network.hh"
|
||||||
|
@ -85,9 +87,9 @@ class SimpleNetwork : public Network
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
void printStats(ostream& out) const;
|
void printStats(std::ostream& out) const;
|
||||||
void clearStats();
|
void clearStats();
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
@ -112,7 +114,7 @@ class SimpleNetwork : public Network
|
||||||
const NetDest& routing_table_entry, int link_latency, int link_weight,
|
const NetDest& routing_table_entry, int link_latency, int link_weight,
|
||||||
int bw_multiplier, bool isReconfiguration);
|
int bw_multiplier, bool isReconfiguration);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
|
void checkNetworkAllocation(NodeID id, bool ordered, int network_num);
|
||||||
|
@ -138,11 +140,11 @@ class SimpleNetwork : public Network
|
||||||
Vector<Switch*> m_endpoint_switches;
|
Vector<Switch*> m_endpoint_switches;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const SimpleNetwork& obj)
|
operator<<(std::ostream& out, const SimpleNetwork& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include "mem/ruby/network/simple/Switch.hh"
|
#include "mem/ruby/network/simple/Switch.hh"
|
||||||
#include "mem/ruby/network/simple/Throttle.hh"
|
#include "mem/ruby/network/simple/Throttle.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr)
|
Switch::Switch(SwitchID sid, SimpleNetwork* network_ptr)
|
||||||
{
|
{
|
||||||
m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr);
|
m_perfect_switch_ptr = new PerfectSwitch(sid, network_ptr);
|
||||||
|
@ -129,8 +131,6 @@ Switch::getThrottles() const
|
||||||
void
|
void
|
||||||
Switch::printStats(std::ostream& out) const
|
Switch::printStats(std::ostream& out) const
|
||||||
{
|
{
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
ccprintf(out, "switch_%d_inlinks: %d\n", m_switch_id,
|
ccprintf(out, "switch_%d_inlinks: %d\n", m_switch_id,
|
||||||
m_perfect_switch_ptr->getInLinks());
|
m_perfect_switch_ptr->getInLinks());
|
||||||
ccprintf(out, "switch_%d_outlinks: %d\n", m_switch_id,
|
ccprintf(out, "switch_%d_outlinks: %d\n", m_switch_id,
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
|
#include "mem/ruby/slicc_interface/NetworkMessage.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
const int HIGH_RANGE = 256;
|
const int HIGH_RANGE = 256;
|
||||||
const int ADJUST_INTERVAL = 50000;
|
const int ADJUST_INTERVAL = 50000;
|
||||||
const int MESSAGE_SIZE_MULTIPLIER = 1000;
|
const int MESSAGE_SIZE_MULTIPLIER = 1000;
|
||||||
|
@ -43,7 +45,7 @@ const int PRIORITY_SWITCH_LIMIT = 128;
|
||||||
|
|
||||||
static int network_message_to_size(NetworkMessage* net_msg_ptr);
|
static int network_message_to_size(NetworkMessage* net_msg_ptr);
|
||||||
|
|
||||||
extern std::ostream *debug_cout_ptr;
|
extern ostream *debug_cout_ptr;
|
||||||
|
|
||||||
Throttle::Throttle(int sID, NodeID node, int link_latency,
|
Throttle::Throttle(int sID, NodeID node, int link_latency,
|
||||||
int link_bandwidth_multiplier)
|
int link_bandwidth_multiplier)
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#ifndef __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
|
#ifndef __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
|
||||||
#define __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
|
#define __MEM_RUBY_NETWORK_SIMPLE_THROTTLE_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/gems_common/Vector.hh"
|
#include "mem/gems_common/Vector.hh"
|
||||||
#include "mem/ruby/common/Consumer.hh"
|
#include "mem/ruby/common/Consumer.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -59,9 +61,9 @@ class Throttle : public Consumer
|
||||||
const Vector<MessageBuffer*>& out_vec);
|
const Vector<MessageBuffer*>& out_vec);
|
||||||
void wakeup();
|
void wakeup();
|
||||||
|
|
||||||
void printStats(ostream& out) const;
|
void printStats(std::ostream& out) const;
|
||||||
void clearStats();
|
void clearStats();
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
// The average utilization (a percent) since last clearStats()
|
// The average utilization (a percent) since last clearStats()
|
||||||
double getUtilization() const;
|
double getUtilization() const;
|
||||||
int
|
int
|
||||||
|
@ -80,7 +82,7 @@ class Throttle : public Consumer
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(NodeID node, int link_latency, int link_bandwidth_multiplier);
|
void init(NodeID node, int link_latency, int link_bandwidth_multiplier);
|
||||||
|
@ -107,11 +109,11 @@ class Throttle : public Consumer
|
||||||
double m_links_utilized;
|
double m_links_utilized;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const Throttle& obj)
|
operator<<(std::ostream& out, const Throttle& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include "mem/ruby/slicc_interface/AbstractController.hh"
|
#include "mem/ruby/slicc_interface/AbstractController.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
const int INFINITE_LATENCY = 10000; // Yes, this is a big hack
|
const int INFINITE_LATENCY = 10000; // Yes, this is a big hack
|
||||||
const int DEFAULT_BW_MULTIPLIER = 1; // Just to be consistent with above :)
|
const int DEFAULT_BW_MULTIPLIER = 1; // Just to be consistent with above :)
|
||||||
|
|
||||||
|
@ -276,8 +278,6 @@ Topology::clearStats()
|
||||||
void
|
void
|
||||||
Topology::printConfig(std::ostream& out) const
|
Topology::printConfig(std::ostream& out) const
|
||||||
{
|
{
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
if (m_print_config == false)
|
if (m_print_config == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ AccessTraceForAddress::~AccessTraceForAddress()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AccessTraceForAddress::print(ostream& out) const
|
AccessTraceForAddress::print(std::ostream& out) const
|
||||||
{
|
{
|
||||||
out << m_addr;
|
out << m_addr;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#ifndef __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
|
#ifndef __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
|
||||||
#define __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
|
#define __MEM_RUBY_PROFILER_ACCESSTRACEFORADDRESS_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/protocol/AccessModeType.hh"
|
#include "mem/protocol/AccessModeType.hh"
|
||||||
#include "mem/protocol/CacheRequestType.hh"
|
#include "mem/protocol/CacheRequestType.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
|
@ -53,7 +55,7 @@ class AccessTraceForAddress
|
||||||
const Address& getAddress() const { return m_addr; }
|
const Address& getAddress() const { return m_addr; }
|
||||||
void addSample(int value);
|
void addSample(int value);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Address m_addr;
|
Address m_addr;
|
||||||
|
@ -74,11 +76,11 @@ node_less_then_eq(const AccessTraceForAddress* n1,
|
||||||
return n1->getTotal() > n2->getTotal();
|
return n1->getTotal() > n2->getTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const AccessTraceForAddress& obj)
|
operator<<(std::ostream& out, const AccessTraceForAddress& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "mem/ruby/profiler/Profiler.hh"
|
#include "mem/ruby/profiler/Profiler.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
typedef AddressProfiler::AddressMap AddressMap;
|
typedef AddressProfiler::AddressMap AddressMap;
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#ifndef __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
|
#ifndef __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
|
||||||
#define __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
|
#define __MEM_RUBY_PROFILER_ADDRESSPROFILER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/protocol/AccessType.hh"
|
#include "mem/protocol/AccessType.hh"
|
||||||
#include "mem/protocol/CacheMsg.hh"
|
#include "mem/protocol/CacheMsg.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
|
@ -49,7 +51,7 @@ class AddressProfiler
|
||||||
AddressProfiler(int num_of_sequencers);
|
AddressProfiler(int num_of_sequencers);
|
||||||
~AddressProfiler();
|
~AddressProfiler();
|
||||||
|
|
||||||
void printStats(ostream& out) const;
|
void printStats(std::ostream& out) const;
|
||||||
void clearStats();
|
void clearStats();
|
||||||
|
|
||||||
void addTraceSample(Address data_addr, Address pc_addr,
|
void addTraceSample(Address data_addr, Address pc_addr,
|
||||||
|
@ -61,7 +63,7 @@ class AddressProfiler
|
||||||
void profileGetS(const Address& datablock, const Address& PC,
|
void profileGetS(const Address& datablock, const Address& PC,
|
||||||
const Set& owner, const Set& sharers, NodeID requestor);
|
const Set& owner, const Set& sharers, NodeID requestor);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
//added by SS
|
//added by SS
|
||||||
void setHotLines(bool hot_lines);
|
void setHotLines(bool hot_lines);
|
||||||
|
@ -91,11 +93,11 @@ class AddressProfiler
|
||||||
int m_num_of_sequencers;
|
int m_num_of_sequencers;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const AddressProfiler& obj)
|
operator<<(std::ostream& out, const AddressProfiler& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "mem/ruby/profiler/Profiler.hh"
|
#include "mem/ruby/profiler/Profiler.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
CacheProfiler::CacheProfiler(const string& description)
|
CacheProfiler::CacheProfiler(const string& description)
|
||||||
{
|
{
|
||||||
m_description = description;
|
m_description = description;
|
||||||
|
|
|
@ -59,7 +59,9 @@
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
extern std::ostream* debug_cout_ptr;
|
using namespace std;
|
||||||
|
|
||||||
|
extern ostream* debug_cout_ptr;
|
||||||
|
|
||||||
static double process_memory_total();
|
static double process_memory_total();
|
||||||
static double process_memory_resident();
|
static double process_memory_resident();
|
||||||
|
|
|
@ -45,6 +45,9 @@
|
||||||
#ifndef __MEM_RUBY_PROFILER_PROFILER_HH__
|
#ifndef __MEM_RUBY_PROFILER_PROFILER_HH__
|
||||||
#define __MEM_RUBY_PROFILER_PROFILER_HH__
|
#define __MEM_RUBY_PROFILER_PROFILER_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "mem/protocol/AccessModeType.hh"
|
#include "mem/protocol/AccessModeType.hh"
|
||||||
#include "mem/protocol/AccessType.hh"
|
#include "mem/protocol/AccessType.hh"
|
||||||
#include "mem/protocol/CacheRequestType.hh"
|
#include "mem/protocol/CacheRequestType.hh"
|
||||||
|
@ -77,22 +80,22 @@ class Profiler : public SimObject, public Consumer
|
||||||
|
|
||||||
void wakeup();
|
void wakeup();
|
||||||
|
|
||||||
void setPeriodicStatsFile(const string& filename);
|
void setPeriodicStatsFile(const std::string& filename);
|
||||||
void setPeriodicStatsInterval(integer_t period);
|
void setPeriodicStatsInterval(integer_t period);
|
||||||
|
|
||||||
void printStats(ostream& out, bool short_stats=false);
|
void printStats(std::ostream& out, bool short_stats=false);
|
||||||
void printShortStats(ostream& out) { printStats(out, true); }
|
void printShortStats(std::ostream& out) { printStats(out, true); }
|
||||||
void printTraceStats(ostream& out) const;
|
void printTraceStats(std::ostream& out) const;
|
||||||
void clearStats();
|
void clearStats();
|
||||||
void printConfig(ostream& out) const;
|
void printConfig(std::ostream& out) const;
|
||||||
void printResourceUsage(ostream& out) const;
|
void printResourceUsage(std::ostream& out) const;
|
||||||
|
|
||||||
AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; }
|
AddressProfiler* getAddressProfiler() { return m_address_profiler_ptr; }
|
||||||
AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; }
|
AddressProfiler* getInstructionProfiler() { return m_inst_profiler_ptr; }
|
||||||
|
|
||||||
void addAddressTraceSample(const CacheMsg& msg, NodeID id);
|
void addAddressTraceSample(const CacheMsg& msg, NodeID id);
|
||||||
|
|
||||||
void profileRequest(const string& requestStr);
|
void profileRequest(const std::string& requestStr);
|
||||||
void profileSharing(const Address& addr, AccessType type,
|
void profileSharing(const Address& addr, AccessType type,
|
||||||
NodeID requestor, const Set& sharers,
|
NodeID requestor, const Set& sharers,
|
||||||
const Set& owner);
|
const Set& owner);
|
||||||
|
@ -134,13 +137,12 @@ class Profiler : public SimObject, public Consumer
|
||||||
GenericMachineType respondingMach);
|
GenericMachineType respondingMach);
|
||||||
void sequencerRequests(int num) { m_sequencer_requests.add(num); }
|
void sequencerRequests(int num) { m_sequencer_requests.add(num); }
|
||||||
|
|
||||||
void profileTransition(const string& component, NodeID version,
|
void profileTransition(const std::string& component, NodeID version,
|
||||||
Address addr, const string& state,
|
Address addr, const std::string& state, const std::string& event,
|
||||||
const string& event, const string& next_state,
|
const std::string& next_state, const std::string& note);
|
||||||
const string& note);
|
|
||||||
void profileMsgDelay(int virtualNetwork, int delayCycles);
|
void profileMsgDelay(int virtualNetwork, int delayCycles);
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
void rubyWatch(int proc);
|
void rubyWatch(int proc);
|
||||||
bool watchAddress(Address addr);
|
bool watchAddress(Address addr);
|
||||||
|
@ -167,7 +169,7 @@ class Profiler : public SimObject, public Consumer
|
||||||
Vector<int64> m_instructions_executed_at_start;
|
Vector<int64> m_instructions_executed_at_start;
|
||||||
Vector<int64> m_cycles_executed_at_start;
|
Vector<int64> m_cycles_executed_at_start;
|
||||||
|
|
||||||
ostream* m_periodic_output_file_ptr;
|
std::ostream* m_periodic_output_file_ptr;
|
||||||
integer_t m_stats_period;
|
integer_t m_stats_period;
|
||||||
|
|
||||||
Time m_ruby_start;
|
Time m_ruby_start;
|
||||||
|
@ -210,7 +212,7 @@ class Profiler : public SimObject, public Consumer
|
||||||
Map<Address, int>* m_watch_address_list_ptr;
|
Map<Address, int>* m_watch_address_list_ptr;
|
||||||
// counts all initiated cache request including PUTs
|
// counts all initiated cache request including PUTs
|
||||||
int m_requests;
|
int m_requests;
|
||||||
Map <string, int>* m_requestProfileMap_ptr;
|
Map <std::string, int>* m_requestProfileMap_ptr;
|
||||||
|
|
||||||
//added by SS
|
//added by SS
|
||||||
bool m_hot_lines;
|
bool m_hot_lines;
|
||||||
|
@ -219,11 +221,11 @@ class Profiler : public SimObject, public Consumer
|
||||||
int m_num_of_sequencers;
|
int m_num_of_sequencers;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const Profiler& obj)
|
operator<<(std::ostream& out, const Profiler& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
|
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
|
||||||
#include "mem/ruby/profiler/StoreTrace.hh"
|
#include "mem/ruby/profiler/StoreTrace.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
bool StoreTrace::s_init = false; // Total number of store lifetimes of
|
bool StoreTrace::s_init = false; // Total number of store lifetimes of
|
||||||
// all lines
|
// all lines
|
||||||
int64 StoreTrace::s_total_samples = 0; // Total number of store
|
int64 StoreTrace::s_total_samples = 0; // Total number of store
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#ifndef __MEM_RUBY_PROFILER_STORETRACE_HH__
|
#ifndef __MEM_RUBY_PROFILER_STORETRACE_HH__
|
||||||
#define __MEM_RUBY_PROFILER_STORETRACE_HH__
|
#define __MEM_RUBY_PROFILER_STORETRACE_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/ruby/common/Histogram.hh"
|
#include "mem/ruby/common/Histogram.hh"
|
||||||
|
@ -44,10 +46,10 @@ class StoreTrace
|
||||||
void downgrade(NodeID node);
|
void downgrade(NodeID node);
|
||||||
int getTotal() const { return m_total_samples; }
|
int getTotal() const { return m_total_samples; }
|
||||||
static void initSummary();
|
static void initSummary();
|
||||||
static void printSummary(ostream& out);
|
static void printSummary(std::ostream& out);
|
||||||
static void clearSummary();
|
static void clearSummary();
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool s_init;
|
static bool s_init;
|
||||||
|
@ -77,11 +79,11 @@ node_less_then_eq(const StoreTrace* n1, const StoreTrace* n2)
|
||||||
return n1->getTotal() > n2->getTotal();
|
return n1->getTotal() > n2->getTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const StoreTrace& obj)
|
operator<<(std::ostream& out, const StoreTrace& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "mem/ruby/recorder/CacheRecorder.hh"
|
#include "mem/ruby/recorder/CacheRecorder.hh"
|
||||||
#include "mem/ruby/recorder/TraceRecord.hh"
|
#include "mem/ruby/recorder/TraceRecord.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
CacheRecorder::CacheRecorder()
|
CacheRecorder::CacheRecorder()
|
||||||
{
|
{
|
||||||
m_records_ptr = new PrioHeap<TraceRecord>;
|
m_records_ptr = new PrioHeap<TraceRecord>;
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
#include "sim/sim_object.hh"
|
#include "sim/sim_object.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
TraceRecord::TraceRecord(Sequencer* _sequencer, const Address& data_addr,
|
TraceRecord::TraceRecord(Sequencer* _sequencer, const Address& data_addr,
|
||||||
const Address& pc_addr, RubyRequestType type, Time time)
|
const Address& pc_addr, RubyRequestType type, Time time)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#ifndef __MEM_RUBY_RECORDER_TRACERECORD_HH__
|
#ifndef __MEM_RUBY_RECORDER_TRACERECORD_HH__
|
||||||
#define __MEM_RUBY_RECORDER_TRACERECORD_HH__
|
#define __MEM_RUBY_RECORDER_TRACERECORD_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
#include "mem/ruby/libruby_internal.hh"
|
#include "mem/ruby/libruby_internal.hh"
|
||||||
|
@ -66,9 +68,9 @@ class TraceRecord
|
||||||
|
|
||||||
void issueRequest() const;
|
void issueRequest() const;
|
||||||
|
|
||||||
void print(ostream& out) const;
|
void print(std::ostream& out) const;
|
||||||
void output(ostream& out) const;
|
void output(std::ostream& out) const;
|
||||||
bool input(istream& in);
|
bool input(std::istream& in);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Sequencer* m_sequencer_ptr;
|
Sequencer* m_sequencer_ptr;
|
||||||
|
@ -85,7 +87,7 @@ node_less_then_eq(const TraceRecord& n1, const TraceRecord& n2)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const TraceRecord& obj)
|
operator<<(std::ostream& out, const TraceRecord& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << std::flush;
|
out << std::flush;
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "mem/ruby/recorder/Tracer.hh"
|
#include "mem/ruby/recorder/Tracer.hh"
|
||||||
#include "mem/ruby/system/System.hh"
|
#include "mem/ruby/system/System.hh"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
Tracer::Tracer(const Params *p)
|
Tracer::Tracer(const Params *p)
|
||||||
: SimObject(p)
|
: SimObject(p)
|
||||||
{
|
{
|
||||||
|
@ -43,7 +45,7 @@ Tracer::Tracer(const Params *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Tracer::startTrace(std::string filename)
|
Tracer::startTrace(string filename)
|
||||||
{
|
{
|
||||||
if (m_enabled)
|
if (m_enabled)
|
||||||
stopTrace();
|
stopTrace();
|
||||||
|
@ -80,7 +82,7 @@ Tracer::traceRequest(Sequencer* sequencer, const Address& data_addr,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Tracer::playbackTrace(std::string filename)
|
Tracer::playbackTrace(string filename)
|
||||||
{
|
{
|
||||||
igzstream in(filename.c_str());
|
igzstream in(filename.c_str());
|
||||||
if (in.fail()) {
|
if (in.fail()) {
|
||||||
|
@ -123,7 +125,7 @@ Tracer::playbackTrace(std::string filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Tracer::print(std::ostream& out) const
|
Tracer::print(ostream& out) const
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCACHEENTRY_HH__
|
#ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCACHEENTRY_HH__
|
||||||
#define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCACHEENTRY_HH__
|
#define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCACHEENTRY_HH__
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "mem/protocol/AccessPermission.hh"
|
#include "mem/protocol/AccessPermission.hh"
|
||||||
#include "mem/ruby/common/Address.hh"
|
#include "mem/ruby/common/Address.hh"
|
||||||
#include "mem/ruby/common/Global.hh"
|
#include "mem/ruby/common/Global.hh"
|
||||||
|
@ -53,11 +55,11 @@ class AbstractCacheEntry : public AbstractEntry
|
||||||
// block, required by CacheMemory
|
// block, required by CacheMemory
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ostream&
|
inline std::ostream&
|
||||||
operator<<(ostream& out, const AbstractCacheEntry& obj)
|
operator<<(std::ostream& out, const AbstractCacheEntry& obj)
|
||||||
{
|
{
|
||||||
obj.print(out);
|
obj.print(out);
|
||||||
out << flush;
|
out << std::flush;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue