gem5 build system improved

Encapsulated gem5-specific code into wrapper functions to separate the
build process (Fail: CMake, gem5: scons). Added some gem5-related FIXMEs.

Another CMake related FIXME added. +some cosmetics.

Change-Id: Id84b480127b1f13aed6a0ee97f3583f410d531c5
This commit is contained in:
Adrian Böckenkamp
2013-04-04 17:30:10 +02:00
parent 84559fe467
commit 08febe5819
14 changed files with 252 additions and 123 deletions

View File

@ -1,9 +1,9 @@
#include "Gem5Controller.hpp"
#include "Gem5Connector.hpp"
//#include "Gem5Connector.hpp"
#include "../Listener.hpp"
#include "sim/system.hh"
#include "Gem5Wrapper.hpp"
namespace fail {
@ -11,11 +11,12 @@ 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);
m_System = GetSystemObject();
m_Mem = new Gem5MemoryManager(m_System);
for (int i = 0; i < sys->numContexts(); i++) {
ConcreteCPU* cpu = new ConcreteCPU(sys->getThreadContext(i)->cpuId(), System::systemList.front());
int numCtxs = GetNumberOfContexts(m_System);
for (int i = 0; i < numCtxs; i++) {
ConcreteCPU* cpu = new ConcreteCPU(GetCPUId(m_System, i), m_System);
addCPU(cpu);
}
@ -35,14 +36,14 @@ Gem5Controller::~Gem5Controller()
bool Gem5Controller::save(const std::string &path)
{
connector.save(path); // FIXME: not working?!
// connector.save(path); // FIXME: not working?!
return true;
}
void Gem5Controller::restore(const std::string &path)
{
connector.restore(path); // FIXME: not working?!
// connector.restore(path); // FIXME: not working?!
}
// TODO: Implement reboot