OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [sim/] [command.c] - Diff between revs 82 and 83

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 82 Rev 83
Line 325... Line 325...
    }
    }
    num3 = num1 + num2;
    num3 = num1 + num2;
    num4 = num1 - num2;
    num4 = num1 - num2;
    cPrintf("add = %08X, sub = %08X\n", num3, num4);
    cPrintf("add = %08X, sub = %08X\n", num3, num4);
  } else {
  } else {
    help();
    help01();
  }
  }
}
}
 
 
 
 
static void doAssemble(char *tokens[], int n) {
static void doAssemble(char *tokens[], int n) {
Line 346... Line 346...
    if (!getHexNumber(tokens[1], &addr)) {
    if (!getHexNumber(tokens[1], &addr)) {
      cPrintf("illegal address\n");
      cPrintf("illegal address\n");
      return;
      return;
    }
    }
  } else {
  } else {
    help();
    help02();
    return;
    return;
  }
  }
  addr &= ~0x00000003;
  addr &= ~0x00000003;
  psw = cpuGetPSW();
  psw = cpuGetPSW();
  while (1) {
  while (1) {
Line 397... Line 397...
    }
    }
    if (count == 0) {
    if (count == 0) {
      return;
      return;
    }
    }
  } else {
  } else {
    help();
    help03();
    return;
    return;
  }
  }
  addr &= ~0x00000003;
  addr &= ~0x00000003;
  psw = cpuGetPSW();
  psw = cpuGetPSW();
  for (i = 0; i < count; i++) {
  for (i = 0; i < count; i++) {
Line 430... Line 430...
    }
    }
    addr &= ~0x00000003;
    addr &= ~0x00000003;
    cpuSetBreak(addr);
    cpuSetBreak(addr);
    showBreakAndTotal();
    showBreakAndTotal();
  } else {
  } else {
    help();
    help04();
  }
  }
}
}
 
 
 
 
static void doContinue(char *tokens[], int n) {
static void doContinue(char *tokens[], int n) {
Line 447... Line 447...
    if (!getHexNumber(tokens[1], &count) || count == 0) {
    if (!getHexNumber(tokens[1], &count) || count == 0) {
      cPrintf("illegal count\n");
      cPrintf("illegal count\n");
      return;
      return;
    }
    }
  } else {
  } else {
    help();
    help05();
    return;
    return;
  }
  }
  cPrintf("CPU is running, press ^C to interrupt...\n");
  cPrintf("CPU is running, press ^C to interrupt...\n");
  for (i = 0; i < count; i++) {
  for (i = 0; i < count; i++) {
    cpuRun();
    cpuRun();
Line 471... Line 471...
    if (!getHexNumber(tokens[1], &count) || count == 0) {
    if (!getHexNumber(tokens[1], &count) || count == 0) {
      cPrintf("illegal count\n");
      cPrintf("illegal count\n");
      return;
      return;
    }
    }
  } else {
  } else {
    help();
    help06();
    return;
    return;
  }
  }
  for (i = 0; i < count; i++) {
  for (i = 0; i < count; i++) {
    cpuStep();
    cpuStep();
  }
  }
Line 495... Line 495...
    }
    }
    addr &= ~0x00000003;
    addr &= ~0x00000003;
    cpuSetPC(addr);
    cpuSetPC(addr);
    showPC();
    showPC();
  } else {
  } else {
    help();
    help07();
  }
  }
}
}
 
 
 
 
static void explainPSW(Word data) {
static void explainPSW(Word data) {
Line 555... Line 555...
    cpuSetPSW(data);
    cpuSetPSW(data);
    showPSW();
    showPSW();
    showIRQ();
    showIRQ();
    explainPSW(data);
    explainPSW(data);
  } else {
  } else {
    help();
    help08();
  }
  }
}
}
 
 
 
 
static void doRegister(char *tokens[], int n) {
static void doRegister(char *tokens[], int n) {
Line 596... Line 596...
      cPrintf("illegal data\n");
      cPrintf("illegal data\n");
      return;
      return;
    }
    }
    cpuSetReg(reg, data);
    cpuSetReg(reg, data);
  } else {
  } else {
    help();
    help09();
  }
  }
}
}
 
 
 
 
static void doDump(char *tokens[], int n) {
static void doDump(char *tokens[], int n) {
Line 631... Line 631...
    }
    }
    if (count == 0) {
    if (count == 0) {
      return;
      return;
    }
    }
  } else {
  } else {
    help();
    help10();
    return;
    return;
  }
  }
  psw = cpuGetPSW();
  psw = cpuGetPSW();
  lo = addr & ~0x0000000F;
  lo = addr & ~0x0000000F;
  hi = addr + count - 1;
  hi = addr + count - 1;
