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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_67/] [or1ksim/] [sim-cmd.c] - Diff between revs 1353 and 1363

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

Rev 1353 Rev 1363
Line 65... Line 65...
#include "ethernet.h"
#include "ethernet.h"
#include "gpio.h"
#include "gpio.h"
#include "atahost.h"
#include "atahost.h"
#include "ps2kbd.h"
#include "ps2kbd.h"
 
 
 
struct sim_stat {
 
  void (*stat_func)(void *dat);
 
  void *dat;
 
  struct sim_stat *next;
 
};
 
 
 
static struct sim_stat *sim_stats = NULL;
 
 
 
/* Registers a status printing callback */
 
void reg_sim_stat(void (*stat_func)(void *dat), void *dat)
 
{
 
  struct sim_stat *new = malloc(sizeof(struct sim_stat));
 
 
 
  if(!new) {
 
    fprintf(stderr, "reg_sim_stat: Out-of-memory\n");
 
    exit(1);
 
  }
 
 
 
  new->stat_func = stat_func;
 
  new->dat = dat;
 
  new->next = sim_stats;
 
  sim_stats = new;
 
}
 
 
extern char *disassembled;
extern char *disassembled;
static void debugmem( oraddr_t from, oraddr_t to )
static void debugmem( oraddr_t from, oraddr_t to )
{
{
  int i;
  int i;
  PRINTF("starting to dump mem...\n");
  PRINTF("starting to dump mem...\n");
Line 384... Line 408...
  return 0;
  return 0;
}
}
 
 
static int sim_cmd_info(int argc, char **argv) /* configuration info */
static int sim_cmd_info(int argc, char **argv) /* configuration info */
{
{
 
  struct sim_stat *cur_stat = sim_stats;
 
 
  /* Display info about various modules */
  /* Display info about various modules */
  sprs_status();
  sprs_status();
  PRINTF ("\n");
  PRINTF ("\n");
  memory_table_status ();
  memory_table_status ();
  if (config.immu.enabled) itlb_status(-1);
  if (config.immu.enabled) itlb_status(-1);
Line 403... Line 429...
  if (config.ndmas) dma_status();
  if (config.ndmas) dma_status();
  if (config.nethernets) eth_status();
  if (config.nethernets) eth_status();
  if (config.ngpios) gpio_status();
  if (config.ngpios) gpio_status();
  if (config.natas) ata_status();
  if (config.natas) ata_status();
  kbd_info();
  kbd_info();
 
 
 
  while(cur_stat) {
 
    cur_stat->stat_func(cur_stat->dat);
 
    cur_stat = cur_stat->next;
 
  }
 
 
  return 0;
  return 0;
}
}
 
 
#if !FAST_SIM
#if !FAST_SIM
static int sim_cmd_debug(int argc, char **argv) /* debug mode */
static int sim_cmd_debug(int argc, char **argv) /* debug mode */

powered by: WebSVN 2.1.0

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