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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [h8300/] [inst.h] - Diff between revs 227 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 227 Rev 816
#define DEBUG
#define DEBUG
 
 
/* These define the size of main memory for the simulator.
/* These define the size of main memory for the simulator.
 
 
   Note the size of main memory for the H8/300H is only 256k.  Keeping it
   Note the size of main memory for the H8/300H is only 256k.  Keeping it
   small makes the simulator run much faster and consume less memory.
   small makes the simulator run much faster and consume less memory.
 
 
   The linker knows about the limited size of the simulator's main memory
   The linker knows about the limited size of the simulator's main memory
   on the H8/300H (via the h8300h.sc linker script).  So if you change
   on the H8/300H (via the h8300h.sc linker script).  So if you change
   H8300H_MSIZE, be sure to fix the linker script too.
   H8300H_MSIZE, be sure to fix the linker script too.
 
 
   Also note that there's a separate "eightbit" area aside from main
   Also note that there's a separate "eightbit" area aside from main
   memory.  For simplicity, the simulator assumes any data memory reference
   memory.  For simplicity, the simulator assumes any data memory reference
   outside of main memory refers to the eightbit area (in theory, this
   outside of main memory refers to the eightbit area (in theory, this
   can only happen when simulating H8/300H programs).  We make no attempt
   can only happen when simulating H8/300H programs).  We make no attempt
   to catch overlapping addresses, wrapped addresses, etc etc.  */
   to catch overlapping addresses, wrapped addresses, etc etc.  */
#define H8300_MSIZE (1 << 16)
#define H8300_MSIZE (1 << 16)
 
 
/* avolkov:
/* avolkov:
   Next 2 macros are ugly for any workstation, but while they're work.
   Next 2 macros are ugly for any workstation, but while they're work.
   Memory size MUST be configurable.  */
   Memory size MUST be configurable.  */
#define H8300H_MSIZE (1 << 18) 
#define H8300H_MSIZE (1 << 18) 
#define H8300S_MSIZE (1 << 24) 
#define H8300S_MSIZE (1 << 24) 
 
 
#define CSIZE 1000
#define CSIZE 1000
 
 
/* Local register names */
/* Local register names */
typedef enum
typedef enum
{
{
  R0, R1, R2, R3, R4, R5, R6, R7,
  R0, R1, R2, R3, R4, R5, R6, R7,
  R_ZERO,
  R_ZERO,
  R_PC,
  R_PC,
  R_CCR,
  R_CCR,
  R_EXR,
  R_EXR,
  R_HARD_0,
  R_HARD_0,
  R_LAST,
  R_LAST,
} reg_type;
} reg_type;
 
 
 
 
/* Structure used to describe addressing */
/* Structure used to describe addressing */
 
 
typedef struct
typedef struct
{
{
  int type;
  int type;
  int reg;
  int reg;
  int literal;
  int literal;
} ea_type;
} ea_type;
 
 
 
 
 
 
typedef struct
typedef struct
{
{
  ea_type src;
  ea_type src;
  ea_type dst;
  ea_type dst;
  int opcode;
  int opcode;
  int next_pc;
  int next_pc;
  int oldpc;
  int oldpc;
  int cycles;
  int cycles;
#ifdef DEBUG
#ifdef DEBUG
struct h8_opcode *op;
struct h8_opcode *op;
#endif
#endif
}
}
decoded_inst;
decoded_inst;
 
 
enum h8300_sim_state {
enum h8300_sim_state {
  SIM_STATE_RUNNING, SIM_STATE_EXITED, SIM_STATE_SIGNALLED, SIM_STATE_STOPPED
  SIM_STATE_RUNNING, SIM_STATE_EXITED, SIM_STATE_SIGNALLED, SIM_STATE_STOPPED
};
};
 
 
/* For Command Line.  */
/* For Command Line.  */
char **ptr_command_line; /* Pointer to Command Line Arguments. */
char **ptr_command_line; /* Pointer to Command Line Arguments. */
 
 
typedef struct
typedef struct
{
{
  enum h8300_sim_state state;
  enum h8300_sim_state state;
  int exception;
  int exception;
  unsigned  int regs[9];
  unsigned  int regs[9];
  int pc;
  int pc;
  int ccr;
  int ccr;
  int exr;
  int exr;
 
 
  unsigned char *memory;
  unsigned char *memory;
  unsigned char *eightbit;
  unsigned char *eightbit;
  unsigned short *cache_idx;
  unsigned short *cache_idx;
  int cache_top;
  int cache_top;
  int maximum;
  int maximum;
  int csize;
  int csize;
  int mask;
  int mask;
 
 
  decoded_inst *cache;
  decoded_inst *cache;
  int cycles;
  int cycles;
  int insts;
  int insts;
  int ticks;
  int ticks;
  int compiles;
  int compiles;
#ifdef ADEBUG
#ifdef ADEBUG
  int stats[O_LAST];
  int stats[O_LAST];
#endif
#endif
}
}
cpu_state_type;
cpu_state_type;
 
 

powered by: WebSVN 2.1.0

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