Separated Architecture and CPUState classes for ARM/Gem5 (*Architecture will be used in the campaign).

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1969 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-12-05 13:05:24 +00:00
parent b981fdcfea
commit 2b36678737
5 changed files with 33 additions and 18 deletions

View File

@ -69,7 +69,7 @@ if(BUILD_X86)
)
elseif(BUILD_ARM)
set(SRCS ${SRCS}
arm/arch.cc
arm/Architecture.cc
)
endif(BUILD_X86)

View File

@ -1,4 +1,4 @@
#include "arch.hpp"
#include "ArmArchitecture.hpp"
#include "../Register.hpp"
namespace fail {

View File

@ -1,10 +1,11 @@
#ifndef __ARM_ARCH_HPP__
#define __ARM_ARCH_HPP__
#ifndef __ARM_ARCHITECURE_HPP__
#define __ARM_ARCHITECURE_HPP__
#include "../CPU.hpp"
#include "../CPUState.hpp"
namespace fail {
/**
* \class ArmArchitecture
* This class adds ARM specific functionality to the base architecture.
@ -18,19 +19,6 @@ private:
void fillRegisterList();
};
class ArmCPUState : public CPUState {
public:
virtual regdata_t getRegisterContent(Register* reg) = 0;
virtual address_t getInstructionPointer() = 0;
virtual address_t getStackPointer() = 0;
/**
* Returns the current Link Register.
* @return the current lr
*/
virtual address_t getLinkRegister() = 0;
};
enum GPRegIndex {
RI_R0,
RI_R1,

View File

@ -0,0 +1,26 @@
#ifndef __ARM_CPU_STATE_HPP__
#define __ARM_CPU_STATE_HPP__
#include "../CPU.hpp"
#include "../CPUState.hpp"
namespace fail {
class ArmCPUState : public CPUState {
public:
virtual regdata_t getRegisterContent(Register* reg) = 0;
virtual address_t getInstructionPointer() = 0;
virtual address_t getStackPointer() = 0;
/**
* Returns the current Link Register.
* @return the current lr
*/
virtual address_t getLinkRegister() = 0;
};
// TODO: Enum for misc registers
} // end-of-namespace: fail
#endif // __ARM_CPU_STATE_HPP__

View File

@ -1,7 +1,8 @@
#ifndef __GEM5_ARM_CPU_HPP__
#define __GEM5_ARM_CPU_HPP__
#include "../arm/arch.hpp"
#include "../arm/Architecture.hpp"
#include "../arm/CPUState.hpp"
#include "sim/system.hh"