diff -r f348cf78072c src/arch/mips/isa/decoder.isa --- a/src/arch/mips/isa/decoder.isa Thu Jan 12 10:15:00 2012 -0500 +++ b/src/arch/mips/isa/decoder.isa Tue Jan 17 00:55:12 2012 +0800 @@ -649,7 +649,8 @@ StatusReg status = Status; ConfigReg config = Config; SRSCtlReg srsCtl = SRSCtl; - DPRINTF(MipsPRA,"Restoring PC - %x\n",EPC); + // TODO: here met a compiling error: NPC may be used uninitialized + DPRINTF(MipsPRA,"Restoring PC - %x, NPC=%x, NNPC=%x\n",EPC, NPC, NNPC); if (status.erl == 1) { status.erl = 0; NPC = ErrorEPC; @@ -777,6 +778,8 @@ SP = 1; } Ptr->insertAt(newEntry, Index & 0x7FFFFFFF, SP); + Ptr = xc->tcBase()->getDTBPtr(); + Ptr->insertAt(newEntry, Index & 0x7FFFFFFF, SP); }}); 0x06: tlbwr({{ //Create PTE @@ -841,7 +844,13 @@ bits(pageGrain, pageGrain.esp) == 1) { SP = 1; } - Ptr->insertAt(newEntry, Random, SP); + + // TODO: generate a real random number here + static int random = 0; + random = (random + 1) % 64; + Ptr->insertAt(newEntry, random, SP); + Ptr = xc->tcBase()->getDTBPtr(); + Ptr->insertAt(newEntry, random, SP); }}); 0x08: tlbp({{ @@ -867,9 +876,10 @@ } }}); } - format CP0Unimpl { - 0x20: wait(); - } + 0x20: BasicOp::wait({{ + // TODO: check the function of wait instruction + //fault = new CoprocessorUnusableFault(0); + }}, IsMemBarrier); default: CP0Unimpl::unknown(); } } @@ -2430,11 +2440,14 @@ } } } - 0x3: decode OP default FailUnimpl::rdhwr() { + 0x3: decode OP { 0x0: decode FULL_SYSTEM { 0: decode RD { 29: BasicOp::rdhwr_se({{ Rt = TpValue; }}); } + 1: CP0Control::rdhwr({{ + fault = new CoprocessorUnusableFault(0); + }}); } } }