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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [common/] [abstract.c] - Diff between revs 1319 and 1324

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

Rev 1319 Rev 1324
Line 341... Line 341...
  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_void(memaddr);
  temp = evalsim_mem32_void(memaddr);
  if (!cur_area) {
  if (!cur_area) {
    PRINTF("EXCEPTION: read out of memory (16-bit access to %.8lx)\n", memaddr);
    PRINTF("EXCEPTION: read out of memory (32-bit access to %.8lx)\n", memaddr);
    except_handle(EXCEPT_BUSERR, cur_vadd);
    except_handle(EXCEPT_BUSERR, cur_vadd);
    temp = 0;
    temp = 0;
  }
  }
 
 
  if (!pending.valid && cur_area->log)
  if (!pending.valid && cur_area->log)
Line 515... Line 515...
unsigned short eval_direct16(unsigned long memaddr, int *breakpoint,
unsigned short eval_direct16(unsigned long memaddr, int *breakpoint,
                             int through_mmu, int through_dc)
                             int through_mmu, int through_dc)
{
{
  unsigned long temp;
  unsigned long temp;
 
 
  if (memaddr & 3) {
  if (memaddr & 1) {
    PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
    PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
      return 0;
      return 0;
  }
  }
 
 
  cur_vadd = memaddr;
  cur_vadd = memaddr;
Line 585... Line 585...
unsigned char eval_direct8(unsigned long memaddr, int *breakpoint,
unsigned char eval_direct8(unsigned long memaddr, int *breakpoint,
                           int through_mmu, int through_dc)
                           int through_mmu, int through_dc)
{
{
  unsigned char temp;
  unsigned char temp;
 
 
  if (memaddr & 3) {
 
    PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
 
    return 0;
 
  }
 
 
 
  cur_vadd = memaddr;
  cur_vadd = memaddr;
 
 
  if (through_mmu)
  if (through_mmu)
    memaddr = peek_into_dtlb(memaddr, 0, through_dc);
    memaddr = peek_into_dtlb(memaddr, 0, through_dc);
 
 
Line 807... Line 802...
  if (!through_dc)
  if (!through_dc)
    PRINTF("WARNING: statistics might not be OK\n");
    PRINTF("WARNING: statistics might not be OK\n");
  dc_simulate_write(memaddr, value, 4);
  dc_simulate_write(memaddr, value, 4);
 
 
  if (cur_area && cur_area->log)
  if (cur_area && cur_area->log)
    fprintf (cur_area->log, "[%08lx] -> write %08lx\n", memaddr, value);
    fprintf (cur_area->log, "[%08lx] -> DIRECT write %08lx\n", memaddr, value);
}
}
 
 
 
 
/* Set mem, 16-bit. Big endian version. */
/* Set mem, 16-bit. Big endian version. */
 
 
Line 847... Line 842...
 */
 */
void set_direct16(unsigned long memaddr, unsigned short value, int* breakpoint,
void set_direct16(unsigned long memaddr, unsigned short value, int* breakpoint,
                  int through_mmu, int through_dc)
                  int through_mmu, int through_dc)
{
{
 
 
  if (memaddr & 3) {
  if (memaddr & 1) {
    PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
    PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
    return;
    return;
  }
  }
 
 
  cur_vadd = memaddr;
  cur_vadd = memaddr;
Line 868... Line 863...
  if (!through_dc)
  if (!through_dc)
    PRINTF("WARNING: statistics might not be OK\n");
    PRINTF("WARNING: statistics might not be OK\n");
  dc_simulate_write(memaddr, value, 2);
  dc_simulate_write(memaddr, value, 2);
 
 
  if (cur_area && cur_area->log)
  if (cur_area && cur_area->log)
    fprintf (cur_area->log, "[%08lx] -> write %08x\n", memaddr, value);
    fprintf (cur_area->log, "[%08lx] -> DIRECT write %08x\n", memaddr, value);
}
}
 
 
/* Set mem, 8-bit. */
/* Set mem, 8-bit. */
 
 
void set_mem8(unsigned long memaddr, unsigned char value, int* breakpoint)
void set_mem8(unsigned long memaddr, unsigned char value, int* breakpoint)
Line 901... Line 896...
 */
 */
void set_direct8(unsigned long memaddr, unsigned char value, int* breakpoint,
void set_direct8(unsigned long memaddr, unsigned char value, int* breakpoint,
                 int through_mmu, int through_dc)
                 int through_mmu, int through_dc)
{
{
 
 
  if (memaddr & 3) {
 
    PRINTF("%s:%d %s(): ERR unaligned access\n", __FILE__, __LINE__, __FUNCTION__);
 
    return;
 
  }
 
 
 
  cur_vadd = memaddr;
  cur_vadd = memaddr;
 
 
  if (through_mmu) {
  if (through_mmu) {
    /* 0 - no write access, we do not want a DPF exception do we ;)
    /* 0 - no write access, we do not want a DPF exception do we ;)
     */
     */
Line 922... Line 912...
  if (!through_dc)
  if (!through_dc)
    PRINTF("WARNING: statistics might not be OK\n");
    PRINTF("WARNING: statistics might not be OK\n");
  dc_simulate_write(memaddr, value, 1);
  dc_simulate_write(memaddr, value, 1);
 
 
  if (cur_area && cur_area->log)
  if (cur_area && cur_area->log)
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
    fprintf (cur_area->log, "[%08x] -> DIRECT write %08x\n", memaddr, value);
}
}
 
 
 
 
void dumpmemory(unsigned int from, unsigned int to, int disasm, int nl)
void dumpmemory(unsigned int from, unsigned int to, int disasm, int nl)
{
{

powered by: WebSVN 2.1.0

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