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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_66/] [or1ksim/] [toplevel.c] - Diff between revs 1245 and 1308

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

Rev 1245 Rev 1308
Line 18... Line 18...
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
/* Simulator commands. Help and version output. SIGINT processing.
/* Simulator commands. Help and version output. SIGINT processing.
Stdout redirection is specific to linux (I need to fix this). */
Stdout redirection is specific to linux (I need to fix this). */
 
 
#include "config.h"
 
 
 
#include <stdio.h>
#include <stdio.h>
#include <ctype.h>
#include <ctype.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <signal.h>
#include <signal.h>
#include <stdarg.h>
#include <stdarg.h>
#include <fcntl.h>
#include <fcntl.h>
#include <limits.h>
#include <limits.h>
 
#include <time.h>
 
 
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
#include <readline/readline.h>
#include <readline/readline.h>
#include <readline/history.h>
#include <readline/history.h>
#endif /* HAVE_LIBREADLINE */
#endif /* HAVE_LIBREADLINE */
 
 
 
#include "config.h"
#include "arch.h"
#include "arch.h"
#include "parse.h"
#include "parse.h"
#include "abstract.h"
#include "abstract.h"
#include "labels.h"
#include "labels.h"
#include "execute.h"
#include "execute.h"
Line 56... Line 57...
#include "sched.h"
#include "sched.h"
#include "profiler.h"
#include "profiler.h"
#include "mprofiler.h"
#include "mprofiler.h"
#include "mc.h"
#include "mc.h"
#include "atahost.h"
#include "atahost.h"
 
#include "16450.h"
 
#include "ethernet.h"
 
#include "gpio.h"
 
#include "pm.h"
 
#include "pic.h"
 
#include "stats.h"
 
#include "opcode/or32.h"
 
#include "immu.h"
 
#include "dmmu.h"
 
#include "dcache_model.h"
 
#include "icache_model.h"
 
#include "branch_predict.h"
 
#include "dumpverilog.h"
 
#include "trace.h"
 
#include "cuc.h"
 
 
/* CVS revision number. */
/* CVS revision number. */
const char rcsrev[] = "$Revision: 1.98 $";
const char rcsrev[] = "$Revision: 1.99 $";
 
 
/* History of execution */
/* History of execution */
int histexec[HISTEXEC_LEN];
int histexec[HISTEXEC_LEN];
 
 
char *sim_commands [] = {
char *sim_commands [] = {
Line 317... Line 333...
    int numu = vapi_num_unconnected (0);
    int numu = vapi_num_unconnected (0);
    if (numu) {
    if (numu) {
      PRINTF ("\nWaiting for VAPI tests with ids:\n");
      PRINTF ("\nWaiting for VAPI tests with ids:\n");
      vapi_num_unconnected (1);
      vapi_num_unconnected (1);
      PRINTF ("\n");
      PRINTF ("\n");
      while (numu = vapi_num_unconnected (0)) {
      while ((numu = vapi_num_unconnected (0))) {
        vapi_check ();
        vapi_check ();
        PRINTF ("\rStill waiting for %i VAPI test(s) to connect.       ", numu);
        PRINTF ("\rStill waiting for %i VAPI test(s) to connect.       ", numu);
        usleep (100);
        usleep (100);
      }
      }
      PRINTF ("\n");
      PRINTF ("\n");
Line 405... Line 421...
{
{
  char *linestr;
  char *linestr;
  char item1[500], b2[500], prev_str[500] = "";
  char item1[500], b2[500], prev_str[500] = "";
  char *redirstr;
  char *redirstr;
  int hush = 0;
  int hush = 0;
  int first_prompt = 1;
 
 
 
  srand(getpid());
  srand(getpid());
  init_defconfig();
  init_defconfig();
  if (parse_args(argc, argv)) {
  if (parse_args(argc, argv)) {
    PRINTF("Usage: %s [options] <filename>\n", argv[0]);
    PRINTF("Usage: %s [options] <filename>\n", argv[0]);
Line 506... Line 521...
          add_history (linestr);
          add_history (linestr);
        }
        }
      }
      }
#endif /* HAVE_LIBREADLINE */
#endif /* HAVE_LIBREADLINE */
 
 
    if (redirstr = strstr(linestr, ">")) {
    if ((redirstr = strstr(linestr, ">"))) {
      *redirstr = '\0';
      *redirstr = '\0';
      strtoken(&redirstr[1], item1, 1);
      strtoken(&redirstr[1], item1, 1);
      runtime.sim.fout = fopen(item1, "w+");
      runtime.sim.fout = fopen(item1, "w+");
      if (!runtime.sim.fout) runtime.sim.fout = stdout;
      if (!runtime.sim.fout) runtime.sim.fout = stdout;
    }
    }
Line 601... Line 616...
      static int addr = 0;
      static int addr = 0;
      int breakpoint = 0;
      int breakpoint = 0;
 
 
      strtoken(linestr, item2, 2);
      strtoken(linestr, item2, 2);
      strtoken(linestr, item3, 3);
      strtoken(linestr, item3, 3);
      if (strlen(item2))
      if (strlen(item2)) {
        if (item2[0] == '_')
        if (item2[0] == '_')
          addr = eval_label(item2);
          addr = eval_label(item2);
        else
        else
          addr = strtoul(item2, NULL, 0);
          addr = strtoul(item2, NULL, 0);
 
      }
      set_mem32(addr, strtoul(item3, NULL, 0), &breakpoint);
      set_mem32(addr, strtoul(item3, NULL, 0), &breakpoint);
    } else
    } else
    if (strcmp(item1, "cm") == 0) {      /* copy memory 2004-01-20 hpanther*/
    if (strcmp(item1, "cm") == 0) {      /* copy memory 2004-01-20 hpanther*/
          static int from=0, to=0, size=0;
          static int from=0, to=0, size=0;
      int i;
      int i;
Line 736... Line 752...
    if (strcmp (item1, "cuc") == 0) { /* run Custom Unit Compiler */
    if (strcmp (item1, "cuc") == 0) { /* run Custom Unit Compiler */
      main_cuc (runtime.sim.filename);
      main_cuc (runtime.sim.filename);
    } else
    } else
    if (strcmp(item1, "set") == 0) { /* configuration info */
    if (strcmp(item1, "set") == 0) { /* configuration info */
      char *s = linestr;
      char *s = linestr;
      int i;
 
      extern section;
 
      extern struct section sections[];
 
      while (*s != ' ' && *s) s++;
      while (*s != ' ' && *s) s++;
      set_config_command (s);
      set_config_command (s);
    } else
    } else
#endif /* !FAST_SIM */
#endif /* !FAST_SIM */
      PRINTF("%s: Unknown command.\n", linestr);
      PRINTF("%s: Unknown command.\n", linestr);

powered by: WebSVN 2.1.0

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