|
|
@ -17,12 +17,20 @@ public:
|
|
|
|
~ARM_Interface() {
|
|
|
|
~ARM_Interface() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Runs the CPU for the given number of instructions
|
|
|
|
|
|
|
|
* @param num_instructions Number of instructions to run
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void Run(int num_instructions) {
|
|
|
|
|
|
|
|
ExecuteInstructions(num_instructions);
|
|
|
|
|
|
|
|
m_num_instructions += num_instructions;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Step CPU by one instruction
|
|
|
|
/// Step CPU by one instruction
|
|
|
|
void Step() {
|
|
|
|
void Step() {
|
|
|
|
ExecuteInstruction();
|
|
|
|
Run(1);
|
|
|
|
m_num_instructions++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Set the Program Counter to an address
|
|
|
|
* Set the Program Counter to an address
|
|
|
|
* @param addr Address to set PC to
|
|
|
|
* @param addr Address to set PC to
|
|
|
@ -68,8 +76,11 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
/// Execture next instruction
|
|
|
|
/**
|
|
|
|
virtual void ExecuteInstruction() = 0;
|
|
|
|
* Executes the given number of instructions
|
|
|
|
|
|
|
|
* @param num_instructions Number of instructions to executes
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void ExecuteInstructions(int num_instructions) = 0;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|