#include "arch/alpha/intregfile.hh"
#include "arch/alpha/miscregfile.hh"
#include "arch/alpha/types.hh"
+#include "arch/alpha/mt.hh"
#include "sim/faults.hh"
#include <string>
return mem_res->doDataAccess(inst);
}
-TheISA::ITB*
+TheISA::TLB*
InOrderCPU::getITBPtr()
{
TLBUnit *itb_res = dynamic_cast<TLBUnit*>(resPool->getResource(itbIdx));
- return dynamic_cast<TheISA::ITB*>(itb_res->tlb());
+ return itb_res->tlb();
}
-TheISA::DTB*
+TheISA::TLB*
InOrderCPU::getDTBPtr()
{
TLBUnit *dtb_res = dynamic_cast<TLBUnit*>(resPool->getResource(dtbIdx));
- return dynamic_cast<TheISA::DTB*>(dtb_res->tlb());
+ return dtb_res->tlb();
}
/** Communication structure that sits in between pipeline stages */
StageQueue *stageQueue[ThePipeline::NumStages-1];
- TheISA::ITB *getITBPtr();
- TheISA::DTB *getDTBPtr();
+ TheISA::TLB *getITBPtr();
+ TheISA::TLB *getDTBPtr();
public:
/** Print Resource Schedule */
+ /** @NOTE: DEBUG ONLY */
void printSched()
{
- using namespace ThePipeline;
-
- ResSchedule tempSched;
+ ThePipeline::ResSchedule tempSched;
std::cerr << "\tInst. Res. Schedule: ";
while (!resSched.empty()) {
std::cerr << '\t' << resSched.top()->stageNum << "-"
IntReg readIntRegOperand(const StaticInst *si, int idx, unsigned tid=0);
FloatReg readFloatRegOperand(const StaticInst *si, int idx,
int width = TheISA::SingleWidth);
- FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx,
+ TheISA::FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx,
int width = TheISA::SingleWidth);
MiscReg readMiscReg(int misc_reg);
MiscReg readMiscRegNoEffect(int misc_reg);
void setIntRegOperand(const StaticInst *si, int idx, IntReg val);
void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val,
int width = TheISA::SingleWidth);
- void setFloatRegOperandBits(const StaticInst *si, int idx, FloatRegBits val,
+ void setFloatRegOperandBits(const StaticInst *si, int idx, TheISA::FloatRegBits val,
int width = TheISA::SingleWidth);
void setMiscReg(int misc_reg, const MiscReg &val);
void setMiscRegNoEffect(int misc_reg, const MiscReg &val);
} else if ( inst->isMemRef() ) {
if ( inst->isLoad() ) {
E->needs(AGEN, AGENUnit::GenerateAddr);
- E->needs(DTLB, TLBUnit::DataLookup);
+ E->needs(DTLB, TLBUnit::DataReadLookup);
E->needs(DCache, CacheUnit::InitiateReadData);
}
} else if (inst->opClass() == IntMultOp || inst->opClass() == IntDivOp) {
} else if ( inst->isStore() ) {
M->needs(RegManager, UseDefUnit::ReadSrcReg, 1);
M->needs(AGEN, AGENUnit::GenerateAddr);
- M->needs(DTLB, TLBUnit::DataLookup);
+ M->needs(DTLB, TLBUnit::DataWriteLookup);
M->needs(DCache, CacheUnit::InitiateWriteData);
}
// Get resource request info
- // @todo: SMT needs to figure out where to get thread # from.
- unsigned tid = 0;
unsigned stage_num = cache_req->getStageNum();
DynInstPtr inst = cache_req->inst;
+ unsigned tid;
+
+
+ tid = cache_req->inst->readTid();
if (!cache_req->isSquashed()) {
if (inst->resSched.top()->cmd == CompleteFetch) {
{
tlb_req->fault =
_tlb->translateAtomic(tlb_req->memReq,
- cpu->thread[tid]->getTC(), false, true);
+ cpu->thread[tid]->getTC(), TheISA::TLB::Execute);
if (tlb_req->fault != NoFault) {
DPRINTF(InOrderTLB, "[tid:%i]: %s encountered while translating "
}
break;
- case DataLookup:
+ case DataReadLookup:
+ case DataWriteLookup:
{
DPRINTF(InOrderTLB, "[tid:%i]: [sn:%i]: Attempting to translate %08p.\n",
tid, seq_num, tlb_req->memReq->getVaddr());
+
+ TheISA::TLB::Mode tlb_mode = (tlb_req->cmd == DataReadLookup) ?
+ TheISA::TLB::Read : TheISA::TLB::Write;
+
tlb_req->fault =
_tlb->translateAtomic(tlb_req->memReq,
- cpu->thread[tid]->getTC());
+ cpu->thread[tid]->getTC(), tlb_mode);
if (tlb_req->fault != NoFault) {
DPRINTF(InOrderTLB, "[tid:%i]: %s encountered while translating "
enum TLBCommand {
FetchLookup,
- DataLookup
+ DataReadLookup,
+ DataWriteLookup
};
public:
if (_cmd == TLBUnit::FetchLookup) {
aligned_addr = inst->getMemAddr();
- req_size = sizeof(MachInst);
+ req_size = sizeof(TheISA::MachInst);
flags = 0;
} else {
aligned_addr = inst->getMemAddr();;