coding style fixed, some FIXMEs and comments added.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1974 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-12-12 13:08:17 +00:00
parent fb4ba0b104
commit 25f75b299c
7 changed files with 22 additions and 17 deletions

View File

@ -36,6 +36,7 @@ public:
* @see getType() * @see getType()
*/ */
void addRegister(Register* reg); void addRegister(Register* reg);
// FIXME: make this protected? no need to modify the register config at runtime...
/** /**
* Retrieves the \a i-th register. * Retrieves the \a i-th register.
* @return a pointer to the \a i-th register; if \a i is invalid, an * @return a pointer to the \a i-th register; if \a i is invalid, an

View File

@ -35,21 +35,20 @@ protected:
ListenerManager m_LstList; //!< storage where listeners are being buffered ListenerManager m_LstList; //!< storage where listeners are being buffered
CoroutineManager m_Flows; //!< managed experiment flows CoroutineManager m_Flows; //!< managed experiment flows
MemoryManager *m_Mem; //!< access to memory pool MemoryManager *m_Mem; //!< access to memory pool
std::vector< ConcreteCPU* > m_CPUs; //!< list of cpus in the target system std::vector<ConcreteCPU*> m_CPUs; //!< list of CPUs in the target system
friend class ListenerManager; //!< "outsources" the listener management friend class ListenerManager; //!< "outsources" the listener management
public: public:
SimulatorController() SimulatorController() : m_Mem(NULL) { }
: m_Mem(NULL) { } SimulatorController(MemoryManager* mem) : m_Mem(mem) { }
SimulatorController(MemoryManager* mem)
: m_Mem(mem) { }
virtual ~SimulatorController() virtual ~SimulatorController()
{ {
std::vector< ConcreteCPU* >::iterator it = m_CPUs.begin(); std::vector<ConcreteCPU*>::iterator it = m_CPUs.begin();
while(it != m_CPUs.end()) while (it != m_CPUs.end()) {
{
delete *it; delete *it;
it = m_CPUs.erase(it); it = m_CPUs.erase(it);
} }
// FIXME: This expects the "ConcreteCPU" objects to be allocated on the heap...
// This should be part of the derived class...?
} }
/** /**
* @brief Initialization function each implementation needs to call on * @brief Initialization function each implementation needs to call on
@ -146,8 +145,9 @@ public:
*/ */
bool addCPU(ConcreteCPU* cpu); bool addCPU(ConcreteCPU* cpu);
/** /**
* Gets the CPU with the provided id. * Gets the CPU with the provided \c id.
* @oaram id the id of the CPU to get * @param id the id of the CPU to get
* @return a reference to the requested CPU object
*/ */
ConcreteCPU& getCPU(size_t id) const; ConcreteCPU& getCPU(size_t id) const;
/** /**

View File

@ -20,8 +20,8 @@ void ArmArchitecture::fillRegisterList()
ArmArchitecture::~ArmArchitecture() ArmArchitecture::~ArmArchitecture()
{ {
std::vector< Register* >::iterator it = m_Registers.begin(); for (std::vector<Register*>::iterator it = m_Registers.begin();
while (it != m_Registers.end()) { it != m_Registers.end(); it++)
delete *it; delete *it;
it = m_Registers.erase(it); it = m_Registers.erase(it);
} }

View File

@ -19,6 +19,10 @@ private:
void fillRegisterList(); void fillRegisterList();
}; };
/**
* \enum GPRegIndex
* TODO.
*/
enum GPRegIndex { enum GPRegIndex {
RI_R0, RI_R0,
RI_R1, RI_R1,

View File

@ -43,7 +43,9 @@ private:
BX_CPU_C *m_CPUContext; //!< Additional information that is passed on occurence of a BPEvent BX_CPU_C *m_CPUContext; //!< Additional information that is passed on occurence of a BPEvent
bxInstruction_c *m_CurrentInstruction; //!< dito. bxInstruction_c *m_CurrentInstruction; //!< dito.
public: public:
// Initialize the controller. /**
* Initialize the controller, i.e. add the number of simulated CPUs.
*/
BochsController(); BochsController();
~BochsController(); ~BochsController();
/* ******************************************************************** /* ********************************************************************

View File

@ -22,8 +22,7 @@ public:
/** /**
* Constructs a new register object. * Constructs a new register object.
* @param id the global unique id * @param id the global unique id
* @param width width of the register (8, 16, 32 or 64 bit should * @param width width of the register (8, 16, 32 or 64 bit should suffice)
* suffice)
* @param link pointer to bochs interal register memory * @param link pointer to bochs interal register memory
* @param t type of the register * @param t type of the register
*/ */

View File

@ -11,7 +11,7 @@ namespace fail {
class Gem5ArmCPU : public ArmArchitecture, public ArmCPUState { class Gem5ArmCPU : public ArmArchitecture, public ArmCPUState {
public: public:
// TODO: comments // TODO: comments
Gem5ArmCPU(unsigned int id, System* system) : m_Id(id), m_System(system) {} Gem5ArmCPU(unsigned int id, System* system) : m_Id(id), m_System(system) { }
regdata_t getRegisterContent(Register* reg); regdata_t getRegisterContent(Register* reg);
void setRegisterContent(Register* reg, regdata_t value); void setRegisterContent(Register* reg, regdata_t value);
@ -20,7 +20,6 @@ public:
address_t getLinkRegister(); address_t getLinkRegister();
unsigned int getId() { return m_Id; } unsigned int getId() { return m_Id; }
private: private:
unsigned int m_Id; unsigned int m_Id;
System* m_System; System* m_System;