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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user