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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [toplevel.c] - Diff between revs 341 and 344

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

Rev 341 Rev 344
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.44 $";
const char rcsrev[] = "$Revision: 1.45 $";
 
 
/* 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 79... Line 79...
  "r",
  "r",
  "dv",
  "dv",
  0
  0
};
};
 
 
inline void debug(const char *format, ...)
inline void debug(int level, const char *format, ...)
{
{
  char *p;
  char *p;
  va_list ap;
  va_list ap;
 
 
  if (config.sim.debug) {
  if (config.sim.debug >= level) {
    if ((p = malloc(1000)) == NULL)
    if ((p = malloc(1000)) == NULL)
      return;
      return;
    va_start(ap, format);
    va_start(ap, format);
    (void) vsnprintf(p, 1000, format, ap);
    (void) vsnprintf(p, 1000, format, ap);
    va_end(ap);
    va_end(ap);
    printf("%s\n", p);
    printf("%s", p);
    fflush(stdout);
    fflush(stdout);
    free(p);
    free(p);
  } else {
  } else {
#if DEBUG
#if DEBUG
  if ((p = malloc(1000)) == NULL)
  if ((p = malloc(1000)) == NULL)
Line 634... Line 634...
      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) {
          unsigned int addr;
          unsigned int addr;
          if (cont_run > 0) cont_run--;
          if (cont_run > 0) cont_run--;
          if(fetch()) {
          if(fetch()) {
 
            printf ("Breakpoint hit.\n");
            cont_run = 0; /* memory breakpoint encountered */
            cont_run = 0; /* memory breakpoint encountered */
            break;
            break;
          }
          }
          addr = iqueue[0].insn_addr;
          addr = iqueue[0].insn_addr;
 
 

powered by: WebSVN 2.1.0

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