Fixed system register address calculation

This commit is contained in:
rkx1209 2018-03-23 13:39:05 +09:00
parent e966853ac4
commit a0d987e151
2 changed files with 5 additions and 4 deletions

View file

@ -21,7 +21,8 @@ int Interpreter::SingleStep() {
void Interpreter::Run() {
debug_print ("Running with Interpreter\n");
static uint64_t counter = 0;
uint64_t estimate = 3413800, mx = 10000;
//uint64_t estimate = 3413000, mx = 10000;
uint64_t estimate = 3414000, mx = 10000;
while (Cpu::GetState () == Cpu::State::Running) {
if (counter >= estimate){
Cpu::DumpMachine ();
@ -780,7 +781,7 @@ void IntprCallback::BranchFlag(unsigned int cond, uint64_t addr) {
/* Set PC with reg */
void IntprCallback::SetPCReg(unsigned int rt_idx) {
PC = X(rt_idx) - 4;
ns_print ("Goto: 0x%lx\n", PC + 4);
debug_print ("Goto: 0x%lx\n", PC + 4);
}
/* Super Visor Call */
@ -848,7 +849,7 @@ void IntprCallback::DupVecRegFromGen(unsigned int vd_idx, unsigned int rn_idx, i
/* Read/Write Sysreg */
void IntprCallback::ReadWriteSysReg(unsigned int rd_idx, int offset, bool read) {
uint64_t *sysr = (uint64_t *)(&SYSR + offset);
uint64_t *sysr = (uint64_t *)((uint8_t *)&SYSR + offset);
if (read) {
X(rd_idx) = *sysr;
} else {

View file

@ -29,7 +29,7 @@ State GetState() {
}
void DumpMachine() {
ARMv8::Dump ();
//ARMv8::Dump ();
if (TraceOut)
ARMv8::DumpJson (TraceOut);
}