cpu: Stop "using namespace std"

Change-Id: I1b648914d353672076d903ed581aa61cdd7c1d0f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39562
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-01-21 04:40:10 -08:00
parent d3a4662a14
commit 2343ee2705
30 changed files with 142 additions and 194 deletions

View File

@@ -33,9 +33,7 @@
#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),

View File

@@ -71,11 +71,9 @@
// 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
@@ -156,7 +154,7 @@ BaseCPU::BaseCPU(const Params &p, bool is_checker)
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;
@@ -395,7 +393,7 @@ BaseCPU::regStats()
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());
}
@@ -404,7 +402,7 @@ BaseCPU::regStats()
}
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
@@ -708,7 +706,7 @@ BaseCPU::traceFunctionsInternal(Addr pc)
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);

View File

@@ -52,7 +52,6 @@
#include "params/CheckerCPU.hh"
#include "sim/full_system.hh"
using namespace std;
using namespace TheISA;
void
@@ -124,7 +123,7 @@ CheckerCPU::setDcachePort(RequestPort *dcache_port)
}
void
CheckerCPU::serialize(ostream &os) const
CheckerCPU::serialize(std::ostream &os) const
{
}

View File

@@ -59,7 +59,6 @@
#include "sim/sim_object.hh"
#include "sim/stats.hh"
using namespace std;
using namespace TheISA;
template <class Impl>

View File

