diff --git a/src/core/sal/gem5/FailGem5Device.cc b/src/core/sal/gem5/FailGem5Device.cc new file mode 100644 index 0000000000000000000000000000000000000000..0d86437212251579117dac8dd2e1b329a4775664 --- /dev/null +++ b/src/core/sal/gem5/FailGem5Device.cc @@ -0,0 +1,27 @@ +#include "FailGem5Device.hh" +#include "debug/Fail.hh" + +#include "../SALInst.hpp" + +FailGem5Device::FailGem5Device(Params *p) + : BasicPioDevice(p) +{ + pioSize = 0x60; + DPRINTF(Fail, "Fail startup()\n"); + fail::simulator.startup(); +} + +Tick FailGem5Device::read(PacketPtr pkt) +{ + return pioDelay; +} + +Tick FailGem5Device::write(PacketPtr pkt) +{ + return pioDelay; +} + +FailGem5Device* FailGem5DeviceParams::create() +{ + return new FailGem5Device(this); +} diff --git a/src/core/sal/gem5/FailGem5Device.hh b/src/core/sal/gem5/FailGem5Device.hh new file mode 100644 index 0000000000000000000000000000000000000000..3601fcdd7da008f38c7ac16c7347ca5cc2e24619 --- /dev/null +++ b/src/core/sal/gem5/FailGem5Device.hh @@ -0,0 +1,19 @@ +#ifndef __FAILGEM5_DEVICE_HH__ +#define __FAILGEM5_DEVICE_HH__ + +#include "dev/io_device.hh" +#include "params/FailGem5Device.hh" + +class FailGem5Device : public BasicPioDevice +{ + public: + typedef FailGem5DeviceParams Params; + + FailGem5Device(Params *p); + + virtual Tick read(PacketPtr pkt); + + virtual Tick write(PacketPtr pkt); +}; + +#endif // __FAILGEM5_DEVICE_HH__ diff --git a/src/core/sal/gem5/FailGem5Device.py b/src/core/sal/gem5/FailGem5Device.py new file mode 100644 index 0000000000000000000000000000000000000000..41545b92bc3222aea91b15ffc4defb06f5b7da73 --- /dev/null +++ b/src/core/sal/gem5/FailGem5Device.py @@ -0,0 +1,5 @@ +from Device import BasicPioDevice + +class FailGem5Device(BasicPioDevice): + type = 'FailGem5Device' + diff --git a/src/core/sal/gem5/Gem5Controller.cc b/src/core/sal/gem5/Gem5Controller.cc index ddf013eb947be613fea7845ee967c14f0441f89c..159933fdb89a0eef383cfc313af43cbf85471169 100644 --- a/src/core/sal/gem5/Gem5Controller.cc +++ b/src/core/sal/gem5/Gem5Controller.cc @@ -1,7 +1,22 @@ - +#include "Gem5Controller.hpp" namespace fail { int interrupt_to_fire = -1; -} // end-of-namespace: fail \ No newline at end of file +void Gem5Controller::save(const std::string &path) +{ + +} + +void Gem5Controller::restore(const std::string &path) +{ + +} + +void Gem5Controller::reboot() +{ + +} + +} // end-of-namespace: fail diff --git a/src/core/sal/gem5/Gem5Controller.hpp b/src/core/sal/gem5/Gem5Controller.hpp index c1f295005b234c3b1614502a9ca0d5abef1f903c..9a11345487bd6528a11c51b424cbdc3437565b25 100644 --- a/src/core/sal/gem5/Gem5Controller.hpp +++ b/src/core/sal/gem5/Gem5Controller.hpp @@ -1,6 +1,8 @@ #ifndef __GEM5_CONTROLLER_HPP__ #define __GEM5_CONTROLLER_HPP__ +#include <string> + #include "../SimulatorController.hpp" namespace fail { diff --git a/src/core/sal/gem5/SConscript b/src/core/sal/gem5/SConscript index 6450d62b8c57a19877eff38f9c53035b5cecd8f5..b262dc692048e55c3a043d0c31c15da456a5512c 100644 --- a/src/core/sal/gem5/SConscript +++ b/src/core/sal/gem5/SConscript @@ -6,4 +6,11 @@ if env['TARGET_ISA'] == 'no': env.Append(CPPPATH=Dir('../../../../../src/core/')) env.Append(CPPPATH=Dir('../../../../../build/src/core/')) -Source('faildev.cc') +env.Append(LIBPATH=Dir('../../../../../build/lib/')) +#env.Append(LIBS=['fail', 'sal', 'comm', 'cpn', 'efw', 'util', 'pthread']) +env.Append(LIBS=['fail']) + + +SimObject('FailGem5Device.py') +Source('FailGem5Device.cc') +DebugFlag('Fail') diff --git a/src/core/sal/gem5/faildev.cc b/src/core/sal/gem5/faildev.cc deleted file mode 100644 index b1a05cb24ddab7f90f3a23acf86416d241994a10..0000000000000000000000000000000000000000 --- a/src/core/sal/gem5/faildev.cc +++ /dev/null @@ -1 +0,0 @@ -#include "faildev.hh" \ No newline at end of file diff --git a/src/core/sal/gem5/faildev.hh b/src/core/sal/gem5/faildev.hh deleted file mode 100644 index 4a60a677ade897c59071902a99229da88533d4b4..0000000000000000000000000000000000000000 --- a/src/core/sal/gem5/faildev.hh +++ /dev/null @@ -1 +0,0 @@ -#include "../SALInst.hpp" \ No newline at end of file