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

Subversion Repositories or1k

[/] [or1k/] [tags/] [tn_m001/] [or1ksim/] [toplevel.c] - Diff between revs 167 and 173

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

Rev 167 Rev 173
Line 81... Line 81...
#else  /* no DEBUGMOD_OFF */
#else  /* no DEBUGMOD_OFF */
#define GlobalMode 0
#define GlobalMode 0
#endif /* no DEBUGMOD_OFF */
#endif /* no DEBUGMOD_OFF */
 
 
/* CVS revision number. */
/* CVS revision number. */
const char rcsrev[] = "$Revision: 1.20 $";
const char rcsrev[] = "$Revision: 1.21 $";
 
 
/* 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 242... Line 242...
                printf(" -hazards: disable dependency hazards analysis\n");
                printf(" -hazards: disable dependency hazards analysis\n");
                printf(" -history: disable instruction stream history analysis\n");
                printf(" -history: disable instruction stream history analysis\n");
                printf(" -superscalar: disable superscalar analysis\n");
                printf(" -superscalar: disable superscalar analysis\n");
                printf(" -fast: disable BPB, BTIC, SLP, dependency hazards, history"
                printf(" -fast: disable BPB, BTIC, SLP, dependency hazards, history"
                       " analysis etc.\n");
                       " analysis etc.\n");
 
                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, "
                printf(" -loadmem[@<n>] <filename>: load memory with file, "
                       "optionally at address <n>\n"); /* (CZ) */
                       "optionally at address <n>\n"); /* (CZ) */
Line 265... Line 266...
      serverPort = config.server_port;
      serverPort = config.server_port;
      if(server_fd = GetServerSocket("or1ksim","tcp",serverPort))
      if(server_fd = GetServerSocket("or1ksim","tcp",serverPort))
        printf("JTAG Proxy server started on port %d\n",serverPort);
        printf("JTAG Proxy server started on port %d\n",serverPort);
    }
    }
 
 
 
  if(config.profile) {
 
    config.fprof = fopen("sim-profile","wt+");
 
    if(!config.fprof) {
 
      config.profile = 0;
 
      printf("Problems opening profile file. Profiling disabled. \n");
 
    } else
 
      fprintf(config.fprof, "+00000000 FFFFFFFF FFFFFFFF main\n");
 
  }
 
 
        print_config();
        print_config();
        signal(SIGINT, ctrl_c);
        signal(SIGINT, ctrl_c);
        initstats();
        initstats();
        build_automata();
        build_automata();
 
 
Line 414... Line 424...
                  if(!server_fd)
                  if(!server_fd)
                    printf ("(sim) ");
                    printf ("(sim) ");
                  linestr = fgets(b2, sizeof b2, stdin);
                  linestr = fgets(b2, sizeof b2, stdin);
#endif
#endif
                } else
                } else
                        strcpy(linestr = b2, "run 100000000 hush");
                        strcpy(linestr = b2, "run -1 hush");
 
 
                if (!linestr)
                if (!linestr)
                        break;
                        break;
                linestr = stripwhite (linestr);
                linestr = stripwhite (linestr);
 
 
Line 453... Line 463...
                  strcpy (&prev_str[0], linestr);
                  strcpy (&prev_str[0], linestr);
 
 
                strtoken(linestr, item1, 1);
                strtoken(linestr, item1, 1);
                if (strcmp(item1, "q") == 0) {   /* quit */
                if (strcmp(item1, "q") == 0) {   /* quit */
                  printf ("\n");
                  printf ("\n");
 
                  if (config.profile) {
 
                    extern int cycles;
 
                    fprintf(config.fprof,"-%08X FFFFFFFF\n", cycles);
 
                    fclose(config.fprof);
 
                  }
                  exit(0);
                  exit(0);
                } else
                } else
                if (strcmp(item1, "help") == 0)  /* help */
                if (strcmp(item1, "help") == 0)  /* help */
                        help();
                        help();
                else
                else
Line 592... Line 607...
                        strtoken(linestr, item3, 3);
                        strtoken(linestr, item3, 3);
                        if (strcmp(item3, "hush") == 0)
                        if (strcmp(item3, "hush") == 0)
                                hush = 1;
                                hush = 1;
                        else
                        else
                                hush = 0;
                                hush = 0;
                        cont_run = strtoul(item2, NULL, 0);
                        cont_run = strtol(item2, NULL, 0);
                } else
                } else
                if (strcmp(item1, "stats") == 0) { /* stats */
                if (strcmp(item1, "stats") == 0) { /* stats */
                        char item2[20];
                        char item2[20];
                        int i = 0;
                        int i = 0;
 
 
Line 635... Line 650...
                    }
                    }
 
 
                        if (!testsprbits(SPR_PMR, SPR_PMR_DME | SPR_PMR_SME)) {
                        if (!testsprbits(SPR_PMR, SPR_PMR_DME | SPR_PMR_SME)) {
                          if(cycle_delay <= 0)
                          if(cycle_delay <= 0)
                            {
                            {
                              cont_run--;
                              if (cont_run > 0) cont_run--;
                              if(fetch()) {
                              if(fetch()) {
                                cont_run = 0; /* memory breakpoint encountered */
                                cont_run = 0; /* memory breakpoint encountered */
                                break;
                                break;
                              }
                              }
                              decode_execute(&iqueue[0]);
                              decode_execute(&iqueue[0]);
Line 665... Line 680...
                }
                }
                hush = 0;
                hush = 0;
                fflush(stdout);
                fflush(stdout);
                freopen("/dev/fd/0", "w+", stdout);
                freopen("/dev/fd/0", "w+", stdout);
 
 
                if (!config.iprompt && !GlobalMode)     /* non-interactive quit in old mode */
                if (!config.iprompt && !GlobalMode) {   /* non-interactive quit in old mode */
 
                  if (config.profile) {
 
                    extern int cycles;
 
                    fprintf(config.fprof,"-%08X FFFFFFFF\n", cycles);
 
                    fclose(config.fprof);
 
                  }
                        exit(0);
                        exit(0);
 
                }
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
                if (linestr)
                if (linestr)
                        free (linestr);
                        free (linestr);
#endif
#endif
 
 

powered by: WebSVN 2.1.0

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