@@ -53,7 +53,6 @@
#include "debug/FmtTicksOff.hh"
#include "enums/OpClass.hh"
using namespace std;
using namespace TheISA;
namespace Trace {
@@ -70,7 +69,7 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
}
if (Debug::ExecAsid)
outs << "A" << dec << TheISA::getExecutingAsid(thread) << " ";
outs << "A" << std::dec << TheISA::getExecutingAsid(thread) << " ";
if (Debug::ExecThread)
outs << "T" << thread->threadId() << " : ";
@@ -100,7 +99,7 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
// Print decoded instruction
//
outs << setw(26) << left;
outs << std::setw(26) << std::left;
outs << inst->disassemble(cur_pc, &Loader::debugSymbolTable);
if (ran) {
@@ -150,13 +149,13 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool 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=(";
@@ -168,7 +167,7 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
//
// End of line...
//
outs << endl;
outs << std::endl;
Trace::getDebugLogger()->dprintf_flag(
when, thread->getCpuPtr()->name(), "ExecEnable", "%s",

View File

@@ -32,9 +32,6 @@
#include "base/logging.hh"
using namespace std;
////////////////////////////////////////////////////////////////////////////
//
// The funciton unit
@@ -78,7 +75,7 @@ FuncUnit::provides(OpClass capability)
return capabilityList[capability];
}
bitset<Num_OpClasses>
std::bitset<Num_OpClasses>
FuncUnit::capabilities()
{
return capabilityList;

View File

@@ -34,7 +34,6 @@
#include "cpu/exetrace.hh"
#include "cpu/static_inst.hh"
using namespace std;
using namespace TheISA;
namespace Trace {
@@ -42,15 +41,15 @@ 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

View File

@@ -37,8 +37,6 @@
#include "debug/IntrControl.hh"
#include "sim/sim_object.hh"
using namespace std;
IntrControl::IntrControl(const Params &p)
: SimObject(p), sys(p.sys)
{}

View File

@@ -28,8 +28,6 @@
#include "cpu/intr_control.hh"
using namespace std;
IntrControl::IntrControl(const Params &p)
: SimObject(p), sys(p.sys)
{}

View File

@@ -33,8 +33,6 @@
#include "debug/GDBMisc.hh"
#include "params/NativeTrace.hh"
using namespace std;
namespace Trace {
NativeTrace::NativeTrace(const Params &p)
@@ -49,7 +47,7 @@ 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();
}

View File

@@ -66,8 +66,6 @@
#include "sim/faults.hh"
#include "sim/full_system.hh"
using namespace std;
template <class Impl>
void
DefaultCommit<Impl>::processTrapEvent(ThreadID tid)
@@ -292,7 +290,7 @@ DefaultCommit<Impl>::setIEWStage(IEW *iew_stage)
template<class Impl>
void
DefaultCommit<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
DefaultCommit<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
}
@@ -428,7 +426,7 @@ template <class Impl>
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()) {
@@ -463,8 +461,8 @@ void
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++;
@@ -493,8 +491,8 @@ template <class Impl>
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++;
@@ -524,7 +522,7 @@ DefaultCommit<Impl>::generateTrapEvent(ThreadID tid, Fault inst_fault)
[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
@@ -661,8 +659,8 @@ DefaultCommit<Impl>::tick()
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.
@@ -822,8 +820,8 @@ DefaultCommit<Impl>::commit()
////////////////////////////////////
// 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;
@@ -1528,8 +1526,8 @@ template<class Impl>
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;
@@ -1559,8 +1557,8 @@ DefaultCommit<Impl>::oldestReady()
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++;

View File

@@ -65,7 +65,6 @@
struct BaseCPUParams;
using namespace TheISA;
using namespace std;
BaseO3CPU::BaseO3CPU(const BaseCPUParams &params)
: BaseCPU(params)
@@ -581,7 +580,7 @@ template <class Impl>
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);
@@ -604,7 +603,7 @@ FullO3CPU<Impl>::deactivateThread(ThreadID 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);
@@ -1722,7 +1721,7 @@ FullO3CPU<Impl>::updateThreadPriority()
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;

View File

@@ -71,8 +71,6 @@
#include "sim/system.hh"
#include "cpu/o3/isa_specific.hh"
using namespace std;
template<class Impl>
DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, const DerivO3CPUParams &params)
: fetchPolicy(params.smtFetchPolicy),
@@ -804,8 +802,8 @@ typename DefaultFetch<Impl>::FetchStatus
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++;
@@ -857,8 +855,8 @@ template <class Impl>
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;
@@ -1423,7 +1421,7 @@ DefaultFetch<Impl>::getFetchingThread()
return InvalidThreadID;
}
} else {
list<ThreadID>::iterator thread = activeThreads->begin();
std::list<ThreadID>::iterator thread = activeThreads->begin();
if (thread == activeThreads->end()) {
return InvalidThreadID;
}
@@ -1445,8 +1443,8 @@ template<class Impl>
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;
@@ -1476,12 +1474,12 @@ ThreadID
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++;
@@ -1513,12 +1511,12 @@ ThreadID
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++;

View File

@@ -44,8 +44,6 @@
#include "cpu/func_unit.hh"
using namespace std;
////////////////////////////////////////////////////////////////////////////
//
// A pool of function units
@@ -92,7 +90,7 @@ FUPool::FUPool(const Params &p)
//
// Iterate through the list of FUDescData structures
//
const vector<FUDesc *> &paramList = p.FUList;
const std::vector<FUDesc *> &paramList = p.FUList;
for (FUDDiterator i = paramList.begin(); i != paramList.end(); ++i) {
//
@@ -136,7 +134,7 @@ FUPool::FUPool(const Params &p)
funcUnits.push_back(fu);
for (int c = 1; c < (*i)->number; ++c) {
ostringstream s;
std::ostringstream s;
numFU++;
FuncUnit *fu2 = new FuncUnit(*fu);
@@ -205,34 +203,34 @@ FUPool::processFreeUnits()
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";
}
}

View File

@@ -60,8 +60,6 @@
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
using namespace std;
template<class Impl>
DefaultIEW<Impl>::DefaultIEW(O3CPU *_cpu, const DerivO3CPUParams &params)
: issueToExecQueue(params.backComSize, params.forwardComSize),
@@ -319,7 +317,7 @@ DefaultIEW<Impl>::setIEWQueue(TimeBuffer<IEWStruct> *iq_ptr)
template<class Impl>
void
DefaultIEW<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
DefaultIEW<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
@@ -632,8 +630,8 @@ DefaultIEW<Impl>::skidCount()
{
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++;
@@ -649,8 +647,8 @@ template<class Impl>
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++;
@@ -668,8 +666,8 @@ DefaultIEW<Impl>::updateStatus()
{
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++;
@@ -1166,8 +1164,8 @@ DefaultIEW<Impl>::executeInsts()
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++;
@@ -1473,8 +1471,8 @@ DefaultIEW<Impl>::tick()
// 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) {

View File

@@ -56,8 +56,6 @@
#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 &params)
: cpu(cpu_ptr), iewStage(iew_ptr),
@@ -118,7 +116,7 @@ LSQ<Impl>::name() const
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);
@@ -256,8 +254,8 @@ template<class Impl>
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++;
@@ -276,8 +274,8 @@ bool
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++;
@@ -371,8 +369,8 @@ LSQ<Impl>::getCount()
{
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++;
@@ -389,8 +387,8 @@ LSQ<Impl>::numLoads()
{
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++;
@@ -407,8 +405,8 @@ LSQ<Impl>::numStores()
{
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++;
@@ -425,8 +423,8 @@ LSQ<Impl>::numFreeLoadEntries()
{
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++;
@@ -443,8 +441,8 @@ LSQ<Impl>::numFreeStoreEntries()
{
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++;
@@ -473,8 +471,8 @@ template<class Impl>
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++;
@@ -509,8 +507,8 @@ template<class Impl>
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++;
@@ -526,8 +524,8 @@ template<class Impl>
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++;
@@ -543,8 +541,8 @@ template<class Impl>
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++;
@@ -572,8 +570,8 @@ template<class Impl>
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++;
@@ -601,8 +599,8 @@ template<class Impl>
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++;
@@ -628,8 +626,8 @@ template<class Impl>
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++;
@@ -645,8 +643,8 @@ template<class Impl>
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++;
@@ -662,8 +660,8 @@ template<class Impl>
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++;

View File

@@ -53,8 +53,6 @@
#include "debug/O3PipeView.hh"
#include "params/DerivO3CPU.hh"
using namespace std;
template <class Impl>
DefaultRename<Impl>::DefaultRename(O3CPU *_cpu, const DerivO3CPUParams &params)
: cpu(_cpu),
@@ -271,7 +269,7 @@ DefaultRename<Impl>::resetStage()
template<class Impl>
void
DefaultRename<Impl>::setActiveThreads(list<ThreadID> *at_ptr)
DefaultRename<Impl>::setActiveThreads(std::list<ThreadID> *at_ptr)
{
activeThreads = at_ptr;
}
@@ -401,8 +399,8 @@ DefaultRename<Impl>::tick()
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) {
@@ -817,8 +815,8 @@ template<class Impl>
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++;
@@ -836,8 +834,8 @@ DefaultRename<Impl>::updateStatus()
{
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++;

View File

@@ -46,8 +46,6 @@
#include "cpu/reg_class.hh"
#include "debug/Rename.hh"
using namespace std;
/**** SimpleRenameMap methods ****/
SimpleRenameMap::SimpleRenameMap()

View File

@@ -49,8 +49,6 @@
#include "debug/ROB.hh"
#include "params/DerivO3CPU.hh"
using namespace std;
template <class Impl>
ROB<Impl>::ROB(O3CPU *_cpu, const DerivO3CPUParams &params)
: robPolicy(params.smtROBPolicy),
@@ -124,7 +122,7 @@ ROB<Impl>::name() const
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;
@@ -153,8 +151,8 @@ ROB<Impl>::resetEntries()
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++;
@@ -288,8 +286,8 @@ bool
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++;
@@ -411,8 +409,8 @@ ROB<Impl>::updateHead()
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++;
@@ -452,8 +450,8 @@ ROB<Impl>::updateTail()
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++;

View File

@@ -38,8 +38,6 @@
#include "sim/core.hh"
#include "sim/system.hh"
using namespace std;
PCEventQueue::PCEventQueue()
{}
@@ -70,7 +68,7 @@ bool
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());

View File

@@ -58,7 +58,6 @@
#include "sim/full_system.hh"
#include "sim/system.hh"
using namespace std;
using namespace TheISA;
void
@@ -693,7 +692,7 @@ AtomicSimpleCPU::tick()
}
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.
@@ -759,7 +758,7 @@ AtomicSimpleCPU::regProbePoints()
{
BaseCPU::regProbePoints();
ppCommit = new ProbePointArg<pair<SimpleThread*, const StaticInstPtr>>
ppCommit = new ProbePointArg<std::pair<SimpleThread*, const StaticInstPtr>>
(getProbeManager(), "Commit");
}

View File

@@ -77,7 +77,6 @@
#include "sim/stats.hh"
#include "sim/system.hh"
using namespace std;
using namespace TheISA;
BaseSimpleCPU::BaseSimpleCPU(const BaseSimpleCPUParams &p)

View File

@@ -58,7 +58,6 @@
#include "sim/full_system.hh"
#include "sim/system.hh"
using namespace std;
using namespace TheISA;
void
@@ -601,7 +600,7 @@ TimingSimpleCPU::initiateMemAMO(Addr addr, unsigned size,
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));
@@ -788,7 +787,7 @@ TimingSimpleCPU::advanceInst(const Fault &fault)
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;

View File

@@ -62,8 +62,6 @@
#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,

View File

@@ -69,8 +69,6 @@ class NopStaticInst : public StaticInst
StaticInstPtr StaticInst::nullStaticInstPtr;
StaticInstPtr StaticInst::nopStaticInstPtr = new NopStaticInst;
using namespace std;
StaticInst::~StaticInst()
{
if (cachedDisassembly)
@@ -115,11 +113,11 @@ StaticInst::branchTarget(ThreadContext *tc) const
"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;
}

View File

@@ -45,8 +45,6 @@
#include "sim/stats.hh"
#include "sim/system.hh"
using namespace std;
int TESTER_NETWORK=0;
bool

View File

@@ -48,8 +48,6 @@
#include "sim/stats.hh"
#include "sim/system.hh"
using namespace std;
unsigned int TESTER_ALLOCATOR = 0;
bool
@@ -163,8 +161,9 @@ MemTest::completeRequest(PacketPtr pkt, bool functional)
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;
}

View File

@@ -64,8 +64,6 @@
#endif
using namespace std;
BaseTrafficGen::BaseTrafficGen(const BaseTrafficGenParams &p)
: ClockedObject(p),
system(p.system),
@@ -90,7 +88,7 @@ BaseTrafficGen::~BaseTrafficGen()
}
Port &
BaseTrafficGen::getPort(const string &if_name, PortID idx)
BaseTrafficGen::getPort(const std::string &if_name, PortID idx)
{
if (if_name == "port") {
return port;

View File

@@ -46,8 +46,6 @@
#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,

View File

@@ -49,8 +49,6 @@
#include "sim/stats.hh"
#include "sim/system.hh"
using namespace std;
TrafficGen::TrafficGen(const TrafficGenParams &p)
: BaseTrafficGen(p),
configFile(p.config_file),
@@ -126,11 +124,11 @@ TrafficGen::parseConfig()
{
// 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);
@@ -140,14 +138,14 @@ TrafficGen::parseConfig()
// 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;
@@ -156,12 +154,12 @@ TrafficGen::parseConfig()
// 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;
@@ -319,7 +317,7 @@ TrafficGen::parseConfig()
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;
}