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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [cpu/] [common/] [abstract.c] - Diff between revs 1452 and 1484

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

Rev 1452 Rev 1484
Line 334... Line 334...
  return temp;
  return temp;
}
}
 
 
/* Returns 32-bit values from mem array. Big endian version.
/* Returns 32-bit values from mem array. Big endian version.
 *
 *
 * this function is only used in dumpmemory() below, so it's
 
 * safe to asume it's for simulator purposes access only,
 
 * hence the use of eval_mem32_void()
 
 *
 
 * STATISTICS OK.
 
 */
 
static uint32_t read_mem(oraddr_t memaddr, int* breakpoint)
 
{
 
  uint32_t temp;
 
 
 
  cur_vadd = memaddr;
 
  if (config.debug.enabled)
 
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
 
  temp = evalsim_mem32_void(memaddr);
 
  if (!cur_area) {
 
    PRINTF("EXCEPTION: read out of memory (32-bit access to %"PRIxADDR")\n",
 
           memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  } else if (cur_area->log)
 
    fprintf (cur_area->log, "[%"PRIxADDR"] -> read %08"PRIx32"\n", memaddr, temp);
 
 
 
  if (config.debug.enabled)
 
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
 
  return temp;
 
}
 
 
 
/* Returns 32-bit values from mem array. Big endian version.
 
 *
 
 * STATISTICS OK (only used for cpu_access, that is architectural access)
 * STATISTICS OK (only used for cpu_access, that is architectural access)
 */
 */
uint32_t eval_mem32(oraddr_t memaddr,int* breakpoint)
uint32_t eval_mem32(oraddr_t memaddr,int* breakpoint)
{
{
  uint32_t temp;
  uint32_t temp;
Line 1006... Line 977...
void dumpmemory(oraddr_t from, oraddr_t to, int disasm, int nl)
void dumpmemory(oraddr_t from, oraddr_t to, int disasm, int nl)
{
{
  oraddr_t i, j;
  oraddr_t i, j;
  struct label_entry *tmp;
  struct label_entry *tmp;
  int ilen = disasm ? 4 : 16;
  int ilen = disasm ? 4 : 16;
 
  int breakpoint;
 
 
  for(i = from; i < to; i += ilen) {
  for(i = from; i < to; i += ilen) {
    PRINTF("%"PRIxADDR": ", i);
    PRINTF("%"PRIxADDR": ", i);
    for (j = 0; j < ilen;) {
    for (j = 0; j < ilen;) {
      if (!disasm) {
      if (!disasm) {
Line 1017... Line 989...
        if (verify_memoryarea(i + j)) {
        if (verify_memoryarea(i + j)) {
          struct label_entry *entry;
          struct label_entry *entry;
          entry = get_label(i + j);
          entry = get_label(i + j);
          if (entry)
          if (entry)
            PRINTF("(%s)", entry->name);
            PRINTF("(%s)", entry->name);
          PRINTF("%02"PRIx8" ", evalsim_mem8(i + j));
          PRINTF("%02"PRIx8" ", eval_direct8(i + j, &breakpoint, 0, 0));
        } else PRINTF("XX ");
        } else PRINTF("XX ");
        j++;
        j++;
      } else {
      } else {
        int breakpoint;
        uint32_t _insn = eval_direct32(i, &breakpoint, 0, 0);
        uint32_t _insn = read_mem(i, &breakpoint);
 
        int index = insn_decode (_insn);
        int index = insn_decode (_insn);
        int len = insn_len (index);
        int len = insn_len (index);
 
 
        tmp = NULL;
        tmp = NULL;
        if (verify_memoryarea(i + j)) {
        if (verify_memoryarea(i + j)) {

powered by: WebSVN 2.1.0

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