#include "cpu/timebuf.hh"
#include "debug/Activity.hh"
-using namespace std;
-
-ActivityRecorder::ActivityRecorder(const string &name, int num_stages,
+ActivityRecorder::ActivityRecorder(const std::string &name, int num_stages,
int longest_latency, int activity)
: _name(name), activityBuffer(longest_latency, 0),
longestLatency(longest_latency), activityCount(activity),
// Hack
#include "sim/stat_control.hh"
-using namespace std;
-
std::unique_ptr<BaseCPU::GlobalStats> BaseCPU::globalStats;
-vector<BaseCPU *> BaseCPU::cpuList;
+std::vector<BaseCPU *> BaseCPU::cpuList;
// This variable reflects the max number of threads in any CPU. Be
// careful to only use it once all the CPUs that you care about have
functionTracingEnabled = false;
if (p.function_trace) {
- const string fname = csprintf("ftrace.%s", name());
+ const std::string fname = csprintf("ftrace.%s", name());
functionTraceStream = simout.findOrCreate(fname)->stream();
currentFunctionStart = currentFunctionEnd = 0;
int size = threadContexts.size();
if (size > 1) {
for (int i = 0; i < size; ++i) {
- stringstream namestr;
+ std::stringstream namestr;
ccprintf(namestr, "%s.ctx%d", name(), i);
threadContexts[i]->regStats(namestr.str());
}
}
Port &
-BaseCPU::getPort(const string &if_name, PortID idx)
+BaseCPU::getPort(const std::string &if_name, PortID idx)
{
// Get the right port based on name. This applies to all the
// subclasses of the base CPU and relies on their implementation
auto it = Loader::debugSymbolTable.findNearest(
pc, currentFunctionEnd);
- string sym_str;
+ std::string sym_str;
if (it == Loader::debugSymbolTable.end()) {
// no symbol found: use addr as label
sym_str = csprintf("%#x", pc);
#include "params/CheckerCPU.hh"
#include "sim/full_system.hh"
-using namespace std;
using namespace TheISA;
void
}
void
-CheckerCPU::serialize(ostream &os) const
+CheckerCPU::serialize(std::ostream &os) const
{
}
#include "sim/sim_object.hh"
#include "sim/stats.hh"
-using namespace std;
using namespace TheISA;
template <class Impl>
#include "debug/FmtTicksOff.hh"
#include "enums/OpClass.hh"
-using namespace std;
using namespace TheISA;
namespace Trace {
}
if (Debug::ExecAsid)
- outs << "A" << dec << TheISA::getExecutingAsid(thread) << " ";
+ outs << "A" << std::dec << TheISA::getExecutingAsid(thread) << " ";
if (Debug::ExecThread)
outs << "T" << thread->threadId() << " : ";
// Print decoded instruction
//
- outs << setw(26) << left;
+ outs << std::setw(26) << std::left;
outs << inst->disassemble(cur_pc, &Loader::debugSymbolTable);
if (ran) {
}
if (Debug::ExecEffAddr && getMemValid())
- outs << " A=0x" << hex << addr;
+ outs << " A=0x" << std::hex << addr;
if (Debug::ExecFetchSeq && fetch_seq_valid)
- outs << " FetchSeq=" << dec << fetch_seq;
+ outs << " FetchSeq=" << std::dec << fetch_seq;
if (Debug::ExecCPSeq && cp_seq_valid)
- outs << " CPSeq=" << dec << cp_seq;
+ outs << " CPSeq=" << std::dec << cp_seq;
if (Debug::ExecFlags) {
outs << " flags=(";
//
// End of line...
//
- outs << endl;
+ outs << std::endl;
Trace::getDebugLogger()->dprintf_flag(
when, thread->getCpuPtr()->name(), "ExecEnable", "%s",
#include "base/logging.hh"
-using namespace std;
-
-
////////////////////////////////////////////////////////////////////////////
//
// The funciton unit
return capabilityList[capability];
}
-bitset<Num_OpClasses>
+std::bitset<Num_OpClasses>
FuncUnit::capabilities()
{
return capabilityList;
#include "cpu/exetrace.hh"
#include "cpu/static_inst.hh"
-using namespace std;
using namespace TheISA;
namespace Trace {
void
Trace::IntelTraceRecord::dump()
{
- ostream &outs = Trace::output();
+ std::ostream &outs = Trace::output();
ccprintf(outs, "%7d ) ", when);
- outs << "0x" << hex << pc.instAddr() << ":\t";
+ outs << "0x" << std::hex << pc.instAddr() << ":\t";
if (staticInst->isLoad()) {
ccprintf(outs, "<RD %#x>", addr);
} else if (staticInst->isStore()) {
ccprintf(outs, "<WR %#x>", addr);
}
- outs << endl;
+ outs << std::endl;
}
} // namespace Trace
#include "debug/IntrControl.hh"
#include "sim/sim_object.hh"
-using namespace std;
-
IntrControl::IntrControl(const Params &p)
: SimObject(p), sys(p.sys)
{}
#include "cpu/intr_control.hh"
-using namespace std;
-
IntrControl::IntrControl(const Params &p)
: SimObject(p), sys(p.sys)
{}
#include "debug/GDBMisc.hh"
#include "params/NativeTrace.hh"
-using namespace std;
-
namespace Trace {
NativeTrace::NativeTrace(const Params &p)
DPRINTF(GDBMisc, "Can't bind port %d\n", port);
port++;
}
- ccprintf(cerr, "Listening for native process on port %d\n", port);
+ ccprintf(std::cerr, "Listening for native process on port %d\n", port);
fd = native_listener.accept();
}
#include "sim/faults.hh"
#include "sim/full_system.hh"
-using namespace std;
-
template <class Impl>
void
DefaultCommit<Impl>::processTrapEvent(ThreadID tid)
template<class Impl>
void
-DefaultCommit<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
+DefaultCommit<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
}
void
DefaultCommit<Impl>::deactivateThread(ThreadID tid)
{
- list<ThreadID>::iterator thread_it = std::find(priority_list.begin(),
+ std::list<ThreadID>::iterator thread_it = std::find(priority_list.begin(),
priority_list.end(), tid);
if (thread_it != priority_list.end()) {
DefaultCommit<Impl>::updateStatus()
{
// reset ROB changed variable
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
DefaultCommit<Impl>::changedROBEntries()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
[this, tid]{ processTrapEvent(tid); },
"Trap", true, Event::CPU_Tick_Pri);
- Cycles latency = dynamic_pointer_cast<SyscallRetryFault>(inst_fault) ?
+ Cycles latency = std::dynamic_pointer_cast<SyscallRetryFault>(inst_fault) ?
cpu->syscallRetryLatency : trapLatency;
// hardware transactional memory
if (activeThreads->empty())
return;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
// Check if any of the threads are done squashing. Change the
// status if they are done.
////////////////////////////////////
// Check for any possible squashes, handle them first
////////////////////////////////////
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
int num_squashing_threads = 0;
ThreadID
DefaultCommit<Impl>::roundRobin()
{
- list<ThreadID>::iterator pri_iter = priority_list.begin();
- list<ThreadID>::iterator end = priority_list.end();
+ std::list<ThreadID>::iterator pri_iter = priority_list.begin();
+ std::list<ThreadID>::iterator end = priority_list.end();
while (pri_iter != end) {
ThreadID tid = *pri_iter;
unsigned oldest = 0;
bool first = true;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
struct BaseCPUParams;
using namespace TheISA;
-using namespace std;
BaseO3CPU::BaseO3CPU(const BaseCPUParams ¶ms)
: BaseCPU(params)
void
FullO3CPU<Impl>::activateThread(ThreadID tid)
{
- list<ThreadID>::iterator isActive =
+ std::list<ThreadID>::iterator isActive =
std::find(activeThreads.begin(), activeThreads.end(), tid);
DPRINTF(O3CPU, "[tid:%i] Calling activate thread.\n", tid);
assert(!commit.executingHtmTransaction(tid));
//Remove From Active List, if Active
- list<ThreadID>::iterator thread_it =
+ std::list<ThreadID>::iterator thread_it =
std::find(activeThreads.begin(), activeThreads.end(), tid);
DPRINTF(O3CPU, "[tid:%i] Calling deactivate thread.\n", tid);
if (activeThreads.size() > 1) {
//DEFAULT TO ROUND ROBIN SCHEME
//e.g. Move highest priority to end of thread list
- list<ThreadID>::iterator list_begin = activeThreads.begin();
+ std::list<ThreadID>::iterator list_begin = activeThreads.begin();
unsigned high_thread = *list_begin;
#include "sim/system.hh"
#include "cpu/o3/isa_specific.hh"
-using namespace std;
-
template<class Impl>
DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, const DerivO3CPUParams ¶ms)
: fetchPolicy(params.smtFetchPolicy),
DefaultFetch<Impl>::updateFetchStatus()
{
//Check Running
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
void
DefaultFetch<Impl>::tick()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
bool status_change = false;
wroteToTimeBuffer = false;
return InvalidThreadID;
}
} else {
- list<ThreadID>::iterator thread = activeThreads->begin();
+ std::list<ThreadID>::iterator thread = activeThreads->begin();
if (thread == activeThreads->end()) {
return InvalidThreadID;
}
ThreadID
DefaultFetch<Impl>::roundRobin()
{
- list<ThreadID>::iterator pri_iter = priorityList.begin();
- list<ThreadID>::iterator end = priorityList.end();
+ std::list<ThreadID>::iterator pri_iter = priorityList.begin();
+ std::list<ThreadID>::iterator end = priorityList.end();
ThreadID high_pri;
DefaultFetch<Impl>::iqCount()
{
//sorted from lowest->highest
- std::priority_queue<unsigned,vector<unsigned>,
+ std::priority_queue<unsigned, std::vector<unsigned>,
std::greater<unsigned> > PQ;
std::map<unsigned, ThreadID> threadMap;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
DefaultFetch<Impl>::lsqCount()
{
//sorted from lowest->highest
- std::priority_queue<unsigned,vector<unsigned>,
+ std::priority_queue<unsigned, std::vector<unsigned>,
std::greater<unsigned> > PQ;
std::map<unsigned, ThreadID> threadMap;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
#include "cpu/func_unit.hh"
-using namespace std;
-
////////////////////////////////////////////////////////////////////////////
//
// A pool of function units
//
// Iterate through the list of FUDescData structures
//
- const vector<FUDesc *> ¶mList = p.FUList;
+ const std::vector<FUDesc *> ¶mList = p.FUList;
for (FUDDiterator i = paramList.begin(); i != paramList.end(); ++i) {
//
funcUnits.push_back(fu);
for (int c = 1; c < (*i)->number; ++c) {
- ostringstream s;
+ std::ostringstream s;
numFU++;
FuncUnit *fu2 = new FuncUnit(*fu);
void
FUPool::dump()
{
- cout << "Function Unit Pool (" << name() << ")\n";
- cout << "======================================\n";
- cout << "Free List:\n";
+ std::cout << "Function Unit Pool (" << name() << ")\n";
+ std::cout << "======================================\n";
+ std::cout << "Free List:\n";
for (int i = 0; i < numFU; ++i) {
if (unitBusy[i]) {
continue;
}
- cout << " [" << i << "] : ";
+ std::cout << " [" << i << "] : ";
- cout << funcUnits[i]->name << " ";
+ std::cout << funcUnits[i]->name << " ";
- cout << "\n";
+ std::cout << "\n";
}
- cout << "======================================\n";
- cout << "Busy List:\n";
+ std::cout << "======================================\n";
+ std::cout << "Busy List:\n";
for (int i = 0; i < numFU; ++i) {
if (!unitBusy[i]) {
continue;
}
- cout << " [" << i << "] : ";
+ std::cout << " [" << i << "] : ";
- cout << funcUnits[i]->name << " ";
+ std::cout << funcUnits[i]->name << " ";
- cout << "\n";
+ std::cout << "\n";
}
}
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
-using namespace std;
-
template<class Impl>
DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, const DerivO3CPUParams ¶ms)
: issueToExecQueue(params.backComSize, params.forwardComSize),
template<class Impl>
void
-DefaultIEW<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
+DefaultIEW<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
{
int max=0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
DefaultIEW<Impl>::skidsEmpty()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
bool any_unblocking = false;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
wbNumInst = 0;
wbCycle = 0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
// Free function units marked as being freed this cycle.
fuPool->processFreeUnits();
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
// Check stall and squash signals, dispatch any instructions.
while (threads != end) {
#include "debug/Writeback.hh"
#include "params/DerivO3CPU.hh"
-using namespace std;
-
template <class Impl>
LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, const DerivO3CPUParams ¶ms)
: cpu(cpu_ptr), iewStage(iew_ptr),
template<class Impl>
void
-LSQ<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
+LSQ<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
assert(activeThreads != 0);
void
LSQ<Impl>::writebackStores()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
LSQ<Impl>::violation()
{
/* Answers: Does Anybody Have a Violation?*/
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
unsigned total = 0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
unsigned total = 0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
unsigned total = 0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
unsigned total = 0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
unsigned total = 0;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::isFull()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::lqEmpty() const
{
- list<ThreadID>::const_iterator threads = activeThreads->begin();
- list<ThreadID>::const_iterator end = activeThreads->end();
+ std::list<ThreadID>::const_iterator threads = activeThreads->begin();
+ std::list<ThreadID>::const_iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::sqEmpty() const
{
- list<ThreadID>::const_iterator threads = activeThreads->begin();
- list<ThreadID>::const_iterator end = activeThreads->end();
+ std::list<ThreadID>::const_iterator threads = activeThreads->begin();
+ std::list<ThreadID>::const_iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::lqFull()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::sqFull()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::isStalled()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::hasStoresToWB()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool
LSQ<Impl>::willWB()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
void
LSQ<Impl>::dumpInsts() const
{
- list<ThreadID>::const_iterator threads = activeThreads->begin();
- list<ThreadID>::const_iterator end = activeThreads->end();
+ std::list<ThreadID>::const_iterator threads = activeThreads->begin();
+ std::list<ThreadID>::const_iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
-using namespace std;
-
template <class Impl>
DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, const DerivO3CPUParams ¶ms)
: cpu(_cpu),
template<class Impl>
void
-DefaultRename<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
+DefaultRename<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
}
sortInsts();
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
// Check stall and squash signals.
while (threads != end) {
bool
DefaultRename<Impl>::skidsEmpty()
{
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
{
bool any_unblocking = false;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
#include "cpu/reg_class.hh"
#include "debug/Rename.hh"
-using namespace std;
-
/**** SimpleRenameMap methods ****/
SimpleRenameMap::SimpleRenameMap()
#include "debug/ROB.hh"
#include "params/DerivO3CPU.hh"
-using namespace std;
-
template <class Impl>
ROB<Impl>::ROB(O3CPU *_cpu, const DerivO3CPUParams ¶ms)
: robPolicy(params.smtROBPolicy),
template <class Impl>
void
-ROB<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
+ROB<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
DPRINTF(ROB, "Setting active threads list pointer.\n");
activeThreads = at_ptr;
if (robPolicy != SMTQueuePolicy::Dynamic || numThreads > 1) {
auto active_threads = activeThreads->size();
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
ROB<Impl>::canCommit()
{
//@todo: set ActiveThreads through ROB or CPU
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
bool first_valid = true;
// @todo: set ActiveThreads through ROB or CPU
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
tail = instList[0].end();
bool first_valid = true;
- list<ThreadID>::iterator threads = activeThreads->begin();
- list<ThreadID>::iterator end = activeThreads->end();
+ std::list<ThreadID>::iterator threads = activeThreads->begin();
+ std::list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
#include "sim/core.hh"
#include "sim/system.hh"
-using namespace std;
-
PCEventQueue::PCEventQueue()
{}
PCEventQueue::schedule(PCEvent *event)
{
pcMap.push_back(event);
- sort(pcMap.begin(), pcMap.end(), MapCompare());
+ std::sort(pcMap.begin(), pcMap.end(), MapCompare());
DPRINTF(PCEvent, "PC based event scheduled for %#x: %s\n",
event->pc(), event->descr());
#include "sim/full_system.hh"
#include "sim/system.hh"
-using namespace std;
using namespace TheISA;
void
}
if (fault != NoFault &&
- dynamic_pointer_cast<SyscallRetryFault>(fault)) {
+ std::dynamic_pointer_cast<SyscallRetryFault>(fault)) {
// Retry execution of system calls after a delay.
// Prevents immediate re-execution since conditions which
// caused the retry are unlikely to change every tick.
{
BaseCPU::regProbePoints();
- ppCommit = new ProbePointArg<pair<SimpleThread*, const StaticInstPtr>>
+ ppCommit = new ProbePointArg<std::pair<SimpleThread*, const StaticInstPtr>>
(getProbeManager(), "Commit");
}
#include "sim/stats.hh"
#include "sim/system.hh"
-using namespace std;
using namespace TheISA;
BaseSimpleCPU::BaseSimpleCPU(const BaseSimpleCPUParams &p)
#include "sim/full_system.hh"
#include "sim/system.hh"
-using namespace std;
using namespace TheISA;
void
if (traceData)
traceData->setMem(addr, size, flags);
- RequestPtr req = make_shared<Request>(addr, size, flags,
+ RequestPtr req = std::make_shared<Request>(addr, size, flags,
dataRequestorId(), pc, thread->contextId(),
std::move(amo_op));
if (_status != Idle) {
DPRINTF(SimpleCPU, "Scheduling fetch event after the Fault\n");
- Tick stall = dynamic_pointer_cast<SyscallRetryFault>(fault) ?
+ Tick stall = std::dynamic_pointer_cast<SyscallRetryFault>(fault) ?
clockEdge(syscallRetryLatency) : clockEdge();
reschedule(fetchEvent, stall, true);
_status = Faulting;
#include "sim/sim_exit.hh"
#include "sim/system.hh"
-using namespace std;
-
// constructor
SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
Process *_process, BaseMMU *_mmu,
StaticInstPtr StaticInst::nullStaticInstPtr;
StaticInstPtr StaticInst::nopStaticInstPtr = new NopStaticInst;
-using namespace std;
-
StaticInst::~StaticInst()
{
if (cachedDisassembly)
"that is not an indirect branch.");
}
-const string &
+const std::string &
StaticInst::disassemble(Addr pc, const Loader::SymbolTable *symtab) const
{
if (!cachedDisassembly)
- cachedDisassembly = new string(generateDisassembly(pc, symtab));
+ cachedDisassembly = new std::string(generateDisassembly(pc, symtab));
return *cachedDisassembly;
}
#include "sim/stats.hh"
#include "sim/system.hh"
-using namespace std;
-
int TESTER_NETWORK=0;
bool
#include "sim/stats.hh"
#include "sim/system.hh"
-using namespace std;
-
unsigned int TESTER_ALLOCATOR = 0;
bool
stats.numReads++;
if (numReads == (uint64_t)nextProgressMessage) {
- ccprintf(cerr, "%s: completed %d read, %d write accesses @%d\n",
- name(), numReads, numWrites, curTick());
+ ccprintf(std::cerr,
+ "%s: completed %d read, %d write accesses @%d\n",
+ name(), numReads, numWrites, curTick());
nextProgressMessage += progressInterval;
}
#endif
-using namespace std;
-
BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams &p)
: ClockedObject(p),
system(p.system),
}
Port &
-BaseTrafficGen::getPort(const string &if_name, PortID idx)
+BaseTrafficGen::getPort(const std::string &if_name, PortID idx)
{
if (if_name == "port") {
return port;
#include "debug/TrafficGen.hh"
#include "enums/AddrMap.hh"
-using namespace std;
-
HybridGen::HybridGen(SimObject &obj,
RequestorID requestor_id, Tick _duration,
Addr start_addr_dram, Addr end_addr_dram,
#include "sim/stats.hh"
#include "sim/system.hh"
-using namespace std;
-
TrafficGen::TrafficGen(const TrafficGenParams &p)
: BaseTrafficGen(p),
configFile(p.config_file),
{
// keep track of the transitions parsed to create the matrix when
// done
- vector<Transition> transitions;
+ std::vector<Transition> transitions;
// open input file
- ifstream infile;
- infile.open(configFile.c_str(), ifstream::in);
+ std::ifstream infile;
+ infile.open(configFile.c_str(), std::ifstream::in);
if (!infile.is_open()) {
fatal("Traffic generator %s config file not found at %s\n",
name(), configFile);
// read line by line and determine the action based on the first
// keyword
- string keyword;
- string line;
+ std::string keyword;
+ std::string line;
while (getline(infile, line).good()) {
// see if this line is a comment line, and if so skip it
if (line.find('#') != 1) {
// create an input stream for the tokenization
- istringstream is(line);
+ std::istringstream is(line);
// determine the keyword
is >> keyword;
// parse the behaviour of this state
uint32_t id;
Tick duration;
- string mode;
+ std::string mode;
is >> id >> duration >> mode;
if (mode == "TRACE") {
- string traceFile;
+ std::string traceFile;
Addr addrOffset;
is >> traceFile >> addrOffset;
transitionMatrix[i].resize(states.size());
}
- for (vector<Transition>::iterator t = transitions.begin();
+ for (std::vector<Transition>::iterator t = transitions.begin();
t != transitions.end(); ++t) {
transitionMatrix[t->from][t->to] = t->p;
}