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

Subversion Repositories or1k

[/] [or1k/] [tags/] [tn_m001/] [or1ksim/] [toplevel.c] - Diff between revs 305 and 306

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

Rev 305 Rev 306
Line 50... Line 50...
#include "coff.h"
#include "coff.h"
 
 
#include "gdbcomm.h"
#include "gdbcomm.h"
 
 
/* CVS revision number. */
/* CVS revision number. */
const char rcsrev[] = "$Revision: 1.39 $";
const char rcsrev[] = "$Revision: 1.40 $";
 
 
/* 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 171... Line 171...
  init_labels();
  init_labels();
  init_breakpoints();
  init_breakpoints();
        initstats();
        initstats();
        build_automata();
        build_automata();
 
 
  if (GDB_ENABLED) {
  if (GDB_ENABLED)
    serverPort = config.debug.server_port;
    gdbcomm_init ();
    if(server_fd = GetServerSocket("or1ksim","tcp",serverPort))
 
            printf("JTAG Proxy server started on port %d\n",serverPort);
 
  }
 
 
 
  if (config.sim.profile) {
  if (config.sim.profile) {
    config.sim.fprof = fopen(config.sim.prof_fn, "wt+");
    config.sim.fprof = fopen(config.sim.prof_fn, "wt+");
    if(!config.sim.fprof) {
    if(!config.sim.fprof) {
      config.sim.profile = 0;
      config.sim.profile = 0;
Line 331... Line 328...
  signal(SIGINT, ctrl_c);
  signal(SIGINT, ctrl_c);
  sim_init ();
  sim_init ();
 
 
        while(1) {
        while(1) {
                if (config.sim.iprompt) {
                if (config.sim.iprompt) {
                  if (GDB_ENABLED && server_fd)
                  if (GDB_ENABLED)
                    {
                    {
                      printf ("(sim) ");
                      printf ("(sim) ");
                      fflush(stdout);
                      fflush(stdout);
                      HandleServerSocket(true);  /* block & check_stdin = true */
                      HandleServerSocket(true);  /* block & check_stdin = true */
                    }
                    }
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
                  /* Must disable readline in new mode. It isn't compatible
                  /* Must disable readline in new mode. It isn't compatible
                     with non blocking environments */
                     with non blocking environments */
                  if(!server_fd)
                  if(!GDB_ENABLED)
                    linestr = readline("(sim) ");
                    linestr = readline("(sim) ");
                  else
                  else
                    linestr = fgets(b2, sizeof b2, stdin);
                    linestr = fgets(b2, sizeof b2, stdin);
#else
#else
                  if(!server_fd)
                  if(!GDB_ENABLED)
                    printf ("(sim) ");
                    printf ("(sim) ");
                  linestr = fgets(b2, sizeof b2, stdin);
                  linestr = fgets(b2, sizeof b2, stdin);
#endif
#endif
                } else
                } else
                        strcpy(linestr = b2, "run -1 hush");
                        strcpy(linestr = b2, "run -1 hush");
Line 414... Line 411...
                                        from = strtoul(item2, NULL, 0);
                                        from = strtoul(item2, NULL, 0);
                                to = from + 0x40;
                                to = from + 0x40;
                        }
                        }
                        if (strlen(item3))
                        if (strlen(item3))
                                to = strtoul(item3, NULL, 0);
                                to = strtoul(item3, NULL, 0);
                        dumpmemory(from, to, 0);
                        dumpmemory(from, to, 0, 1);
                        printf("\n");
                        printf("\n");
                } else
                } else
                if (strcmp(item1, "dv") == 0) {/* dump memory as verilog*/
                if (strcmp(item1, "dv") == 0) {/* dump memory as verilog*/
                        char item2[20];
                        char item2[20];
                        char item3[20];
                        char item3[20];
Line 534... Line 531...
                        config.sim.debug ^= 1;
                        config.sim.debug ^= 1;
                } else
                } else
                if (strcmp(item1, "hist") == 0) {        /* dump history */
                if (strcmp(item1, "hist") == 0) {        /* dump history */
                        int i;
                        int i;
                        for(i = HISTEXEC_LEN; i; i--)
                        for(i = HISTEXEC_LEN; i; i--)
                                dumpmemory(histexec[i - 1], histexec[i - 1] + 4, 1);
                                dumpmemory(histexec[i - 1], histexec[i - 1] + 4, 1, 1);
                        printf("\n");
                        printf("\n");
                } else
                } else
                if (strcmp(item1, "run") == 0) { /* run */
                if (strcmp(item1, "run") == 0) { /* run */
                        char item2[20];
                        char item2[20];
                        char item3[20];
                        char item3[20];
Line 773... Line 770...
{
{
  int offset = where_history ();
  int offset = where_history ();
  HIST_ENTRY *hist;
  HIST_ENTRY *hist;
 
 
  if (hist = history_get (offset))
  if (hist = history_get (offset))
    {
 
      return dupstr (hist->line);
      return dupstr (hist->line);
    }
 
  return 0;
  return 0;
}
}
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

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