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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [toplevel.c] - Diff between revs 1358 and 1360

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

Rev 1358 Rev 1360
Line 75... Line 75...
#include "dumpverilog.h"
#include "dumpverilog.h"
#include "trace.h"
#include "trace.h"
#include "cuc.h"
#include "cuc.h"
 
 
/* CVS revision number. */
/* CVS revision number. */
const char rcsrev[] = "$Revision: 1.104 $";
const char rcsrev[] = "$Revision: 1.105 $";
 
 
inline void debug(int level, const char *format, ...)
inline void debug(int level, const char *format, ...)
{
{
  char *p;
  char *p;
  va_list ap;
  va_list ap;
Line 135... Line 135...
  PRINTF ("details see COPYING.\nThis is free software, and you ");
  PRINTF ("details see COPYING.\nThis is free software, and you ");
  PRINTF ("are welcome to redistribute it under certain\nconditions; ");
  PRINTF ("are welcome to redistribute it under certain\nconditions; ");
  PRINTF ("for details see COPYING.\n");
  PRINTF ("for details see COPYING.\n");
}
}
 
 
void debugmem (unsigned long from, unsigned long to );
struct sim_reset_hook {
 
  void *dat;
 
  void (*reset_hook)(void *);
 
  struct sim_reset_hook *next;
 
};
 
 
 
struct sim_reset_hook *sim_reset_hooks = NULL;
 
 
 
/* Registers a new reset hook, called when sim_reset below is called */
 
void reg_sim_reset(void (*reset_hook)(void *), void *dat)
 
{
 
  struct sim_reset_hook *new = malloc(sizeof(struct sim_reset_hook));
 
 
 
  if(!new) {
 
    fprintf(stderr, "reg_sim_reset: Out-of-memory\n");
 
    exit(1);
 
  }
 
 
 
  new->dat = dat;
 
  new->reset_hook = reset_hook;
 
  new->next = sim_reset_hooks;
 
  sim_reset_hooks = new;
 
}
 
 
/* Resets all subunits */
/* Resets all subunits */
void sim_reset (void)
void sim_reset (void)
{
{
 
  struct sim_reset_hook *cur_reset = sim_reset_hooks;
 
 
  SCHED_INIT();
  SCHED_INIT();
 
 
 
  while(cur_reset) {
 
    cur_reset->reset_hook(cur_reset->dat);
 
    cur_reset = cur_reset->next;
 
  }
 
 
  uart_reset();
  uart_reset();
  dma_reset();
  dma_reset();
  eth_reset();
  eth_reset();
  gpio_reset();
  gpio_reset();
  vga_reset ();
  vga_reset ();
Line 445... Line 475...
      sim_done();
      sim_done();
  }
  }
  sim_done();
  sim_done();
}
}
 
 
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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