void
LSQ<Impl>::DcachePort::recvFunctional(PacketPtr pkt)
{
- warn("O3CPU doesn't update things on a recvFunctional.");
+ DPRINTF(LSQ, "LSQ doesn't update things on a recvFunctional.");
}
template <class Impl>
void
LSQ<Impl>::DcachePort::recvStatusChange(Status status)
{
- if (status == RangeChange)
+ if (status == RangeChange) {
+ if (!snoopRangeSent) {
+ snoopRangeSent = true;
+ sendStatusChange(Port::RangeChange);
+ }
return;
-
+ }
panic("O3CPU doesn't expect recvStatusChange callback!");
}
{
DPRINTF(LSQ, "Creating LSQ object.\n");
+ dcachePort.snoopRangeSent = false;
+
//**********************************************/
//************ Handle SMT Parameters ***********/
//**********************************************/
LSQ<Impl>::resetEntries()
{
if (lsqPolicy != Dynamic || numThreads > 1) {
- int active_threads = (*activeThreads).size();
-
- std::list<unsigned>::iterator threads = (*activeThreads).begin();
- std::list<unsigned>::iterator list_end = (*activeThreads).end();
+ int active_threads = activeThreads->size();
int maxEntries;
maxEntries = LQEntries;
}
- while (threads != list_end) {
- resizeEntries(maxEntries,*threads++);
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
+
+ resizeEntries(maxEntries, tid);
}
}
}
void
LSQ<Impl>::tick()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
+ while (threads != end) {
+ unsigned tid = *threads++;
thread[tid].tick();
}
void
LSQ<Impl>::writebackStores()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
+ while (threads != end) {
+ unsigned tid = *threads++;
if (numStoresToWB(tid) > 0) {
DPRINTF(Writeback,"[tid:%i] Writing back stores. %i stores "
LSQ<Impl>::violation()
{
/* Answers: Does Anybody Have a Violation?*/
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
if (thread[tid].violation())
return true;
}
{
unsigned total = 0;
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
total += getCount(tid);
}
{
unsigned total = 0;
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
total += numLoads(tid);
}
{
unsigned total = 0;
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
total += thread[tid].numStores();
}
{
unsigned total = 0;
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
total += thread[tid].numLoadsReady();
}
{
unsigned total = 0;
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
total += thread[tid].numFreeEntries();
}
unsigned
LSQ<Impl>::numFreeEntries(unsigned tid)
{
- //if( lsqPolicy == Dynamic )
+ //if (lsqPolicy == Dynamic)
//return numFreeEntries();
//else
return thread[tid].numFreeEntries();
bool
LSQ<Impl>::isFull()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
- if (! (thread[tid].lqFull() || thread[tid].sqFull()) )
+ while (threads != end) {
+ unsigned tid = *threads++;
+
+ if (!(thread[tid].lqFull() || thread[tid].sqFull()))
return false;
}
{
//@todo: Change to Calculate All Entries for
//Dynamic Policy
- if( lsqPolicy == Dynamic )
+ if (lsqPolicy == Dynamic)
return isFull();
else
return thread[tid].lqFull() || thread[tid].sqFull();
bool
LSQ<Impl>::lqFull()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
if (!thread[tid].lqFull())
return false;
}
{
//@todo: Change to Calculate All Entries for
//Dynamic Policy
- if( lsqPolicy == Dynamic )
+ if (lsqPolicy == Dynamic)
return lqFull();
else
return thread[tid].lqFull();
bool
LSQ<Impl>::sqFull()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
if (!sqFull(tid))
return false;
}
{
//@todo: Change to Calculate All Entries for
//Dynamic Policy
- if( lsqPolicy == Dynamic )
+ if (lsqPolicy == Dynamic)
return sqFull();
else
return thread[tid].sqFull();
bool
LSQ<Impl>::isStalled()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
if (!thread[tid].isStalled())
return false;
}
bool
LSQ<Impl>::isStalled(unsigned tid)
{
- if( lsqPolicy == Dynamic )
+ if (lsqPolicy == Dynamic)
return isStalled();
else
return thread[tid].isStalled();
bool
LSQ<Impl>::hasStoresToWB()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
- if ((*activeThreads).empty())
+ if (threads == end)
return false;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
+ while (threads != end) {
+ unsigned tid = *threads++;
+
if (!hasStoresToWB(tid))
return false;
}
bool
LSQ<Impl>::willWB()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
if (!willWB(tid))
return false;
}
void
LSQ<Impl>::dumpInsts()
{
- std::list<unsigned>::iterator active_threads = (*activeThreads).begin();
+ std::list<unsigned>::iterator threads = activeThreads->begin();
+ std::list<unsigned>::iterator end = activeThreads->end();
+
+ while (threads != end) {
+ unsigned tid = *threads++;
- while (active_threads != (*activeThreads).end()) {
- unsigned tid = *active_threads++;
thread[tid].dumpInsts();
}
}