Basic SAL files and makefile modifications for adding gem5.
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1457 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -3,5 +3,6 @@
|
||||
|
||||
#cmakedefine BUILD_OVP
|
||||
#cmakedefine BUILD_BOCHS
|
||||
#cmakedefine BUILD_GEM5
|
||||
|
||||
#endif // __VARIANT_CONFIG_HPP__
|
||||
|
||||
@ -137,7 +137,7 @@ void JobServer::run()
|
||||
saddr.sin_addr.s_addr = htons(INADDR_ANY);
|
||||
|
||||
/* bind to port */
|
||||
if (bind(s, (struct sockaddr*) &saddr, sizeof(saddr)) == -1) {
|
||||
if (::bind(s, (struct sockaddr*) &saddr, sizeof(saddr)) == -1) {
|
||||
perror("bind");
|
||||
// TODO: Log-level?
|
||||
return;
|
||||
|
||||
@ -9,7 +9,7 @@ if(BUILD_BOCHS)
|
||||
bochs/BochsController.cc
|
||||
bochs/BochsListener.cc
|
||||
)
|
||||
else()
|
||||
elseif(BUILD_OVP)
|
||||
set(SRCS
|
||||
BufferCache.cc
|
||||
Listener.cc
|
||||
@ -19,6 +19,16 @@ else()
|
||||
SimulatorController.cc
|
||||
${VARIANT}/OVPController.cc
|
||||
)
|
||||
elseif(BUILD_GEM5)
|
||||
set(SRCS
|
||||
BufferCache.cc
|
||||
Listener.cc
|
||||
ListenerManager.cc
|
||||
Memory.cc
|
||||
Register.cc
|
||||
SimulatorController.cc
|
||||
gem5/Gem5Controller.cc
|
||||
)
|
||||
endif(BUILD_BOCHS)
|
||||
|
||||
add_library(sal ${SRCS})
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
#include "bochs/BochsConfig.hpp"
|
||||
#elif defined BUILD_OVP
|
||||
#include "ovp/OVPConfig.hpp"
|
||||
#elif defined BUILD_GEM5
|
||||
#include "gem5/Gem5Config.hpp"
|
||||
#else
|
||||
#error SAL Config Target not defined
|
||||
#endif
|
||||
|
||||
@ -26,6 +26,17 @@ extern ConcreteSimulatorController simulator; //!< the global simulator-controll
|
||||
|
||||
}
|
||||
|
||||
#elif defined BUILD_GEM5
|
||||
|
||||
#include "gem5/Gem5Controller.hpp"
|
||||
|
||||
namespace fail {
|
||||
|
||||
typedef Gem5Controller ConcreteSimulatorController; //!< concrete simulator (type)
|
||||
extern ConcreteSimulatorController simulator; //!< the global simulator-controller instance
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
#error SAL Instance not defined
|
||||
#endif
|
||||
|
||||
22
src/core/sal/gem5/Gem5Config.hpp
Normal file
22
src/core/sal/gem5/Gem5Config.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* \brief Type definitions and configuration settings for
|
||||
* the gem5 simulator.
|
||||
*/
|
||||
|
||||
#ifndef __GEM5_CONFIG_HPP__
|
||||
#define __GEM5_CONFIG_HPP__
|
||||
|
||||
#include "base/types.hh"
|
||||
#include "arch/arm/registers.hh"
|
||||
|
||||
namespace fail {
|
||||
|
||||
typedef Addr guest_address_t; //!< the guest memory address type
|
||||
// TODO: Set Host Address Type
|
||||
typedef void* host_address_t; //!< the host memory address type
|
||||
typedef ArmISA::AnyReg register_data_t; //!< register data type (32 bit)
|
||||
typedef int timer_t; //!< type of timer IDs
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
#endif // __GEM5_CONFIG_HPP__
|
||||
7
src/core/sal/gem5/Gem5Controller.cc
Normal file
7
src/core/sal/gem5/Gem5Controller.cc
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
namespace fail {
|
||||
|
||||
int interrupt_to_fire = -1;
|
||||
|
||||
} // end-of-namespace: fail
|
||||
19
src/core/sal/gem5/Gem5Controller.hpp
Normal file
19
src/core/sal/gem5/Gem5Controller.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef __GEM5_CONTROLLER_HPP__
|
||||
#define __GEM5_CONTROLLER_HPP__
|
||||
|
||||
#include "../SimulatorController.hpp"
|
||||
|
||||
namespace fail {
|
||||
|
||||
extern int interrupt_to_fire;
|
||||
|
||||
class Gem5Controller : public SimulatorController {
|
||||
public:
|
||||
virtual void save(const std::string &path);
|
||||
virtual void restore(const std::string &path);
|
||||
virtual void reboot();
|
||||
};
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
#endif // __GEM_CONTROLLER_HPP__
|
||||
9
src/core/sal/gem5/SConscript
Normal file
9
src/core/sal/gem5/SConscript
Normal file
@ -0,0 +1,9 @@
|
||||
Import('*')
|
||||
|
||||
if env['TARGET_ISA'] == 'no':
|
||||
Return()
|
||||
|
||||
env.Append(CPPPATH=Dir('../../../../../src/core/'))
|
||||
env.Append(CPPPATH=Dir('../../../../../build/src/core/'))
|
||||
|
||||
Source('faildev.cc')
|
||||
1
src/core/sal/gem5/faildev.cc
Normal file
1
src/core/sal/gem5/faildev.cc
Normal file
@ -0,0 +1 @@
|
||||
#include "faildev.hh"
|
||||
1
src/core/sal/gem5/faildev.hh
Normal file
1
src/core/sal/gem5/faildev.hh
Normal file
@ -0,0 +1 @@
|
||||
#include "../SALInst.hpp"
|
||||
Reference in New Issue
Block a user