Architecture changes (only gem5 implementation right now):

- The register manager is gone. It's functionality is now encapsulated in the
  CPU classes.
- For the client, there is the ConcreteCPU class that encapsulates the access
  to the CPU state (including registers) and architecture details. The
  correspondig objects for the CPUs inside the simulator can be accessed
  through the SimulatorController.getCPU() function.
- Listener got a new ConcreteCPU* member to filter for which CPU the events
  should fire. The default NULL is used as wildcard for all aviable CPUs. The
  events respectively got a ConcreteCPU* member to indicate which CPU really
  fired the event.
- For the server, there is CPUArchitecture to access the architecture details.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1966 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
friemel
2012-12-02 17:50:46 +00:00
parent fc1d21fe53
commit b052c0494b
26 changed files with 732 additions and 339 deletions

70
src/core/sal/CPUState.hpp Normal file
View File

@ -0,0 +1,70 @@
#ifndef __CPU_STATE_HPP__
#define __CPU_STATE_HPP__
#include <cstring>
#include <vector>
#include "Register.hpp"
namespace fail {
/**
* \class CPUArchitecture
* This is the base class for the CPU state without any architecture specific additions. It contains
* pure virtual functions for e.g. register acces and have to be overridden in the backend
* implementation.
*/
class CPUState
{
public:
/**
* Gets the content of the passed Register.
* @param reg the register to get the content from
*/
virtual regdata_t getRegisterContent(Register* reg) = 0;
/**
* Writes the passed value into the given register.
* @param reg the register that should be written to
* @param value the value that should be written into the register
*/
virtual void setRegisterContent(Register* reg, regdata_t value) = 0;
/**
* Returns the current instruction pointer.
* @return the current eip
*/
virtual address_t getInstructionPointer() = 0;
/**
* Returns the top address of the stack.
* @return the starting address of the stack
*/
virtual address_t getStackPointer() = 0;
/**
* Check whether the interrupt should be suppressed.
* @param interruptNum the interrupt-type id
* @return \c true if the interrupt is suppressed, \c false oterwise
*/
bool isSuppressedInterrupt(unsigned interruptNum);
/**
* Add a Interrupt to the list of suppressed.
* @param interruptNum the interrupt-type id
* @return \c true if sucessfully added, \c false otherwise (already
* existing)
*/
bool addSuppressedInterrupt(unsigned interruptNum);
/**
* Remove a Interrupt from the list of suppressed.
* @param interruptNum the interrupt-type id
* @return \c true if sucessfully removed, \c false otherwise (not found)
*/
bool removeSuppressedInterrupt(unsigned interruptNum);
protected:
std::vector<unsigned> m_SuppressedInterrupts;
};
// FIXME (see CPU.cc): Weird, homeless global variable
extern int interrupt_to_fire;
} // end-of-namespace: fail
#endif