Architecture changes (only gem5 implementation right now):
- The register manager is gone. It's functionality is now encapsulated in the CPU classes. - For the client, there is the ConcreteCPU class that encapsulates the access to the CPU state (including registers) and architecture details. The correspondig objects for the CPUs inside the simulator can be accessed through the SimulatorController.getCPU() function. - Listener got a new ConcreteCPU* member to filter for which CPU the events should fire. The default NULL is used as wildcard for all aviable CPUs. The events respectively got a ConcreteCPU* member to indicate which CPU really fired the event. - For the server, there is CPUArchitecture to access the architecture details. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1966 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -3,8 +3,25 @@
|
||||
|
||||
#include "../Listener.hpp"
|
||||
|
||||
#include "sim/system.hh"
|
||||
|
||||
namespace fail {
|
||||
|
||||
void Gem5Controller::startup()
|
||||
{
|
||||
// Assuming there is only one defined system should be sufficient for most cases. More systems
|
||||
// are only used for switching cpu model or caches during a simulation run.
|
||||
System* sys = System::systemList.front();
|
||||
m_Mem = new Gem5MemoryManager(sys);
|
||||
|
||||
for (int i = 0; i < sys->numContexts(); i++) {
|
||||
ConcreteCPU* cpu = new ConcreteCPU(sys->getThreadContext(i)->cpuId(), System::systemList.front());
|
||||
addCPU(cpu);
|
||||
}
|
||||
|
||||
SimulatorController::startup();
|
||||
}
|
||||
|
||||
bool Gem5Controller::save(const std::string &path)
|
||||
{
|
||||
connector.save(path);
|
||||
@ -23,27 +40,4 @@ void Gem5Controller::reboot()
|
||||
|
||||
}
|
||||
|
||||
void Gem5Controller::onBreakpoint(address_t instrPtr, address_t address_space)
|
||||
{
|
||||
bool do_fire = false;
|
||||
// Check for active breakpoint-events:
|
||||
ListenerManager::iterator it = m_LstList.begin();
|
||||
BPEvent tmp(instrPtr, address_space);
|
||||
while (it != m_LstList.end()) {
|
||||
BaseListener* pLi = *it;
|
||||
BPListener* pBreakpt = dynamic_cast<BPListener*>(pLi);
|
||||
if (pBreakpt != NULL && pBreakpt->isMatching(&tmp)) {
|
||||
pBreakpt->setTriggerInstructionPointer(instrPtr);
|
||||
it = m_LstList.makeActive(it);
|
||||
do_fire = true;
|
||||
// "it" has already been set to the next element (by calling
|
||||
// makeActive()):
|
||||
continue; // -> skip iterator increment
|
||||
}
|
||||
it++;
|
||||
}
|
||||
if (do_fire)
|
||||
m_LstList.triggerActiveListeners();
|
||||
}
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
Reference in New Issue
Block a user