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