OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [sim/] [ppc/] [psim.h] - Diff between revs 157 and 223

Only display areas with differences | Details | Blame | View Log

Rev 157 Rev 223
/*  This file is part of the program psim.
/*  This file is part of the program psim.
 
 
    Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
    Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
 
 
    This program is free software; you can redistribute it and/or modify
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    (at your option) any later version.
 
 
    This program is distributed in the hope that it will be useful,
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    GNU General Public License for more details.
 
 
    You should have received a copy of the GNU General Public License
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
    */
    */
 
 
 
 
#ifndef _PSIM_H_
#ifndef _PSIM_H_
#define _PSIM_H_
#define _PSIM_H_
 
 
#include "basics.h"
#include "basics.h"
 
 
 
 
/* the system object */
/* the system object */
/* typedef struct _psim psim; */
/* typedef struct _psim psim; */
/* typedef struct _device device; */
/* typedef struct _device device; */
 
 
/* when the `system' stops, find out why.  FIXME - at this point this
/* when the `system' stops, find out why.  FIXME - at this point this
   is really a bit puzzling.  After all, how can there be a status
   is really a bit puzzling.  After all, how can there be a status
   when there several processors involved */
   when there several processors involved */
 
 
typedef struct _psim_status {
typedef struct _psim_status {
  int cpu_nr;
  int cpu_nr;
  stop_reason reason;
  stop_reason reason;
  int signal;
  int signal;
  unsigned_word program_counter;
  unsigned_word program_counter;
} psim_status;
} psim_status;
 
 
 
 
/* create an initial device tree and then populate it using
/* create an initial device tree and then populate it using
   information obtained from either the command line or a file */
   information obtained from either the command line or a file */
 
 
extern device *psim_tree
extern device *psim_tree
(void);
(void);
 
 
extern char **psim_options
extern char **psim_options
(device *root,
(device *root,
 char **argv);
 char **argv);
 
 
extern void psim_command
extern void psim_command
(device *root,
(device *root,
 char **argv);
 char **argv);
 
 
 
 
extern void psim_merge_device_file
extern void psim_merge_device_file
(device *root,
(device *root,
 const char *file_name);
 const char *file_name);
 
 
extern void psim_usage
extern void psim_usage
(int verbose);
(int verbose);
 
 
 
 
/* create a new simulator from the device tree */
/* create a new simulator from the device tree */
 
 
extern psim *psim_create
extern psim *psim_create
(const char *file_name,
(const char *file_name,
 device *root);
 device *root);
 
 
 
 
/* Given the created simulator (re) initialize it */
/* Given the created simulator (re) initialize it */
 
 
extern void psim_init
extern void psim_init
(psim *system);
(psim *system);
 
 
extern void psim_stack
extern void psim_stack
(psim *system,
(psim *system,
 char **argv,
 char **argv,
 char **envp);
 char **envp);
 
 
 
 
/* Run/stop the system */
/* Run/stop the system */
 
 
extern void psim_step
extern void psim_step
(psim *system);
(psim *system);
 
 
extern void psim_run
extern void psim_run
(psim *system);
(psim *system);
 
 
extern void psim_restart
extern void psim_restart
(psim *system,
(psim *system,
 int cpu_nr);
 int cpu_nr);
 
 
extern void psim_set_halt_and_restart
extern void psim_set_halt_and_restart
(psim *system,
(psim *system,
 void *halt_jmp_buf,
 void *halt_jmp_buf,
 void *restart_jmp_buf);
 void *restart_jmp_buf);
 
 
extern void psim_clear_halt_and_restart
extern void psim_clear_halt_and_restart
(psim *system);
(psim *system);
 
 
extern void psim_stop
extern void psim_stop
(psim *system);
(psim *system);
 
 
extern void psim_halt
extern void psim_halt
(psim *system,
(psim *system,
 int cpu_nr,
 int cpu_nr,
 stop_reason reason,
 stop_reason reason,
 int signal);
 int signal);
 
 
extern int psim_last_cpu
extern int psim_last_cpu
(psim *system);
(psim *system);
 
 
extern int psim_nr_cpus
extern int psim_nr_cpus
(psim *system);
(psim *system);
 
 
 
 
extern psim_status psim_get_status
extern psim_status psim_get_status
(psim *system);
(psim *system);
 
 
 
 
/* reveal the internals of the simulation.  Grant access to the
/* reveal the internals of the simulation.  Grant access to the
   processor (cpu) device tree (device) and events (event_queue). */
   processor (cpu) device tree (device) and events (event_queue). */
 
 
extern cpu *psim_cpu
extern cpu *psim_cpu
(psim *system,
(psim *system,
 int cpu_nr);
 int cpu_nr);
 
 
extern device *psim_device
extern device *psim_device
(psim *system,
(psim *system,
 const char *path);
 const char *path);
 
 
extern event_queue *psim_event_queue
extern event_queue *psim_event_queue
(psim *system);
(psim *system);
 
 
 
 
 
 
/* Manipulate the state (registers or memory) of a processor within
/* Manipulate the state (registers or memory) of a processor within
   the system.  In the case of memory, the read/write is performed
   the system.  In the case of memory, the read/write is performed
   using the specified processors address translation tables.
   using the specified processors address translation tables.
 
 
   Where applicable, WHICH_CPU == -1 indicates all processors and
   Where applicable, WHICH_CPU == -1 indicates all processors and
   WHICH_CPU == <nr_cpus> indicates the `current' processor.
   WHICH_CPU == <nr_cpus> indicates the `current' processor.
 
 
   The register functions return the size of the register, or 0 if the
   The register functions return the size of the register, or 0 if the
   register's name is not recognized.  */
   register's name is not recognized.  */
 
 
extern int psim_read_register
extern int psim_read_register
(psim *system,
(psim *system,
 int which_cpu,
 int which_cpu,
 void *host_ordered_buf,
 void *host_ordered_buf,
 const char reg[],
 const char reg[],
 transfer_mode mode);
 transfer_mode mode);
 
 
extern int psim_write_register
extern int psim_write_register
(psim *system,
(psim *system,
 int which_cpu,
 int which_cpu,
 const void *buf,
 const void *buf,
 const char reg[],
 const char reg[],
 transfer_mode mode);
 transfer_mode mode);
 
 
extern unsigned psim_read_memory
extern unsigned psim_read_memory
(psim *system,
(psim *system,
 int which_cpu,
 int which_cpu,
 void *buf,
 void *buf,
 unsigned_word vaddr,
 unsigned_word vaddr,
 unsigned len);
 unsigned len);
 
 
extern unsigned psim_write_memory
extern unsigned psim_write_memory
(psim *system,
(psim *system,
 int which_cpu,
 int which_cpu,
 const void *buf,
 const void *buf,
 unsigned_word vaddr,
 unsigned_word vaddr,
 unsigned len,
 unsigned len,
 int violate_read_only_section);
 int violate_read_only_section);
 
 
extern void psim_print_info
extern void psim_print_info
(psim *system,
(psim *system,
 int verbose);
 int verbose);
 
 
#endif /* _PSIM_H_ */
#endif /* _PSIM_H_ */
 
 

powered by: WebSVN 2.1.0

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