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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [toplevel.c] - Diff between revs 261 and 262

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

Rev 261 Rev 262
Line 77... Line 77...
static int gdb_read(void*,int);
static int gdb_read(void*,int);
static int gdb_write(void*,int);
static int gdb_write(void*,int);
void BlockJTAG(void);
void BlockJTAG(void);
 
 
/* CVS revision number. */
/* CVS revision number. */
const char rcsrev[] = "$Revision: 1.31 $";
const char rcsrev[] = "$Revision: 1.32 $";
 
 
/* Continuos run versus single step tracing switch. */
/* Continuos run versus single step tracing switch. */
int cont_run;
int cont_run;
 
 
/* History of execution */
/* History of execution */
Line 247... Line 247...
                       " analysis etc.\n");
                       " analysis etc.\n");
                printf(" -profile: generates profiling data.\n"); /* MM */
                printf(" -profile: generates profiling data.\n"); /* MM */
                printf(" -upr <n>: set UPR to n\n");
                printf(" -upr <n>: set UPR to n\n");
                printf(" -ver <n>: set VR[VER] to n\n");
                printf(" -ver <n>: set VR[VER] to n\n");
                printf(" -rev <n>: set VR[REV] to n\n");
                printf(" -rev <n>: set VR[REV] to n\n");
                printf(" -loadmem[@<n>] <filename>: load memory with file, "
 
                       "optionally at address <n>\n"); /* (CZ) */
 
                printf(" -nosrv: do not launch JTAG proxy server\n"); /* (CZ) */
                printf(" -nosrv: do not launch JTAG proxy server\n"); /* (CZ) */
                printf(" -srv <n>: launch JTAG proxy server on port <n>\n"); /* (CZ) */
                printf(" -srv <n>: launch JTAG proxy server on port <n>\n"); /* (CZ) */
                printf(" -initmem <n | random>: initialize memory to value "
 
                       "<n> or random\n"); /* (CZ) */
 
                exit(-1);
                exit(-1);
        }
        }
 
 
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
  initialize_readline ();       /* Bind our completer. */
  initialize_readline ();       /* Bind our completer. */
Line 285... Line 281...
        print_config();
        print_config();
        signal(SIGINT, ctrl_c);
        signal(SIGINT, ctrl_c);
        initstats();
        initstats();
        build_automata();
        build_automata();
 
 
        /* Modified by CZ on 24/05/01 ... if a filename is
  /* Initialize memory */
           specified, behave as the simulator always has. This way,
  {
           no existing test suites should be broken. If a filename
 
           is not specified, default to the new style behavior. Let
 
           the simulator start up and execute garbage, the same way
 
           a real CPU would. This should maximize the reality of
 
           the capabilities. In this mode, we will expect that
 
           someone will attach to us over the JTAG Proxy interface
 
           and begin debugging that way. */
 
 
 
        if(config.filename) {
 
          endaddr = loadcode(config.filename, 0, 0); /* MM170901 always load at address zero.  */
 
          if (endaddr == -1) {
 
            printf("Problems loading boot code.\n");
 
            exit(1);
 
          }
 
        } else {
 
          extern struct dev_memarea *dev_list;
          extern struct dev_memarea *dev_list;
          int i;
          int i;
          if(config.random_mem) {
          if(config.memory.type == MT_RANDOM) {
                  unsigned int val = 0;
                  unsigned int val = 0;
                  int seed = time(NULL);
 
                        int breakpoint = 0;
 
 
 
                  srandom(seed);
      if (config.memory.random_seed == -1) {
 
        config.memory.random_seed = time(NULL);
                  /* Print out the seed just in case we ever need to debug */
                  /* Print out the seed just in case we ever need to debug */
                  printf("Seeding random generator with value %d\n",seed);
                    printf("Seeding random generator with value %d\n", config.memory.random_seed);
 
                  }
 
                  srandom(config.memory.random_seed);
 
 
                  for (cur_area = dev_list; cur_area; cur_area = cur_area->next)
                  for (cur_area = dev_list; cur_area; cur_area = cur_area->next)
        for(i = 0; i < cur_area->size; i++) {
        for(i = 0; i < cur_area->size; i++) {
          val = random();
          val = random();
                      if(random() > RAND_MAX/2)
          setsim_mem8(i + cur_area->addr_compare, val & 0xFF);
                        val |= 0x80000000;
 
          set_mem8(i + cur_area->addr_compare, val, &breakpoint);
 
        }
        }
    } else if(config.pattern_mem) {
    } else if(config.memory.type == MT_PATTERN) {
                        int breakpoint = 0;
 
                  for (cur_area = dev_list; cur_area; cur_area = cur_area->next)
                  for (cur_area = dev_list; cur_area; cur_area = cur_area->next)
        for(i = 0; i < cur_area->size; i++)
        for(i = 0; i < cur_area->size; i++)
          set_mem8(i + cur_area->addr_compare, config.pattern_mem, &breakpoint);
          setsim_mem8(i + cur_area->addr_compare, config.memory.pattern);
    } else {
    } else {
                        int breakpoint = 0;
      fprintf(stderr, "Invalid memory configuration type.\n");
                  for (cur_area = dev_list; cur_area; cur_area = cur_area->next)
            exit(1);
        for(i = 0; i < cur_area->size; i++)
    }
          set_mem8(i + cur_area->addr_compare, 0, &breakpoint);
  }
 
 
 
        if(config.filename) {
 
          endaddr = loadcode(config.filename, 0, 0); /* MM170901 always load at address zero.  */
 
          if (endaddr == -1) {
 
            fprintf(stderr, "Problems loading boot code.\n");
 
            exit(1);
    }
    }
  }
  }
 
 
        uart_reset();
        uart_reset();
        dma_reset();
        dma_reset();

powered by: WebSVN 2.1.0

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