- Added signaling of trap situations needed in the weather-monitor to gem5.
- Fixed setting of instruction address for simulator.onMemoryAccess() calls. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@2025 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -289,12 +289,20 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data,
|
|||||||
}
|
}
|
||||||
dcache_access = true;
|
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());
|
assert(!pkt.isError());
|
||||||
|
|
||||||
// FAIL*
|
// FAIL*
|
||||||
#ifdef CONFIG_EVENT_MEMREAD
|
#ifdef CONFIG_EVENT_MEMREAD
|
||||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||||
fail::simulator.onMemoryAccess(cpu, pkt.getAddr(), pkt.getSize(), false, 0);
|
fail::simulator.onMemoryAccess(cpu, pkt.getAddr(), pkt.getSize(), false, instAddr());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (req->isLLSC()) {
|
if (req->isLLSC()) {
|
||||||
@ -396,12 +404,21 @@ AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size,
|
|||||||
dcache_latency += dcachePort.sendAtomic(&pkt);
|
dcache_latency += dcachePort.sendAtomic(&pkt);
|
||||||
}
|
}
|
||||||
dcache_access = true;
|
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());
|
assert(!pkt.isError());
|
||||||
|
|
||||||
// FAIL*
|
// FAIL*
|
||||||
#ifdef CONFIG_EVENT_MEMWRITE
|
#ifdef CONFIG_EVENT_MEMWRITE
|
||||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||||
fail::simulator.onMemoryAccess(cpu, pkt.getAddr(), pkt.getSize(), true, 0);
|
fail::simulator.onMemoryAccess(cpu, pkt.getAddr(), pkt.getSize(), true, instAddr());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (req->isSwap()) {
|
if (req->isSwap()) {
|
||||||
@ -496,11 +513,21 @@ AtomicSimpleCPU::tick()
|
|||||||
else
|
else
|
||||||
icache_latency = icachePort.sendAtomic(&ifetch_pkt);
|
icache_latency = icachePort.sendAtomic(&ifetch_pkt);
|
||||||
|
|
||||||
assert(!ifetch_pkt.isError());
|
// 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());
|
||||||
|
|
||||||
// FAIL*
|
// FAIL*
|
||||||
#ifdef CONFIG_EVENT_MEMREAD
|
#ifdef CONFIG_EVENT_MEMREAD
|
||||||
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(cpuId());
|
||||||
fail::simulator.onMemoryAccess(cpu, ifetch_pkt.getAddr(), ifetch_pkt.getSize(), false, 0);
|
fail::simulator.onMemoryAccess(cpu, ifetch_pkt.getAddr(), ifetch_pkt.getSize(), false, instAddr());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ifetch_req is initialized to read the instruction directly
|
// ifetch_req is initialized to read the instruction directly
|
||||||
|
|||||||
@ -51,6 +51,10 @@
|
|||||||
#include "mem/packet_access.hh"
|
#include "mem/packet_access.hh"
|
||||||
#include "sim/sim_exit.hh"
|
#include "sim/sim_exit.hh"
|
||||||
|
|
||||||
|
#include "config/FailConfig.hpp"
|
||||||
|
#include "sal/SALInst.hpp"
|
||||||
|
|
||||||
|
|
||||||
Pl011::Pl011(const Params *p)
|
Pl011::Pl011(const Params *p)
|
||||||
: Uart(p), control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12), imsc(0),
|
: Uart(p), control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12), imsc(0),
|
||||||
rawInt(0), maskInt(0), intNum(p->int_num), gic(p->gic),
|
rawInt(0), maskInt(0), intNum(p->int_num), gic(p->gic),
|
||||||
@ -180,8 +184,14 @@ Pl011::write(PacketPtr pkt)
|
|||||||
|
|
||||||
switch (daddr) {
|
switch (daddr) {
|
||||||
case UART_DR:
|
case UART_DR:
|
||||||
if ((data & 0xFF) == 0x04 && endOnEOT)
|
if ((data & 0xFF) == 0x04 && endOnEOT) {
|
||||||
|
// FAIL*
|
||||||
|
#ifdef CONFIG_EVENT_TRAP
|
||||||
|
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(0);
|
||||||
|
fail::simulator.onTrap(cpu, 0);
|
||||||
|
#endif
|
||||||
exitSimLoop("UART received EOT", 0);
|
exitSimLoop("UART received EOT", 0);
|
||||||
|
}
|
||||||
|
|
||||||
term->out(data & 0xFF);
|
term->out(data & 0xFF);
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,9 @@
|
|||||||
#include "mem/packet_access.hh"
|
#include "mem/packet_access.hh"
|
||||||
#include "sim/system.hh"
|
#include "sim/system.hh"
|
||||||
|
|
||||||
|
#include "config/FailConfig.hpp"
|
||||||
|
#include "sal/SALInst.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
IsaFake::IsaFake(Params *p)
|
IsaFake::IsaFake(Params *p)
|
||||||
@ -113,7 +116,14 @@ IsaFake::write(PacketPtr pkt)
|
|||||||
data = pkt->get<uint8_t>();
|
data = pkt->get<uint8_t>();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
panic("invalid access size!\n");
|
// FAIL*
|
||||||
|
#ifdef CONFIG_EVENT_TRAP
|
||||||
|
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(0);
|
||||||
|
fail::simulator.onTrap(cpu, 0);
|
||||||
|
#endif
|
||||||
|
panic("invalid access size!\n");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
warn("Device %s accessed by write to address %#x size=%d data=%#x\n",
|
warn("Device %s accessed by write to address %#x size=%d data=%#x\n",
|
||||||
name(), pkt->getAddr(), pkt->getSize(), data);
|
name(), pkt->getAddr(), pkt->getSize(), data);
|
||||||
|
|||||||
@ -62,9 +62,6 @@
|
|||||||
#include "mem/packet_access.hh"
|
#include "mem/packet_access.hh"
|
||||||
#include "sim/system.hh"
|
#include "sim/system.hh"
|
||||||
|
|
||||||
#include "config/FailConfig.hpp"
|
|
||||||
#include "sal/SALInst.hpp"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
AbstractMemory::AbstractMemory(const Params *p) :
|
AbstractMemory::AbstractMemory(const Params *p) :
|
||||||
|
|||||||
@ -53,6 +53,9 @@
|
|||||||
#include "debug/BusAddrRanges.hh"
|
#include "debug/BusAddrRanges.hh"
|
||||||
#include "mem/bus.hh"
|
#include "mem/bus.hh"
|
||||||
|
|
||||||
|
#include "config/FailConfig.hpp"
|
||||||
|
#include "sal/SALInst.hpp"
|
||||||
|
|
||||||
BaseBus::BaseBus(const BaseBusParams *p)
|
BaseBus::BaseBus(const BaseBusParams *p)
|
||||||
: MemObject(p), clock(p->clock),
|
: MemObject(p), clock(p->clock),
|
||||||
headerCycles(p->header_cycles), width(p->width), tickNextIdle(0),
|
headerCycles(p->header_cycles), width(p->width), tickNextIdle(0),
|
||||||
@ -291,6 +294,11 @@ BaseBus::findPort(Addr addr)
|
|||||||
|
|
||||||
// we should use the range for the default port and it did not
|
// we should use the range for the default port and it did not
|
||||||
// match, or the default port is not set
|
// match, or the default port is not set
|
||||||
|
// FAIL*
|
||||||
|
#ifdef CONFIG_EVENT_TRAP
|
||||||
|
fail::ConcreteCPU* cpu = &fail::simulator.getCPU(0);
|
||||||
|
fail::simulator.onTrap(cpu, 0);
|
||||||
|
#endif
|
||||||
fatal("Unable to find destination for addr %#llx on bus %s\n", addr,
|
fatal("Unable to find destination for addr %#llx on bus %s\n", addr,
|
||||||
name());
|
name());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user