}
void
-Check::print(ostream& out) const
+Check::print(std::ostream& out) const
{
out << "["
<< m_address << ", value: "
<< m_status << ", initiating node: "
<< m_initiatingNode << ", store_count: "
<< m_store_count
- << "]" << flush;
+ << "]" << std::flush;
}
void
#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"
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();
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;
}
}
void
-CheckTable::print(ostream& out) const
+CheckTable::print(std::ostream& out) const
{
}
}
void
-RubyTester::print(ostream& out) const
+RubyTester::print(std::ostream& out) const
{
- out << "[RubyTester]" << endl;
+ out << "[RubyTester]" << std::endl;
}
RubyTester *
#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"
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
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;
}
#ifndef VECTOR_H
#define VECTOR_H
+#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
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>
}
}
- string getCoherenceRequestTypeStr(CoherenceRequestType type) {
+ std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
return CoherenceRequestType_to_string(type);
}
return State:NP;
}
- 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);
}
return State:NP;
}
- string getStateStr(Address addr) {
+ std::string getStateStr(Address addr) {
return L2Cache_State_to_string(getState(addr));
}
}
}
- 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);
}
}
}
- string getStateStr(Address addr) {
+ std::string getStateStr(Address addr) {
return L2Cache_State_to_string(getState(addr));
}
return State:NP;
}
- string getStateStr(Address addr) {
+ std::string getStateStr(Address addr) {
return L1Cache_State_to_string(getState(addr));
}
}
}
- string getCoherenceRequestTypeStr(CoherenceRequestType type) {
+ std::string getCoherenceRequestTypeStr(CoherenceRequestType type) {
return CoherenceRequestType_to_string(type);
}
return State:L2_NP;
}
- string getStateStr(Address addr) {
+ std::string getStateStr(Address addr) {
return L2Cache_State_to_string(getState(addr));
}
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);
}
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";
}
// 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);
// 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);
// Miscallaneous Functions
-void error(string msg);
+void error(std::string msg);
void assert(bool condition);
int random(int number);
Time get_time();
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
MessageBuffer::MessageBuffer(const string &name)
{
m_msg_counter = 0;
#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)
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)
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;
}
}
inline void
-Address::print(ostream& out) const
+Address::print(std::ostream& out) const
{
using namespace std;
out << "[" << hex << "0x" << m_address << "," << " line 0x"
#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"
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);
}
void
-NetDest::print(ostream& out) const
+NetDest::print(std::ostream& out) const
{
out << "[NetDest (" << m_bits.size() << ") ";
#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
{
// 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")
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;
}
return *this;
}
-void Set::print(ostream& out) const
+void Set::print(std::ostream& out) const
{
if(m_p_nArray==NULL) {
out << "[Set {Empty}]";
#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"
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
};
// 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;
}
}
void
-SubBlock::print(ostream& out) const
+SubBlock::print(std::ostream& out) const
{
out << "[" << m_address << ", " << getSize() << ", " << m_data << "]";
}
#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"
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;
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;
}
}
void
-RubyEventQueue::print(ostream& out) const
+RubyEventQueue::print(std::ostream& out) const
{
out << "[Event Queue:]";
}
#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"
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;
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/filters/BlockBloomFilter.hh"
+using namespace std;
+
BlockBloomFilter::BlockBloomFilter(string str)
{
string tail(str);
#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"
class BlockBloomFilter : public AbstractBloomFilter
{
public:
- BlockBloomFilter(string config);
+ BlockBloomFilter(std::string config);
~BlockBloomFilter();
void clear();
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);
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/filters/BulkBloomFilter.hh"
+using namespace std;
+
BulkBloomFilter::BulkBloomFilter(string str)
{
string tail(str);
#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"
class BulkBloomFilter : public AbstractBloomFilter
{
public:
- BulkBloomFilter(string config);
+ BulkBloomFilter(std::string config);
~BulkBloomFilter();
void clear();
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);
#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
#include "mem/ruby/filters/NonCountingBloomFilter.hh"
+using namespace std;
+
GenericBloomFilter::GenericBloomFilter(string config)
{
string tail(config);
#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"
class GenericBloomFilter
{
public:
- GenericBloomFilter(string config);
+ GenericBloomFilter(std::string config);
~GenericBloomFilter();
void clear();
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;
}
#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,
#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"
class H3BloomFilter : public AbstractBloomFilter
{
public:
- H3BloomFilter(string config);
+ H3BloomFilter(std::string config);
~H3BloomFilter();
void clear();
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);
#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);
#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"
class LSB_CountingBloomFilter : public AbstractBloomFilter
{
public:
- LSB_CountingBloomFilter(string config);
+ LSB_CountingBloomFilter(std::string config);
~LSB_CountingBloomFilter();
void clear();
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);
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/filters/MultiBitSelBloomFilter.hh"
+using namespace std;
+
MultiBitSelBloomFilter::MultiBitSelBloomFilter(string str)
{
string tail(str);
#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"
class MultiBitSelBloomFilter : public AbstractBloomFilter
{
public:
- MultiBitSelBloomFilter(string config);
+ MultiBitSelBloomFilter(std::string config);
~MultiBitSelBloomFilter();
void clear();
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);
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/filters/MultiGrainBloomFilter.hh"
+using namespace std;
+
MultiGrainBloomFilter::MultiGrainBloomFilter(string str)
{
string tail(str);
#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"
class MultiGrainBloomFilter : public AbstractBloomFilter
{
public:
- MultiGrainBloomFilter(string str);
+ MultiGrainBloomFilter(std::string str);
~MultiGrainBloomFilter();
void clear();
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);
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/filters/NonCountingBloomFilter.hh"
+using namespace std;
+
NonCountingBloomFilter::NonCountingBloomFilter(string str)
{
string tail(str);
#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"
class NonCountingBloomFilter : public AbstractBloomFilter
{
public:
- NonCountingBloomFilter(string config);
+ NonCountingBloomFilter(std::string config);
~NonCountingBloomFilter();
void clear();
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
#include "mem/ruby/system/RubyPort.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
string
RubyRequestType_to_string(const RubyRequestType& obj)
{
}
RubyRequestType
-string_to_RubyRequestType(std::string str)
+string_to_RubyRequestType(string str)
{
if (str == "IFETCH")
return RubyRequestType_IFETCH;
}
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++) {
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));
}
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);
}
#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"
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
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;
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;
}
#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_};
#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)
{
#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"
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()
{
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
#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;
#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"
~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()
{
}
}
-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]";
}
#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"
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:
#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"
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;}
#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;
#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"
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);
#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;
#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"
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; }
#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"
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);
#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"
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);
#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"
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);
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;
#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"
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;
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()
#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"
bool isReady();
bool isReadyForNext();
bool isEmpty();
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
bool isFull();
void setMaxSize(int maximum);
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
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 << " ";
#ifndef FLIT_D_H
#define FLIT_D_H
+#include <iostream>
+
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/slicc_interface/Message.hh"
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;
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;
}
MsgPtr m_msg_ptr;
int m_outport;
int src_delay;
- pair<flit_stage, Time> m_stage;
+ std::pair<flit_stage, Time> m_stage;
};
}
}
-// 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
#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)
{
#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"
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]; }
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
}
}
-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]";
}
#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"
}
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*************/
#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"
flit* peekLink();
flit* consumeLink();
- void print(ostream& out) const {}
+ void print(std::ostream& out) const {}
bool is_vc_ready(flit *t_flit);
#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;
#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"
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******************/
#ifndef VC_ARBITER_H
#define VC_ARBITER_H
+#include <iostream>
+
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/common/Consumer.hh"
VCarbiter(Router *router);
~VCarbiter() {}
- void print(ostream& out) const {}
+ void print(std::ostream& out) const {}
void wakeup();
private:
return m_type;
}
-void flit::print(ostream& out) const
+void flit::print(std::ostream& out) const
{
out << "[flit:: ";
out << "Id=" << m_id << " ";
* Authors: Niket Agarwal
*/
+#include <iostream>
+
#include "mem/ruby/network/garnet/NetworkHeader.hh"
#include "mem/ruby/slicc_interface/Message.hh"
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*************/
}
}
-// 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
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;
}
#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"
flit *getTopFlit();
flit *peekTopFlit();
void insert(flit *flt);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
/**********Data Members*********/
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
#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
#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
#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"
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();
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);
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;
}
#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);
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,
#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;
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)
#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"
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
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);
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;
}
#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 :)
void
Topology::printConfig(std::ostream& out) const
{
- using namespace std;
-
if (m_print_config == false)
return;
}
void
-AccessTraceForAddress::print(ostream& out) const
+AccessTraceForAddress::print(std::ostream& out) const
{
out << m_addr;
#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"
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;
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;
}
#include "mem/ruby/profiler/Profiler.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
typedef AddressProfiler::AddressMap AddressMap;
// Helper functions
#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"
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,
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);
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;
}
#include "mem/ruby/profiler/Profiler.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
CacheProfiler::CacheProfiler(const string& description)
{
m_description = description;
#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();
#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"
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);
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);
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;
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;
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;
}
#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
#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"
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;
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;
}
#include "mem/ruby/recorder/CacheRecorder.hh"
#include "mem/ruby/recorder/TraceRecord.hh"
+using namespace std;
+
CacheRecorder::CacheRecorder()
{
m_records_ptr = new PrioHeap<TraceRecord>;
#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)
{
#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"
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;
}
inline std::ostream&
-operator<<(ostream& out, const TraceRecord& obj)
+operator<<(std::ostream& out, const TraceRecord& obj)
{
obj.print(out);
out << std::flush;
#include "mem/ruby/recorder/Tracer.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
Tracer::Tracer(const Params *p)
: SimObject(p)
{
}
void
-Tracer::startTrace(std::string filename)
+Tracer::startTrace(string filename)
{
if (m_enabled)
stopTrace();
}
int
-Tracer::playbackTrace(std::string filename)
+Tracer::playbackTrace(string filename)
{
igzstream in(filename.c_str());
if (in.fail()) {
}
void
-Tracer::print(std::ostream& out) const
+Tracer::print(ostream& out) const
{
}
#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"
// 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;
}
#ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
#define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTCONTROLLER_HH__
-#include "sim/sim_object.hh"
-#include "params/RubyController.hh"
+#include <iostream>
+#include <string>
-#include "mem/ruby/common/Consumer.hh"
#include "mem/protocol/MachineType.hh"
#include "mem/ruby/common/Address.hh"
+#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/network/Network.hh"
+#include "params/RubyController.hh"
+#include "sim/sim_object.hh"
class MessageBuffer;
class Network;
// virtual int getNumberOfControllers() const = 0;
virtual MessageBuffer* getMandatoryQueue() const = 0;
virtual const int & getVersion() const = 0;
- virtual const string toString() const = 0; // returns text version of
- // controller type
- virtual const string getName() const = 0; // return instance name
+ virtual const std::string toString() const = 0; // returns text version of
+ // controller type
+ virtual const std::string getName() const = 0; // return instance name
virtual const MachineType getMachineType() const = 0;
virtual void blockOnQueue(Address, MessageBuffer*) = 0;
virtual void unblock(Address) = 0;
virtual void initNetworkPtr(Network* net_ptr) = 0;
- virtual void print(ostream & out) const = 0;
- virtual void printStats(ostream & out) const = 0;
- virtual void printConfig(ostream & out) const = 0;
+ virtual void print(std::ostream & out) const = 0;
+ virtual void printStats(std::ostream & out) const = 0;
+ virtual void printConfig(std::ostream & out) const = 0;
virtual void wakeup() = 0;
- // virtual void dumpStats(ostream & out) = 0;
+ // virtual void dumpStats(std::ostream & out) = 0;
virtual void clearStats() = 0;
};
#ifndef __MEM_RUBY_SLICC_INTERFACE_ABSTRACTENTRY_HH__
#define __MEM_RUBY_SLICC_INTERFACE_ABSTRACTENTRY_HH__
+#include <iostream>
+
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/protocol/AccessPermission.hh"
// is absolutely necessary and should all be virtual function.
virtual DataBlock& getDataBlk() = 0;
- virtual void print(ostream& out) const = 0;
+ virtual void print(std::ostream& out) const = 0;
};
-inline ostream&
-operator<<(ostream& out, const AbstractEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const AbstractEntry& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
#ifndef __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
#define __MEM_RUBY_SLICC_INTERFACE_NETWORKMESSAGE_HH__
+#include <iostream>
+
#include "mem/gems_common/RefCnt.hh"
#include "mem/gems_common/RefCountable.hh"
#include "mem/protocol/MessageSizeType.hh"
return m_internal_dest;
}
- virtual void print(ostream& out) const = 0;
+ virtual void print(std::ostream& out) const = 0;
private:
NetDest m_internal_dest;
bool m_internal_dest_valid;
};
-inline ostream&
-operator<<(ostream& out, const NetworkMessage& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const NetworkMessage& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
#include "mem/ruby/slicc_interface/RubySlicc_Profiler_interface.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
void
profile_request(int cache_state, Directory_State directory_state,
GenericRequestType request_type)
#ifndef __MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_PROFILER_INTERFACE_HH__
#define __MEM_RUBY_SLICC_INTERFACE_RUBYSLICC_PROFILER_INTERFACE_HH__
+#include <string>
+
#include "mem/protocol/AccessType.hh"
#include "mem/protocol/Directory_State.hh"
#include "mem/protocol/GenericRequestType.hh"
void profile_outstanding_request(int outstanding);
void profile_sharing(const Address& addr, AccessType type, NodeID requestor,
const Set& sharers, const Set& owner);
-void profile_request(const string& L1CacheStateStr,
- const string& L2CacheStateStr,
- const string& directoryStateStr,
- const string& requestTypeStr);
+void profile_request(const std::string& L1CacheStateStr,
+ const std::string& L2CacheStateStr,
+ const std::string& directoryStateStr,
+ const std::string& requestTypeStr);
void profile_miss(const CacheMsg& msg, NodeID id);
void profile_L1Cache_miss(const CacheMsg& msg, NodeID id);
void profile_L2Cache_miss(GenericRequestType requestType, AccessModeType type,
#include "mem/ruby/system/CacheMemory.hh"
+using namespace std;
+
ostream&
operator<<(ostream& out, const CacheMemory& obj)
{
#ifndef __MEM_RUBY_SYSTEM_CACHEMEMORY_HH__
#define __MEM_RUBY_SYSTEM_CACHEMEMORY_HH__
+#include <iostream>
+#include <string>
#include <vector>
#include "base/hashmap.hh"
void init();
// Public Methods
- void printConfig(ostream& out);
+ void printConfig(std::ostream& out);
// perform a cache access and see if we hit or not. Return true on a hit.
bool tryCacheAccess(const Address& address, CacheRequestType type,
void clearLocked (const Address& addr);
bool isLocked (const Address& addr, int context);
// Print cache contents
- void print(ostream& out) const;
- void printData(ostream& out) const;
+ void print(std::ostream& out) const;
+ void printData(std::ostream& out) const;
void clearStats() const;
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
private:
// convert a Address to its location in the cache
CacheMemory& operator=(const CacheMemory& obj);
private:
- const string m_cache_name;
+ const std::string m_cache_name;
int m_latency;
// Data Members (m_prefix)
CacheProfiler* m_profiler_ptr;
int m_cache_size;
- string m_policy;
+ std::string m_policy;
int m_cache_num_sets;
int m_cache_num_set_bits;
int m_cache_assoc;
}
void
-DMASequencer::printConfig(ostream & out)
+DMASequencer::printConfig(std::ostream & out)
{
}
#include "mem/ruby/system/DirectoryMemory.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
int DirectoryMemory::m_num_directories = 0;
int DirectoryMemory::m_num_directories_bits = 0;
uint64_t DirectoryMemory::m_total_size_bytes = 0;
#ifndef __MEM_RUBY_SYSTEM_DIRECTORYMEMORY_HH__
#define __MEM_RUBY_SYSTEM_DIRECTORYMEMORY_HH__
+#include <iostream>
+#include <string>
+
#include "mem/protocol/Directory_Entry.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
bool isSparseImplementation() { return m_use_map; }
uint64 getSize() { return m_size_bytes; }
- void printConfig(ostream& out) const;
- static void printGlobalConfig(ostream & out);
+ void printConfig(std::ostream& out) const;
+ static void printGlobalConfig(std::ostream & out);
bool isPresent(PhysAddress address);
Directory_Entry& lookup(PhysAddress address);
void invalidateBlock(PhysAddress address);
- void print(ostream& out) const;
- void printStats(ostream& out) const;
+ void print(std::ostream& out) const;
+ void printStats(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
DirectoryMemory& operator=(const DirectoryMemory& obj);
private:
- const string m_name;
+ const std::string m_name;
Directory_Entry **m_entries;
// int m_size; // # of memory module blocks this directory is
// responsible for
int m_map_levels;
};
-inline ostream&
-operator<<(ostream& out, const DirectoryMemory& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const DirectoryMemory& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
*
*/
-#include <list>
-
#include "base/cprintf.hh"
#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/system/MemoryControl.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
class Consumer;
// Value to reset watchdog timer to.
#ifndef __MEM_RUBY_SYSTEM_MEMORY_CONTROL_HH__
#define __MEM_RUBY_SYSTEM_MEMORY_CONTROL_HH__
+#include <iostream>
#include <list>
+#include <string>
#include "mem/gems_common/Map.hh"
#include "mem/gems_common/util.hh"
void setConsumer(Consumer* consumer_ptr);
Consumer* getConsumer() { return m_consumer_ptr; };
- void setDescription(const string& name) { m_description = name; };
- string getDescription() { return m_description; };
+ void setDescription(const std::string& name) { m_description = name; };
+ std::string getDescription() { return m_description; };
// Called from the directory:
void enqueue(const MsgPtr& message, int latency );
//// Called from L3 cache:
//void writeBack(physical_address_t addr);
- void printConfig(ostream& out);
- void print(ostream& out) const;
+ void printConfig(std::ostream& out);
+ void print(std::ostream& out) const;
void setDebug(int debugFlag);
void clearStats() const;
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
//added by SS
int getBanksPerRank() { return m_banks_per_rank; };
// data members
Consumer* m_consumer_ptr; // Consumer to signal a wakeup()
- string m_description;
+ std::string m_description;
int m_msg_counter;
int m_awakened;
int m_refresh_period_system;
// queues where memory requests live
- list<MemoryNode> m_response_queue;
- list<MemoryNode> m_input_queue;
- list<MemoryNode>* m_bankQueues;
+ std::list<MemoryNode> m_response_queue;
+ std::list<MemoryNode> m_input_queue;
+ std::list<MemoryNode>* m_bankQueues;
// Each entry indicates number of address-bus cycles until bank
// is reschedulable:
};
template<class ENTRY>
-inline ostream&
-operator<<(ostream& out, const PerfectCacheLineState<ENTRY>& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PerfectCacheLineState<ENTRY>& obj)
{
return out;
}
public:
PerfectCacheMemory();
- static void printConfig(ostream& out);
+ static void printConfig(std::ostream& out);
// perform a cache access and see if we hit or not. Return true
// on a hit.
void changePermission(const Address& address, AccessPermission new_perm);
// Print cache contents
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
};
template<class ENTRY>
-inline ostream&
-operator<<(ostream& out, const PerfectCacheMemory<ENTRY>& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PerfectCacheMemory<ENTRY>& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
template<class ENTRY>
inline void
-PerfectCacheMemory<ENTRY>::printConfig(ostream& out)
+PerfectCacheMemory<ENTRY>::printConfig(std::ostream& out)
{
}
template<class ENTRY>
inline void
-PerfectCacheMemory<ENTRY>::print(ostream& out) const
+PerfectCacheMemory<ENTRY>::print(std::ostream& out) const
{
}
#include "mem/gems_common/util.hh"
#include "mem/ruby/system/PersistentTable.hh"
+using namespace std;
+
// randomize so that handoffs are not locality-aware
#if 0
int persistent_randomize[] = {0, 4, 8, 12, 1, 5, 9, 13, 2, 6,
#ifndef __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__
#define __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__
+#include <iostream>
+
#include "mem/gems_common/Map.hh"
#include "mem/protocol/AccessType.hh"
#include "mem/ruby/common/Address.hh"
class PersistentTableEntry
{
public:
- void print(ostream& out) const {}
+ void print(std::ostream& out) const {}
NetDest m_starving;
NetDest m_marked;
int countStarvingForAddress(const Address& addr) const;
int countReadStarvingForAddress(const Address& addr) const;
- static void printConfig(ostream& out) {}
+ static void printConfig(std::ostream& out) {}
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
Map<Address, PersistentTableEntry>* m_map_ptr;
};
-inline ostream&
-operator<<(ostream& out, const PersistentTable& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PersistentTable& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
-inline ostream&
-operator<<(ostream& out, const PersistentTableEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const PersistentTableEntry& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
#include "mem/tport.hh"
#include "params/RubyPort.hh"
-using namespace std;
-
class MessageBuffer;
class AbstractController;
void setController(AbstractController* _cntrl) { m_controller = _cntrl; }
protected:
- const string m_name;
+ const std::string m_name;
void ruby_hit_callback(PacketPtr pkt);
void hit(PacketPtr pkt);
#include "mem/ruby/system/System.hh"
#include "params/RubySequencer.hh"
+using namespace std;
+
Sequencer *
RubySequencerParams::create()
{
#ifndef __MEM_RUBY_SYSTEM_SEQUENCER_HH__
#define __MEM_RUBY_SYSTEM_SEQUENCER_HH__
+#include <iostream>
+
#include "mem/gems_common/Map.hh"
#include "mem/protocol/AccessModeType.hh"
#include "mem/protocol/CacheRequestType.hh"
// Public Methods
void wakeup(); // Used only for deadlock detection
- void printConfig(ostream& out) const;
+ void printConfig(std::ostream& out) const;
- void printProgress(ostream& out) const;
+ void printProgress(std::ostream& out) const;
void writeCallback(const Address& address, DataBlock& data);
void readCallback(const Address& address, DataBlock& data);
RequestStatus getRequestStatus(const RubyRequest& request);
bool empty() const;
- void print(ostream& out) const;
- void printStats(ostream & out) const;
+ void print(std::ostream& out) const;
+ void printStats(std::ostream& out) const;
void checkCoherence(const Address& address);
void removeRequest(SequencerRequest* request);
SequencerWakeupEvent deadlockCheckEvent;
};
-inline ostream&
-operator<<(ostream& out, const Sequencer& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Sequencer& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
#include "mem/ruby/system/SparseMemory.hh"
+using namespace std;
+
SparseMemory::SparseMemory(int number_of_bits, int number_of_levels)
{
int even_level_bits;
#ifndef __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__
#define __MEM_RUBY_SYSTEM_SPARSEMEMORY_HH__
+#include <iostream>
+
#include "base/hashmap.hh"
#include "mem/protocol/Directory_Entry.hh"
#include "mem/ruby/common/Address.hh"
SparseMemory(int number_of_bits, int number_of_levels);
~SparseMemory();
- void printConfig(ostream& out) { }
+ void printConfig(std::ostream& out) { }
bool exist(const Address& address) const;
void add(const Address& address);
Directory_Entry* lookup(const Address& address);
// Print cache contents
- void print(ostream& out) const;
- void printStats(ostream& out) const;
+ void print(std::ostream& out) const;
+ void printStats(std::ostream& out) const;
private:
// Private Methods
uint64_t* m_removes_per_level;
};
-inline ostream&
-operator<<(ostream& out, const SparseMemEntry& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const SparseMemEntry& obj)
{
out << "SparseMemEntry";
- out << flush;
+ out << std::flush;
return out;
}
#include "mem/ruby/system/MemoryVector.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
int RubySystem::m_random_seed;
bool RubySystem::m_randomization;
Tick RubySystem::m_clock;
}
void recordCacheContents(CacheRecorder& tr) const;
- static void printConfig(ostream& out);
- static void printStats(ostream& out);
+ static void printConfig(std::ostream& out);
+ static void printStats(std::ostream& out);
void clearStats() const;
uint64 getInstructionCount(int thread) { return 1; }
return g_eventQueue_ptr->getTime();
}
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
void init();
- static void printSystemConfig(ostream& out);
+ static void printSystemConfig(std::ostream& out);
private:
// configuration parameters
static MemoryVector* m_mem_vec_ptr;
};
-inline ostream&
-operator<<(ostream& out, const RubySystem& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const RubySystem& obj)
{
//obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
class RubyExitCallback : public Callback
{
private:
- string stats_filename;
+ std::string stats_filename;
public:
virtual ~RubyExitCallback() {}
- RubyExitCallback(const string& _stats_filename)
+ RubyExitCallback(const std::string& _stats_filename)
{
stats_filename = _stats_filename;
}
#ifndef __MEM_RUBY_SYSTEM_TBETABLE_HH__
#define __MEM_RUBY_SYSTEM_TBETABLE_HH__
+#include <iostream>
+
#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Global.hh"
}
void
- printConfig(ostream& out)
+ printConfig(std::ostream& out)
{
- out << "TBEs_per_TBETable: " << m_number_of_TBEs << endl;
+ out << "TBEs_per_TBETable: " << m_number_of_TBEs << std::endl;
}
bool isPresent(const Address& address) const;
const ENTRY& lookup(const Address& address) const;
// Print cache contents
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private copy constructor and assignment operator
};
template<class ENTRY>
-inline ostream&
-operator<<(ostream& out, const TBETable<ENTRY>& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const TBETable<ENTRY>& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
template<class ENTRY>
inline void
-TBETable<ENTRY>::print(ostream& out) const
+TBETable<ENTRY>::print(std::ostream& out) const
{
}
}
void
-TimerTable::print(ostream& out) const
+TimerTable::print(std::ostream& out) const
{
}
#define __MEM_RUBY_SYSTEM_TIMERTABLE_HH__
#include <cassert>
+#include <iostream>
+#include <string>
#include "mem/gems_common/Map.hh"
#include "mem/ruby/common/Address.hh"
public:
TimerTable();
- static void printConfig(ostream& out) {}
+ static void printConfig(std::ostream& out) {}
void
setConsumer(Consumer* consumer_ptr)
}
void
- setDescription(const string& name)
+ setDescription(const std::string& name)
{
m_name = name;
}
bool isSet(const Address& address) const { return m_map.exist(address); }
void set(const Address& address, Time relative_latency);
void unset(const Address& address);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
void updateNext() const;
mutable Time m_next_time; // Only valid if m_next_valid is true
mutable Address m_next_address; // Only valid if m_next_valid is true
Consumer* m_consumer_ptr; // Consumer to signal a wakeup()
- string m_name;
+ std::string m_name;
};
-// ******************* Definitions *******************
-
-// Output operator definition
-inline ostream&
-operator<<(ostream& out, const TimerTable& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const TimerTable& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
pairs = { "external" : "yes" }
func = Func(self.symtab, func_id, self.location,
- self.symtab.find("string", Type), [ t ], [], "",
+ self.symtab.find("std::string", Type), [ t ], [], "",
pairs, None)
self.symtab.newSymbol(func)
def generate(self, code):
fix = code.nofix()
- if self.type == "string":
+ if self.type == "std::string":
code('("${{self.literal}}")')
elif self.type == "bool":
code('(${{str(self.literal).lower()}})')
"types : empty"
p[0] = []
- def p_type(self, p):
- "type : ident"
+ def p_typestr__multi(self, p):
+ "typestr : typestr DOUBLE_COLON ident"
+ p[0] = '%s::%s' % (p[1], p[3])
+
+ def p_typestr__single(self, p):
+ "typestr : ident"
+ p[0] = p[1]
+
+ def p_type__one(self, p):
+ "type : typestr"
p[0] = ast.TypeAST(self, p[1])
def p_void(self, p):
def p_literal__string(self, p):
"literal : STRING"
- p[0] = ast.LiteralExprAST(self, p[1], "string")
+ p[0] = ast.LiteralExprAST(self, p[1], "std::string")
def p_literal__number(self, p):
"literal : NUMBER"
if self.isInternalMachineFunc:
code('#include "mem/protocol/${{self.machineStr}}_Controller.hh"')
+ code('using namespace std;')
# Generate function header
void_type = self.symtab.find("void", Type)
return_type = self.return_type.c_ident
import slicc.generate.html as html
python_class_map = {"int": "Int",
- "string": "String",
+ "std::string": "String",
"bool": "Bool",
"CacheMemory": "RubyCache",
"Sequencer": "RubySequencer",
int m_transitions_per_cycle;
int m_buffer_size;
int m_recycle_latency;
-map<std::string, std::string> m_cfg;
+std::map<std::string, std::string> m_cfg;
NodeID m_version;
Network* m_net_ptr;
MachineID m_machineID;
bool m_is_blocking;
-map< Address, MessageBuffer* > m_block_map;
+std::map<Address, MessageBuffer*> m_block_map;
${ident}_Profiler s_profiler;
static int m_num_controllers;
#include "mem/protocol/Types.hh"
#include "mem/ruby/system/System.hh"
+using namespace std;
+
void
${ident}_Controller::wakeup()
{
code('};')
code('''
-// Output operator declaration
-std::ostream&
-operator<<(std::ostream& out, const ${{self.c_ident}}& obj);
-
-// Output operator definition
-extern inline std::ostream&
+inline std::ostream&
operator<<(std::ostream& out, const ${{self.c_ident}}& obj)
{
obj.print(out);