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 382 and 383

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

Rev 382 Rev 383
Line 562... Line 562...
  FILE *f;
  FILE *f;
  unsigned long memory_needed = 0;
  unsigned long memory_needed = 0;
  char *home = getenv("HOME");
  char *home = getenv("HOME");
  char ctmp[256];
  char ctmp[256];
  int local = 1;
  int local = 1;
  int gce = 0;
  int gce = -1;
  sprintf(ctmp, "%s/.or1k/%s", home, filename);
  sprintf(ctmp, "%s/.or1k/%s", home, filename);
  if ((f = fopen (filename, "rt")) != NULL
  if ((f = fopen (filename, "rt")) != NULL
      || home != NULL && !(local = 0) && (f = fopen (ctmp, "rt")) != NULL) {
      || home != NULL && !(local = 0) && (f = fopen (ctmp, "rt")) != NULL) {
    unsigned long start, length;
    unsigned long start, length;
    char type[100];
    char type[100];
    int nparam;
    int nparam;
    int rd, wd, ce;
    int rd, wd, ce;
    if (config.sim.verbose)
    if (config.sim.verbose)
      printf ("Reading memory table from '%s':\n", local ? filename : ctmp);
      printf ("Reading memory table from '%s':\n", local ? filename : ctmp);
    while ((nparam = fscanf (f, "%08x %08x %s %i %i %i\n", &start, &length, &type, &ce, &rd, &wd)) >= 3 && nparam <= 6) {
      while ((nparam = fscanf (f, ">%08x %08x %s %i %i %i\n", &start, &length, &type, &ce, &rd, &wd)) >= 3 && nparam <= 6) {
      if (nparam < 4)
      if (nparam < 4)
        ce = gce + 1;
        ce = gce + 1;
      if (nparam < 5)
      if (nparam < 5)
        rd = 1;
        rd = 1;
      if (nparam < 6)
      if (nparam < 6)
        wd = 1;
        wd = 1;
 
 
      gce = ce;
      gce = ce;
      printf ("%08X %08X (%i KB): %s (activated by CE%i; read delay = %icyc, write delay = %icyc)\n", start, length, length >> 10, type, ce, rd, wd);
      printf ("%08X %08X (%i KB): %s (activated by CE%i; read delay = %icyc, write delay = %icyc)\n",
 
        start, length, length >> 10, type, ce, rd, wd);
      register_memoryarea(start, length, 1, &simmem_read_byte, &simmem_write_byte);
      register_memoryarea(start, length, 1, &simmem_read_byte, &simmem_write_byte);
      cur_area->misc = memory_needed;
      cur_area->misc = memory_needed;
      memory_needed += cur_area->size;
      memory_needed += cur_area->size;
    }
    }
    fclose (f);
    fclose (f);

powered by: WebSVN 2.1.0

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