gem5: TrapListener implemented
The TrapListener works like in Bochs. Instead of a number to a trap the offset is returned for GEM5. See: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0211h/Babfeega.html Conflicts: simulators/gem5/src/cpu/simple/atomic.cc Change-Id: Ia8b2083e3c16315d9c577150f14f16995494b2e6
This commit is contained in:
committed by
Horst Schirmeier
parent
fa1690bd1f
commit
5fbf13d07d
@ -289,17 +289,9 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data,
|
||||
}
|
||||
dcache_access = true;
|
||||
|
||||
// FAIL*
|
||||
#ifdef CONFIG_EVENT_TRAP
|
||||
if(pkt.isError()) {
|
||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||
fail::simulator.onTrap(cpu, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(!pkt.isError());
|
||||
|
||||
// FAIL*
|
||||
// DanceOS
|
||||
#ifdef CONFIG_EVENT_MEMREAD
|
||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||
fail::simulator.onMemoryAccess(cpu, pkt.getAddr(), pkt.getSize(), false, instAddr());
|
||||
@ -405,17 +397,9 @@ AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size,
|
||||
}
|
||||
dcache_access = true;
|
||||
|
||||
// FAIL*
|
||||
#ifdef CONFIG_EVENT_TRAP
|
||||
if(pkt.isError()) {
|
||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||
fail::simulator.onTrap(cpu, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(!pkt.isError());
|
||||
|
||||
// FAIL*
|
||||
// DanceOS
|
||||
#ifdef CONFIG_EVENT_MEMWRITE
|
||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||
fail::simulator.onMemoryAccess(cpu, pkt.getAddr(), pkt.getSize(), true, instAddr());
|
||||
@ -525,15 +509,6 @@ AtomicSimpleCPU::tick()
|
||||
else
|
||||
icache_latency = icachePort.sendAtomic(&ifetch_pkt);
|
||||
|
||||
// FAIL*
|
||||
#ifdef CONFIG_EVENT_TRAP
|
||||
if(ifetch_pkt.isError())
|
||||
{
|
||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||
fail::simulator.onTrap(cpu, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(!ifetch_pkt.isError());
|
||||
|
||||
// ifetch_req is initialized to read the instruction directly
|
||||
|
||||
@ -332,10 +332,10 @@ BaseSimpleCPU::checkForInterrupts()
|
||||
Fault interrupt = interrupts->getInterrupt(tc);
|
||||
|
||||
if (interrupt != NoFault) {
|
||||
// FAIL*
|
||||
#ifdef CONFIG_EVENT_INTERRUPT
|
||||
fail::simulator.onInterrupt(dynamic_cast<ArmFault*>(interrupt.get())->offset(), false);
|
||||
#endif
|
||||
// DanceOS
|
||||
#ifdef CONFIG_EVENT_INTERRUPT
|
||||
fail::simulator.onInterrupt(dynamic_cast<ArmFault*>(interrupt.get())->offset(), false);
|
||||
#endif
|
||||
fetchOffset = 0;
|
||||
interrupts->updateIntrInfo(tc);
|
||||
interrupt->invoke(tc);
|
||||
|
||||
Reference in New Issue
Block a user