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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_39/] [or1ksim/] [cpu/] [common/] [abstract.c] - Diff between revs 599 and 611

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

Rev 599 Rev 611
Line 267... Line 267...
      temp = cur_area->readfunc(memaddr) << 16;
      temp = cur_area->readfunc(memaddr) << 16;
      temp |= cur_area->readfunc(memaddr + 2);
      temp |= cur_area->readfunc(memaddr + 2);
      mem_cycles += cur_area->delayr * 2;
      mem_cycles += cur_area->delayr * 2;
      break;
      break;
    }
    }
  } else {
 
    printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
  }
  return temp;
  return temp;
}
}
 
 
unsigned short evalsim_mem16(unsigned long memaddr)
unsigned short evalsim_mem16(unsigned long memaddr)
Line 298... Line 294...
        temp &= 0xffff;
        temp &= 0xffff;
      else
      else
        temp >>= 16;
        temp >>= 16;
      break;
      break;
    }
    }
  } else {
 
    printf("EXCEPTION: read out of memory (16-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
  }
  return temp;
  return temp;
}
}
 
 
unsigned char evalsim_mem8(unsigned long memaddr)
unsigned char evalsim_mem8(unsigned long memaddr)
Line 329... Line 321...
      temp = evalsim_mem32 (memaddr & ~3ul);
      temp = evalsim_mem32 (memaddr & ~3ul);
      temp >>= 8 * (3 - (memaddr & 3));
      temp >>= 8 * (3 - (memaddr & 3));
      temp &= 0xff;
      temp &= 0xff;
      break;
      break;
    }
    }
  } else {
 
    printf("EXCEPTION: read out of memory (8-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
  }
  return temp;
  return temp;
}
}
 
 
/* Returns 32-bit values from mem array. Big endian version. */
/* Returns 32-bit values from mem array. Big endian version. */
Line 347... Line 335...
 
 
  cur_vadd = memaddr;
  cur_vadd = memaddr;
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
  temp = evalsim_mem32(memaddr);
  temp = evalsim_mem32(memaddr);
 
  if (!cur_area) {
 
    printf("EXCEPTION: read out of memory (16-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
 
 
  if (!pending.valid && cur_area->log)
  if (!pending.valid && cur_area->log)
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
  return temp;
  return temp;
Line 377... Line 371...
    return 0;
    return 0;
 
 
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
  temp = evalsim_mem32(memaddr);
  temp = evalsim_mem32(memaddr);
 
  if (!cur_area) {
 
    printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
 
 
  if (!pending.valid && cur_area->log)
  if (!pending.valid && cur_area->log)
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
  return temp;
  return temp;
Line 398... Line 398...
  cur_vadd = pc;
  cur_vadd = pc;
  IFF (config.ic.enabled) ic_simulate_fetch(memaddr);
  IFF (config.ic.enabled) ic_simulate_fetch(memaddr);
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
  temp = evalsim_mem32(memaddr);
  temp = evalsim_mem32(memaddr);
 
  if (!cur_area) {
 
    printf("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
 
 
  if (!pending.valid && cur_area->log)
  if (!pending.valid && cur_area->log)
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
  return temp;
  return temp;
Line 428... Line 434...
 
 
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
 
 
  temp = evalsim_mem16(memaddr);
  temp = evalsim_mem16(memaddr);
 
  if (!cur_area) {
 
    printf("EXCEPTION: read out of memory (16-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
 
 
  if (!pending.valid && cur_area->log)
  if (!pending.valid && cur_area->log)
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
  return temp;
  return temp;
Line 453... Line 465...
 
 
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr);  /* 28/05/01 CZ */
 
 
  temp = evalsim_mem8(memaddr);
  temp = evalsim_mem8(memaddr);
 
  if (!cur_area) {
 
    printf("EXCEPTION: read out of memory (8-bit access to %.8lx)\n", memaddr);
 
    except_handle(EXCEPT_BUSERR, cur_vadd);
 
    temp = 0;
 
  }
 
 
  if (!pending.valid && cur_area->log)
  if (!pending.valid && cur_area->log)
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
    fprintf (cur_area->log, "[%08x] -> read %08x\n", memaddr, temp);
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
    *breakpoint += CheckDebugUnit(DebugLoadData,temp);  /* MM170901 */
  return temp;
  return temp;

powered by: WebSVN 2.1.0

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