From 279946f3502e19581cc52ca93af7af67dfec094d Mon Sep 17 00:00:00 2001 From: Kajol Jain Date: Wed, 12 Jun 2019 15:31:59 +0530 Subject: [PATCH] arch-power: Extra logs for debugging Change-Id: I701c422c180e5ade32675fc06b6ca0c3f91c64ef Signed-off-by: Kajol Jain --- src/arch/power/faults.hh | 2 +- src/arch/power/isa/decoder.isa | 2 ++ src/arch/power/system.cc | 3 +++ src/cpu/simple/atomic.cc | 6 +++--- src/cpu/simple_thread.hh | 2 ++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/arch/power/faults.hh b/src/arch/power/faults.hh index 5f9b54413..d6c1a31b2 100644 --- a/src/arch/power/faults.hh +++ b/src/arch/power/faults.hh @@ -236,7 +236,7 @@ class ProgramInterrupt : public PowerInterrupt virtual void invoke(ThreadContext * tc, const StaticInstPtr &inst = StaticInst::nullStaticInstPtr ,uint64_t bitSet = 0) { - tc->setIntReg(INTREG_SRR0, tc->instAddr() + 4); + tc->setIntReg(INTREG_SRR0, tc->instAddr()); PowerInterrupt::updateSRR1(tc, bitSet); PowerInterrupt::updateMsr(tc); tc->pcState(ProgramPCSet); diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa index dbf8810d5..39c0ddef7 100644 --- a/src/arch/power/isa/decoder.isa +++ b/src/arch/power/isa/decoder.isa @@ -967,6 +967,7 @@ decode PO default Unknown::unknown() { ThreadContext *tc = xc->tcBase(); ThreadID t = tc->threadId(); if(bits(Rb_ud, 31, 27) == 0x5) { + printf("Get msgclr instr for threadid %d\n",(int)t); tc->getCpuPtr()->clearInterrupt(t, 7, 0); } }}); @@ -994,6 +995,7 @@ decode PO default Unknown::unknown() { Rb_ud,(int)tc->threadId()); uint64_t val2 = Rb_ud; printf("Reading done"); + printf("Msr value is 0x%016lx\n", MSR); if(bits(val1, 19, 0) == bits(val2, 19, 0)){ printf("Intterupt Happen\n"); t->getCpuPtr()->postInterrupt(i, 7, 0); diff --git a/src/arch/power/system.cc b/src/arch/power/system.cc index b54d3c4ec..db44eb58f 100644 --- a/src/arch/power/system.cc +++ b/src/arch/power/system.cc @@ -66,6 +66,9 @@ void PowerSystem::initState() { System::initState(); + printf("PowerSystem::initState: No of thread contexts %d\n" , + (int)threadContexts.size()); + ThreadContext *tc = threadContexts[0]; tc->pcState(tc->getSystemPtr()->kernelEntry); //Sixty Four, little endian,Hypervisor bits are enabled. diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 7a368ab32..d42bbb459 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -371,7 +371,7 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, unsigned size, } dcache_access = true; - assert(!pkt.isError()); + //assert(!pkt.isError()); if (req->isLLSC()) { TheISA::handleLockedRead(thread, req); @@ -489,7 +489,7 @@ AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size, Addr addr, threadSnoop(&pkt, curThread); } dcache_access = true; - assert(!pkt.isError()); + //assert(!pkt.isError()); if (req->isSwap()) { assert(res); @@ -605,7 +605,7 @@ AtomicSimpleCPU::tick() else icache_latency = icachePort.sendAtomic(&ifetch_pkt); - assert(!ifetch_pkt.isError()); + // assert(!ifetch_pkt.isError()); // ifetch_req is initialized to read the instruction directly // into the CPU object's inst field. diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index 3c64082b8..89ce79f06 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -246,6 +246,8 @@ class SimpleThread : public ThreadState uint64_t readIntReg(int reg_idx) { int flatIndex = isa->flattenIntIndex(reg_idx); + if (flatIndex>TheISA::NumIntRegs) + printf("Flat index..%d NumIntRegs..%d\n",flatIndex,TheISA::NumIntRegs); assert(flatIndex < TheISA::NumIntRegs); uint64_t regVal(readIntRegFlat(flatIndex)); DPRINTF(IntRegs, "Reading int reg %d (%d) as %#x.\n", -- 2.30.2