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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_1_x/] [or1ksim/] [cpu/] [common/] [abstract.c] - Diff between revs 970 and 992

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

Rev 970 Rev 992
Line 304... Line 304...
 
 
  memaddr = dmmu_translate(memaddr, 0);
  memaddr = dmmu_translate(memaddr, 0);
  if (pending.valid)
  if (pending.valid)
    return 0;
    return 0;
 
 
 
  if (config.dc.enabled)
  temp = dc_simulate_read(memaddr, 4);
  temp = dc_simulate_read(memaddr, 4);
 
  else {
 
    temp = evalsim_mem32(memaddr);
  if (!cur_area) {
  if (!cur_area) {
    printf("EXCEPTION: read out of memory (32-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)
 
    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 332... Line 334...
  cur_vadd = pc;
  cur_vadd = pc;
  if (config.debug.enabled)
  if (config.debug.enabled)
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugLoadAddress,memaddr); /* 28/05/01 CZ */
  if (config.ic.enabled)
  if (config.ic.enabled)
    temp = ic_simulate_fetch(memaddr);
    temp = ic_simulate_fetch(memaddr);
  else
  else {
    temp = evalsim_mem32(memaddr);
    temp = evalsim_mem32(memaddr);
  if (!cur_area) {
  if (!cur_area) {
    printf("EXCEPTION: read out of memory (32-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)
 
    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 370... Line 371...
 
 
  memaddr = dmmu_translate(memaddr, 0);
  memaddr = dmmu_translate(memaddr, 0);
  if (pending.valid)
  if (pending.valid)
    return 0;
    return 0;
 
 
 
  if (config.dc.enabled)
  temp = (unsigned short)dc_simulate_read(memaddr, 2);
  temp = (unsigned short)dc_simulate_read(memaddr, 2);
 
  else {
 
    temp = evalsim_mem16(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 (16-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)
 
    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 402... Line 405...
 
 
  memaddr = dmmu_translate(memaddr, 0);
  memaddr = dmmu_translate(memaddr, 0);
  if (pending.valid)
  if (pending.valid)
    return 0;
    return 0;
 
 
 
  if (config.dc.enabled)
  temp = (unsigned char)dc_simulate_read(memaddr, 1);
  temp = (unsigned char)dc_simulate_read(memaddr, 1);
 
  else {
 
    temp = evalsim_mem8(memaddr);
  if (!cur_area) {
  if (!cur_area) {
    printf("EXCEPTION: read out of memory (8-bit access to %.8lx)\n", memaddr);
    printf("EXCEPTION: read out of memory (8-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)
 
    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 523... Line 528...
  if (config.debug.enabled) {
  if (config.debug.enabled) {
    *breakpoint += CheckDebugUnit(DebugStoreAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugStoreAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugStoreData,value);
    *breakpoint += CheckDebugUnit(DebugStoreData,value);
  }
  }
 
 
 
  dc_simulate_write(memaddr, value, 4);
 
 
  if (cur_area->log)
  if (cur_area->log)
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
 
 
  dc_simulate_write(memaddr, value, 4);
 
}
}
 
 
/* Set mem, 16-bit. Big endian version. */
/* Set mem, 16-bit. Big endian version. */
 
 
void set_mem16(unsigned long memaddr, unsigned short value,int* breakpoint)
void set_mem16(unsigned long memaddr, unsigned short value,int* breakpoint)
Line 552... Line 557...
  if (config.debug.enabled) {
  if (config.debug.enabled) {
    *breakpoint += CheckDebugUnit(DebugStoreAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugStoreAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugStoreData,value);
    *breakpoint += CheckDebugUnit(DebugStoreData,value);
  }
  }
 
 
 
  dc_simulate_write(memaddr, (unsigned long)value, 2);
 
 
  if (cur_area->log)
  if (cur_area->log)
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
 
 
  dc_simulate_write(memaddr, (unsigned long)value, 2);
 
}
}
 
 
/* 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 575... Line 580...
  if (config.debug.enabled) {
  if (config.debug.enabled) {
    *breakpoint += CheckDebugUnit(DebugStoreAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugStoreAddress,memaddr);  /* 28/05/01 CZ */
    *breakpoint += CheckDebugUnit(DebugStoreData,value);
    *breakpoint += CheckDebugUnit(DebugStoreData,value);
  }
  }
 
 
 
  dc_simulate_write(memaddr, (unsigned long)value, 1);
 
 
  if (cur_area->log)
  if (cur_area->log)
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
    fprintf (cur_area->log, "[%08x] -> write %08x\n", memaddr, value);
 
 
  dc_simulate_write(memaddr, (unsigned long)value, 1);
 
}
}
 
 
void dumpmemory(unsigned int from, unsigned int to, int disasm, int nl)
void dumpmemory(unsigned int from, unsigned int to, int disasm, int nl)
{
{
  unsigned int i, j;
  unsigned int i, j;

powered by: WebSVN 2.1.0

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