Line 705... Line 705...
      return;
      return;
    }
    }
    data = tmpData;
    data = tmpData;
    mmuWriteWord(addr, data, psw & PSW_UM);
    mmuWriteWord(addr, data, psw & PSW_UM);
  } else {
  } else {
    help();
    help11();
  }
  }
}
}
 
 
 
 
static void doMemoryHalf(char *tokens[], int n) {
static void doMemoryHalf(char *tokens[], int n) {
Line 740... Line 740...
      return;
      return;
    }
    }
    data = (Half) tmpData;
    data = (Half) tmpData;
    mmuWriteHalf(addr, data, psw & PSW_UM);
    mmuWriteHalf(addr, data, psw & PSW_UM);
  } else {
  } else {
    help();
    help12();
  }
  }
}
}
 
 
 
 
static void doMemoryByte(char *tokens[], int n) {
static void doMemoryByte(char *tokens[], int n) {
Line 775... Line 775...
      return;
      return;
    }
    }
    data = (Byte) tmpData;
    data = (Byte) tmpData;
    mmuWriteByte(addr, data, psw & PSW_UM);
    mmuWriteByte(addr, data, psw & PSW_UM);
  } else {
  } else {
    help();
    help13();
  }
  }
}
}
 
 
 
 
static void doTLB(char *tokens[], int n) {
static void doTLB(char *tokens[], int n) {
Line 808... Line 808...
    cPrintf("TLB[%02d]    page  %08X    frame  %08X  %c  %c\n",
    cPrintf("TLB[%02d]    page  %08X    frame  %08X  %c  %c\n",
            index, tlbEntry.page, tlbEntry.frame,
            index, tlbEntry.page, tlbEntry.frame,
            tlbEntry.write ? 'w' : '-',
            tlbEntry.write ? 'w' : '-',
            tlbEntry.valid ? 'v' : '-');
            tlbEntry.valid ? 'v' : '-');
  } else if (n == 3) {
  } else if (n == 3) {
    help();
    help14();
  } else if (n == 4) {
  } else if (n == 4) {
    if (!getDecNumber(tokens[1], &index) || index < 0 || index >= TLB_SIZE) {
    if (!getDecNumber(tokens[1], &index) || index < 0 || index >= TLB_SIZE) {
      cPrintf("illegal TLB index\n");
      cPrintf("illegal TLB index\n");
      return;
      return;
    }
    }
Line 836... Line 836...
    cPrintf("TLB[%02d]    page  %08X    frame  %08X  %c  %c\n",
    cPrintf("TLB[%02d]    page  %08X    frame  %08X  %c  %c\n",
            index, tlbEntry.page, tlbEntry.frame,
            index, tlbEntry.page, tlbEntry.frame,
            tlbEntry.write ? 'w' : '-',
            tlbEntry.write ? 'w' : '-',
            tlbEntry.valid ? 'v' : '-');
            tlbEntry.valid ? 'v' : '-');
  } else {
  } else {
    help();
    help14();
  }
  }
}
}
 
 
 
 
static void doInit(char *tokens[], int n) {
static void doInit(char *tokens[], int n) {
Line 855... Line 855...
    graphReset();
    graphReset();
    memoryReset();
    memoryReset();
    mmuReset();
    mmuReset();
    cpuReset();
    cpuReset();
  } else {
  } else {
    help();
    help15();
  }
  }
}
}
 
 
 
 
static void doQuit(char *tokens[], int n) {
static void doQuit(char *tokens[], int n) {
  if (n == 1) {
  if (n == 1) {
    quit = true;
    quit = true;
  } else {
  } else {
    help();
    help16();
  }
  }
}
}
 
 
 
 
Command commands[] = {
Command commands[] = {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.