Obsolete fr30.
This commit is contained in:
parent
25d3fb587f
commit
7a3085c168
@ -1,3 +1,12 @@
|
||||
2002-07-16 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* NEWS: Mention that the FR30 has been made obsolete.
|
||||
* fr30-tdep.c: Make file obsolete.
|
||||
* config/fr30/tm-fr30.h: Ditto.
|
||||
* config/fr30/fr30.mt: Ditto.
|
||||
* configure.tgt: Make fr30-*-elf obsolete.
|
||||
* MAINTAINERS: Make fr30-elf obsolete.
|
||||
|
||||
2002-07-16 Pierre Muller <muller@ics.u-strasbg.fr>
|
||||
|
||||
* blockframe.c (get_pc_function_start): return 0 if the minimal symbol
|
||||
|
@ -83,9 +83,7 @@ maintainer works with the native maintainer when resolving API issues.
|
||||
djgpp --target=i586-pc-msdosdjgpp ,-Werror
|
||||
(See native and host)
|
||||
|
||||
fr30 --target=fr30-elf -Werror
|
||||
Maintenance only
|
||||
OBSOLETE candidate, not multi-arch
|
||||
fr30 (--target=fr30-elf OBSOLETE)
|
||||
|
||||
h8300 --target=h8300hms -Werror
|
||||
Maintenance only
|
||||
|
1
gdb/NEWS
1
gdb/NEWS
@ -61,6 +61,7 @@ configurations, the next release of GDB will have their sources
|
||||
permanently REMOVED.
|
||||
|
||||
Mitsubishi D30V d30v-*-*
|
||||
Fujitsu FR30 fr30-*-elf*
|
||||
|
||||
* REMOVED configurations and files
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Target: Fujitsu FR30 processor
|
||||
TDEPFILES= fr30-tdep.o
|
||||
TM_FILE= tm-fr30.h
|
||||
SIM_OBS = remote-sim.o
|
||||
SIM = ../sim/fr30/libsim.a
|
||||
# OBSOLETE # Target: Fujitsu FR30 processor
|
||||
# OBSOLETE TDEPFILES= fr30-tdep.o
|
||||
# OBSOLETE TM_FILE= tm-fr30.h
|
||||
# OBSOLETE SIM_OBS = remote-sim.o
|
||||
# OBSOLETE SIM = ../sim/fr30/libsim.a
|
||||
|
@ -1,233 +1,233 @@
|
||||
/* Parameters for execution on a Fujitsu FR30 processor.
|
||||
Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "regcache.h"
|
||||
|
||||
#define FR30_GENREGS 16
|
||||
#define FR30_DEDICATEDREGS 8
|
||||
#define FR30_REGSIZE 4 /* bytes */
|
||||
|
||||
#define NUM_REGS (FR30_GENREGS + FR30_DEDICATEDREGS)
|
||||
#define REGISTER_BYTES ((FR30_GENREGS + FR30_DEDICATEDREGS)*FR30_REGSIZE)
|
||||
|
||||
/* Index within `registers' of the first byte of the space for
|
||||
register N. */
|
||||
#define REGISTER_BYTE(N) ((N) * FR30_REGSIZE)
|
||||
|
||||
/* Initializer for an array of names of registers.
|
||||
There should be NUM_REGS strings in this initializer. */
|
||||
#define REGISTER_NAMES \
|
||||
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
|
||||
"r9", "r10", "r11", "r12", "r13", "r14", "r15", \
|
||||
"pc", "ps", "tbr", "rp", "ssp", "usp", "mdh", "mdl" }
|
||||
|
||||
/* Offset from address of function to start of its code.
|
||||
Zero on most machines. */
|
||||
#define FUNCTION_START_OFFSET 0
|
||||
|
||||
/* Amount PC must be decremented by after a breakpoint.
|
||||
This is often the number of bytes in BREAKPOINT
|
||||
but not always. */
|
||||
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
|
||||
/* Stack grows downward. */
|
||||
|
||||
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
||||
|
||||
#define R0_REGNUM 0
|
||||
#define R1_REGNUM 1
|
||||
#define R2_REGNUM 2
|
||||
#define R3_REGNUM 3
|
||||
#define R4_REGNUM 4
|
||||
#define R5_REGNUM 5
|
||||
#define R6_REGNUM 6
|
||||
#define R7_REGNUM 7
|
||||
#define R8_REGNUM 8
|
||||
#define R9_REGNUM 9
|
||||
#define R10_REGNUM 10
|
||||
#define R11_REGNUM 11
|
||||
#define R12_REGNUM 12
|
||||
#define R13_REGNUM 13
|
||||
#define FP_REGNUM 14 /* Frame pointer */
|
||||
#define SP_REGNUM 15 /* Stack pointer */
|
||||
#define PC_REGNUM 16 /* Program counter */
|
||||
#define RP_REGNUM 19 /* Return pointer */
|
||||
|
||||
#define FIRST_ARGREG R4_REGNUM /* first arg (or struct ret val addr) */
|
||||
#define LAST_ARGREG R7_REGNUM /* fourth (or third arg) */
|
||||
#define RETVAL_REG R4_REGNUM /* return vaue */
|
||||
|
||||
/* Say how long (ordinary) registers are. This is a piece of bogosity
|
||||
used in push_word and a few other places; REGISTER_RAW_SIZE is the
|
||||
real way to know how big a register is. */
|
||||
#define REGISTER_SIZE FR30_REGSIZE
|
||||
|
||||
/* Number of bytes of storage in the actual machine representation
|
||||
for register N. */
|
||||
#define REGISTER_RAW_SIZE(N) FR30_REGSIZE
|
||||
|
||||
/* Largest value REGISTER_RAW_SIZE can have. */
|
||||
#define MAX_REGISTER_RAW_SIZE FR30_REGSIZE
|
||||
|
||||
/* Number of bytes of storage in the program's representation
|
||||
for register N. */
|
||||
#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
|
||||
|
||||
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
|
||||
#define MAX_REGISTER_VIRTUAL_SIZE FR30_REGSIZE
|
||||
|
||||
extern void fr30_pop_frame (void);
|
||||
#define POP_FRAME fr30_pop_frame()
|
||||
|
||||
#define USE_GENERIC_DUMMY_FRAMES 1
|
||||
#define CALL_DUMMY {0}
|
||||
#define CALL_DUMMY_START_OFFSET (0)
|
||||
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
|
||||
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
|
||||
#define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
|
||||
#define CALL_DUMMY_ADDRESS() entry_point_address ()
|
||||
#define PUSH_RETURN_ADDRESS(PC, SP) (write_register(RP_REGNUM, CALL_DUMMY_ADDRESS()), SP)
|
||||
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
|
||||
|
||||
/* Number of bytes at start of arglist that are not really args. */
|
||||
#define FRAME_ARGS_SKIP 0
|
||||
|
||||
/* Return the GDB type object for the "standard" data type
|
||||
of data in register N. */
|
||||
#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
|
||||
|
||||
/* Extract from an array REGBUF containing the (raw) register state
|
||||
a function return value of type TYPE, and copy that, in virtual format,
|
||||
into VALBUF. */
|
||||
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
memcpy (VALBUF, REGBUF + REGISTER_BYTE(RETVAL_REG) + \
|
||||
(TYPE_LENGTH(TYPE) < 4 ? 4 - TYPE_LENGTH(TYPE) : 0), TYPE_LENGTH (TYPE))
|
||||
|
||||
/* Extract from an array REGBUF containing the (raw) register state
|
||||
the address in which a function should return its structure value,
|
||||
as a CORE_ADDR (or an expression that can be used as one). */
|
||||
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
||||
extract_address (REGBUF + REGISTER_BYTE (RETVAL_REG), \
|
||||
REGISTER_RAW_SIZE (RETVAL_REG))
|
||||
|
||||
#define STORE_STRUCT_RETURN(ADDR, SP) \
|
||||
{ write_register (RETVAL_REG, (ADDR)); }
|
||||
|
||||
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
|
||||
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
|
||||
|
||||
/* Return number of args passed to a frame.
|
||||
Can return -1, meaning no way to tell. */
|
||||
#define FRAME_NUM_ARGS(fi) (-1)
|
||||
|
||||
/* Forward decls for prototypes */
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct type;
|
||||
struct value;
|
||||
|
||||
#define EXTRA_FRAME_INFO \
|
||||
struct frame_saved_regs fsr; \
|
||||
int framesize; \
|
||||
int frameoffset; \
|
||||
int framereg;
|
||||
|
||||
extern CORE_ADDR fr30_frame_chain (struct frame_info *fi);
|
||||
#define FRAME_CHAIN(fi) fr30_frame_chain (fi)
|
||||
|
||||
extern CORE_ADDR fr30_frame_saved_pc (struct frame_info *);
|
||||
#define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi))
|
||||
|
||||
#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
|
||||
|
||||
extern CORE_ADDR fr30_skip_prologue (CORE_ADDR pc);
|
||||
#define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc))
|
||||
|
||||
/* Write into appropriate registers a function return value of type
|
||||
TYPE, given in virtual format. VALBUF is in the target byte order;
|
||||
it's typically the VALUE_CONTENTS of some struct value, and those
|
||||
are in the target's byte order. */
|
||||
extern void fr30_store_return_value (struct type *type, char *valbuf);
|
||||
|
||||
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
(fr30_store_return_value ((TYPE), (VALBUF)))
|
||||
|
||||
/* Put here the code to store, into a struct frame_saved_regs,
|
||||
the addresses of the saved registers of frame described by FRAME_INFO.
|
||||
This includes special registers such as pc and fp saved in special
|
||||
ways in the stack frame. sp is even more special:
|
||||
the address we return for it IS the sp for the next frame. */
|
||||
#define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
|
||||
|
||||
/* Use INT #BREAKPOINT_INTNUM instruction for breakpoint */
|
||||
#define FR30_BREAKOP 0x1f /* opcode, type D instruction */
|
||||
#define BREAKPOINT_INTNUM 9 /* one of the reserved traps */
|
||||
#define BREAKPOINT {FR30_BREAKOP, BREAKPOINT_INTNUM}
|
||||
|
||||
/* Define this for Wingdb */
|
||||
#define TARGET_FR30
|
||||
|
||||
/* Define other aspects of the stack frame. */
|
||||
|
||||
/* An expression that tells us whether the function invocation represented
|
||||
by FI does not have a frame on the stack associated with it. */
|
||||
extern int fr30_frameless_function_invocation (struct frame_info *frame);
|
||||
#define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI));
|
||||
|
||||
extern void fr30_init_extra_frame_info (struct frame_info *fi);
|
||||
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi)
|
||||
|
||||
#define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI)
|
||||
|
||||
extern CORE_ADDR
|
||||
fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
|
||||
int struct_return, CORE_ADDR struct_addr);
|
||||
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
|
||||
(fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
|
||||
|
||||
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
|
||||
|
||||
/* Fujitsu's ABI requires all structs to be passed using a pointer.
|
||||
That is obviously not very efficient, so I am leaving the definitions
|
||||
to make gdb work with GCC style struct passing, in case we decide
|
||||
to go for better performance, rather than for compatibility with
|
||||
Fujitsu (just change STRUCT_ALWAYS_BY_ADDR to 0) */
|
||||
|
||||
#define STRUCT_ALWAYS_BY_ADDR 1
|
||||
|
||||
#if(STRUCT_ALWAYS_BY_ADDR)
|
||||
#define REG_STRUCT_HAS_ADDR(gcc_p,type) 1
|
||||
#else
|
||||
/* more standard GCC (optimized) */
|
||||
#define REG_STRUCT_HAS_ADDR(gcc_p,type) \
|
||||
((TYPE_LENGTH(type) > 4) && (TYPE_LENGTH(type) & 0x3))
|
||||
#endif
|
||||
/* alway return struct by value by input pointer */
|
||||
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) 1
|
||||
|
||||
/* The stack should always be aligned on a four-word boundary. */
|
||||
#define STACK_ALIGN(len) (((len) + 3) & ~3)
|
||||
|
||||
/* I think the comment about this in value_arg_coerce is wrong; this
|
||||
should be true on any system where you can rely on the prototyping
|
||||
information. When this is true, value_arg_coerce will promote
|
||||
floats to doubles iff the function is not prototyped. */
|
||||
#define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
|
||||
// OBSOLETE /* Parameters for execution on a Fujitsu FR30 processor.
|
||||
// OBSOLETE Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of GDB.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2 of the License, or
|
||||
// OBSOLETE (at your option) any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License
|
||||
// OBSOLETE along with this program; if not, write to the Free Software
|
||||
// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// OBSOLETE Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "regcache.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define FR30_GENREGS 16
|
||||
// OBSOLETE #define FR30_DEDICATEDREGS 8
|
||||
// OBSOLETE #define FR30_REGSIZE 4 /* bytes */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define NUM_REGS (FR30_GENREGS + FR30_DEDICATEDREGS)
|
||||
// OBSOLETE #define REGISTER_BYTES ((FR30_GENREGS + FR30_DEDICATEDREGS)*FR30_REGSIZE)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Index within `registers' of the first byte of the space for
|
||||
// OBSOLETE register N. */
|
||||
// OBSOLETE #define REGISTER_BYTE(N) ((N) * FR30_REGSIZE)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Initializer for an array of names of registers.
|
||||
// OBSOLETE There should be NUM_REGS strings in this initializer. */
|
||||
// OBSOLETE #define REGISTER_NAMES \
|
||||
// OBSOLETE { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \
|
||||
// OBSOLETE "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
|
||||
// OBSOLETE "pc", "ps", "tbr", "rp", "ssp", "usp", "mdh", "mdl" }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Offset from address of function to start of its code.
|
||||
// OBSOLETE Zero on most machines. */
|
||||
// OBSOLETE #define FUNCTION_START_OFFSET 0
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Amount PC must be decremented by after a breakpoint.
|
||||
// OBSOLETE This is often the number of bytes in BREAKPOINT
|
||||
// OBSOLETE but not always. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define DECR_PC_AFTER_BREAK 0
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Stack grows downward. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define R0_REGNUM 0
|
||||
// OBSOLETE #define R1_REGNUM 1
|
||||
// OBSOLETE #define R2_REGNUM 2
|
||||
// OBSOLETE #define R3_REGNUM 3
|
||||
// OBSOLETE #define R4_REGNUM 4
|
||||
// OBSOLETE #define R5_REGNUM 5
|
||||
// OBSOLETE #define R6_REGNUM 6
|
||||
// OBSOLETE #define R7_REGNUM 7
|
||||
// OBSOLETE #define R8_REGNUM 8
|
||||
// OBSOLETE #define R9_REGNUM 9
|
||||
// OBSOLETE #define R10_REGNUM 10
|
||||
// OBSOLETE #define R11_REGNUM 11
|
||||
// OBSOLETE #define R12_REGNUM 12
|
||||
// OBSOLETE #define R13_REGNUM 13
|
||||
// OBSOLETE #define FP_REGNUM 14 /* Frame pointer */
|
||||
// OBSOLETE #define SP_REGNUM 15 /* Stack pointer */
|
||||
// OBSOLETE #define PC_REGNUM 16 /* Program counter */
|
||||
// OBSOLETE #define RP_REGNUM 19 /* Return pointer */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define FIRST_ARGREG R4_REGNUM /* first arg (or struct ret val addr) */
|
||||
// OBSOLETE #define LAST_ARGREG R7_REGNUM /* fourth (or third arg) */
|
||||
// OBSOLETE #define RETVAL_REG R4_REGNUM /* return vaue */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity
|
||||
// OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the
|
||||
// OBSOLETE real way to know how big a register is. */
|
||||
// OBSOLETE #define REGISTER_SIZE FR30_REGSIZE
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Number of bytes of storage in the actual machine representation
|
||||
// OBSOLETE for register N. */
|
||||
// OBSOLETE #define REGISTER_RAW_SIZE(N) FR30_REGSIZE
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */
|
||||
// OBSOLETE #define MAX_REGISTER_RAW_SIZE FR30_REGSIZE
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Number of bytes of storage in the program's representation
|
||||
// OBSOLETE for register N. */
|
||||
// OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */
|
||||
// OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE FR30_REGSIZE
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern void fr30_pop_frame (void);
|
||||
// OBSOLETE #define POP_FRAME fr30_pop_frame()
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define USE_GENERIC_DUMMY_FRAMES 1
|
||||
// OBSOLETE #define CALL_DUMMY {0}
|
||||
// OBSOLETE #define CALL_DUMMY_START_OFFSET (0)
|
||||
// OBSOLETE #define CALL_DUMMY_BREAKPOINT_OFFSET (0)
|
||||
// OBSOLETE #define CALL_DUMMY_LOCATION AT_ENTRY_POINT
|
||||
// OBSOLETE #define FIX_CALL_DUMMY(DUMMY, START, FUNADDR, NARGS, ARGS, TYPE, GCCP)
|
||||
// OBSOLETE #define CALL_DUMMY_ADDRESS() entry_point_address ()
|
||||
// OBSOLETE #define PUSH_RETURN_ADDRESS(PC, SP) (write_register(RP_REGNUM, CALL_DUMMY_ADDRESS()), SP)
|
||||
// OBSOLETE #define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Number of bytes at start of arglist that are not really args. */
|
||||
// OBSOLETE #define FRAME_ARGS_SKIP 0
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Return the GDB type object for the "standard" data type
|
||||
// OBSOLETE of data in register N. */
|
||||
// OBSOLETE #define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
|
||||
// OBSOLETE a function return value of type TYPE, and copy that, in virtual format,
|
||||
// OBSOLETE into VALBUF. */
|
||||
// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
// OBSOLETE memcpy (VALBUF, REGBUF + REGISTER_BYTE(RETVAL_REG) + \
|
||||
// OBSOLETE (TYPE_LENGTH(TYPE) < 4 ? 4 - TYPE_LENGTH(TYPE) : 0), TYPE_LENGTH (TYPE))
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
|
||||
// OBSOLETE the address in which a function should return its structure value,
|
||||
// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). */
|
||||
// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
|
||||
// OBSOLETE extract_address (REGBUF + REGISTER_BYTE (RETVAL_REG), \
|
||||
// OBSOLETE REGISTER_RAW_SIZE (RETVAL_REG))
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \
|
||||
// OBSOLETE { write_register (RETVAL_REG, (ADDR)); }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
|
||||
// OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Return number of args passed to a frame.
|
||||
// OBSOLETE Can return -1, meaning no way to tell. */
|
||||
// OBSOLETE #define FRAME_NUM_ARGS(fi) (-1)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Forward decls for prototypes */
|
||||
// OBSOLETE struct frame_info;
|
||||
// OBSOLETE struct frame_saved_regs;
|
||||
// OBSOLETE struct type;
|
||||
// OBSOLETE struct value;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define EXTRA_FRAME_INFO \
|
||||
// OBSOLETE struct frame_saved_regs fsr; \
|
||||
// OBSOLETE int framesize; \
|
||||
// OBSOLETE int frameoffset; \
|
||||
// OBSOLETE int framereg;
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern CORE_ADDR fr30_frame_chain (struct frame_info *fi);
|
||||
// OBSOLETE #define FRAME_CHAIN(fi) fr30_frame_chain (fi)
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern CORE_ADDR fr30_frame_saved_pc (struct frame_info *);
|
||||
// OBSOLETE #define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi))
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern CORE_ADDR fr30_skip_prologue (CORE_ADDR pc);
|
||||
// OBSOLETE #define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc))
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Write into appropriate registers a function return value of type
|
||||
// OBSOLETE TYPE, given in virtual format. VALBUF is in the target byte order;
|
||||
// OBSOLETE it's typically the VALUE_CONTENTS of some struct value, and those
|
||||
// OBSOLETE are in the target's byte order. */
|
||||
// OBSOLETE extern void fr30_store_return_value (struct type *type, char *valbuf);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
// OBSOLETE (fr30_store_return_value ((TYPE), (VALBUF)))
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Put here the code to store, into a struct frame_saved_regs,
|
||||
// OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO.
|
||||
// OBSOLETE This includes special registers such as pc and fp saved in special
|
||||
// OBSOLETE ways in the stack frame. sp is even more special:
|
||||
// OBSOLETE the address we return for it IS the sp for the next frame. */
|
||||
// OBSOLETE #define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Use INT #BREAKPOINT_INTNUM instruction for breakpoint */
|
||||
// OBSOLETE #define FR30_BREAKOP 0x1f /* opcode, type D instruction */
|
||||
// OBSOLETE #define BREAKPOINT_INTNUM 9 /* one of the reserved traps */
|
||||
// OBSOLETE #define BREAKPOINT {FR30_BREAKOP, BREAKPOINT_INTNUM}
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Define this for Wingdb */
|
||||
// OBSOLETE #define TARGET_FR30
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Define other aspects of the stack frame. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* An expression that tells us whether the function invocation represented
|
||||
// OBSOLETE by FI does not have a frame on the stack associated with it. */
|
||||
// OBSOLETE extern int fr30_frameless_function_invocation (struct frame_info *frame);
|
||||
// OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI));
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern void fr30_init_extra_frame_info (struct frame_info *fi);
|
||||
// OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi)
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define FRAME_CHAIN_VALID(FP, FI) generic_file_frame_chain_valid (FP, FI)
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern CORE_ADDR
|
||||
// OBSOLETE fr30_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
|
||||
// OBSOLETE int struct_return, CORE_ADDR struct_addr);
|
||||
// OBSOLETE #define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
|
||||
// OBSOLETE (fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Fujitsu's ABI requires all structs to be passed using a pointer.
|
||||
// OBSOLETE That is obviously not very efficient, so I am leaving the definitions
|
||||
// OBSOLETE to make gdb work with GCC style struct passing, in case we decide
|
||||
// OBSOLETE to go for better performance, rather than for compatibility with
|
||||
// OBSOLETE Fujitsu (just change STRUCT_ALWAYS_BY_ADDR to 0) */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define STRUCT_ALWAYS_BY_ADDR 1
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if(STRUCT_ALWAYS_BY_ADDR)
|
||||
// OBSOLETE #define REG_STRUCT_HAS_ADDR(gcc_p,type) 1
|
||||
// OBSOLETE #else
|
||||
// OBSOLETE /* more standard GCC (optimized) */
|
||||
// OBSOLETE #define REG_STRUCT_HAS_ADDR(gcc_p,type) \
|
||||
// OBSOLETE ((TYPE_LENGTH(type) > 4) && (TYPE_LENGTH(type) & 0x3))
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE /* alway return struct by value by input pointer */
|
||||
// OBSOLETE #define USE_STRUCT_CONVENTION(GCC_P, TYPE) 1
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The stack should always be aligned on a four-word boundary. */
|
||||
// OBSOLETE #define STACK_ALIGN(len) (((len) + 3) & ~3)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* I think the comment about this in value_arg_coerce is wrong; this
|
||||
// OBSOLETE should be true on any system where you can rely on the prototyping
|
||||
// OBSOLETE information. When this is true, value_arg_coerce will promote
|
||||
// OBSOLETE floats to doubles iff the function is not prototyped. */
|
||||
// OBSOLETE #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
|
||||
|
@ -72,7 +72,7 @@ h8300-*-*) gdb_target=h8300 ;;
|
||||
h8500-*-*) gdb_target=h8500 ;;
|
||||
|
||||
|
||||
fr30-*-elf*) gdb_target=fr30 ;;
|
||||
# OBSOLETE fr30-*-elf*) gdb_target=fr30 ;;
|
||||
|
||||
frv-*-*) gdb_target=frv ;;
|
||||
|
||||
@ -285,8 +285,8 @@ xstormy16-*-*) gdb_target=xstormy16 ;;
|
||||
|
||||
vax-*-*) gdb_target=vax ;;
|
||||
|
||||
fr30-*-*) gdb_target=fr30
|
||||
;;
|
||||
# OBSOLETE fr30-*-*) gdb_target=fr30
|
||||
# OBSOLETE ;;
|
||||
|
||||
v850*-*-*) gdb_target=v850
|
||||
case ${gdb_host} in
|
||||
|
1202
gdb/fr30-tdep.c
1202
gdb/fr30-tdep.c
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,8 @@
|
||||
2002-07-16 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* configure.in (extra_subdirs): Mark fr30-*-* as obsolete.
|
||||
* configure: Re-generate.
|
||||
|
||||
2002-07-13 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* configure.in (extra_subdirs): Mark d30v-*-* as obsolete.
|
||||
|
@ -1,4 +1,4 @@
|
||||
2002-07-15 Andrew Cagney <ac131313@redhat.com>
|
||||
2002-07-16 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* sim-resume.c (sim_resume): Add local variable sig_to_deliver to
|
||||
avoid possible longjmp problems with automatic variable siggnal.
|
||||
|
2
sim/configure
vendored
2
sim/configure
vendored
@ -1425,7 +1425,7 @@ case "${target}" in
|
||||
# OBSOLETE only_if_gcc=yes
|
||||
# OBSOLETE extra_subdirs="${extra_subdirs} igen"
|
||||
# OBSOLETE ;;
|
||||
fr30-*-*) sim_target=fr30 ;;
|
||||
# OBSOLETE fr30-*-*) sim_target=fr30 ;;
|
||||
h8300*-*-*) sim_target=h8300 ;;
|
||||
h8500-*-*) sim_target=h8500 ;;
|
||||
i960-*-*) sim_target=i960 ;;
|
||||
|
@ -64,7 +64,7 @@ case "${target}" in
|
||||
# OBSOLETE only_if_gcc=yes
|
||||
# OBSOLETE extra_subdirs="${extra_subdirs} igen"
|
||||
# OBSOLETE ;;
|
||||
fr30-*-*) sim_target=fr30 ;;
|
||||
# OBSOLETE fr30-*-*) sim_target=fr30 ;;
|
||||
h8300*-*-*) sim_target=h8300 ;;
|
||||
h8500-*-*) sim_target=h8500 ;;
|
||||
i960-*-*) sim_target=i960 ;;
|
||||
|
@ -1,3 +1,14 @@
|
||||
2002-07-16 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* Makefile.in: Make file obsolete.
|
||||
* cpu.c, arch.h, arch.c, cpu.h, decode.h: Ditto.
|
||||
* decode.c, fr30-sim.h, devices.c, fr30.c: Ditto.
|
||||
* model.c, sem-switch.c, sim-if.c: Ditto.
|
||||
* sim-main.h, traps.c, sem.c: Ditto.
|
||||
* TODO, README: Ditto.
|
||||
* configure.in: Ditto.
|
||||
* configure: Regenerate.
|
||||
|
||||
2002-06-16 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* configure: Regenerated to track ../common/aclocal.m4 changes.
|
||||
|
@ -1,107 +1,107 @@
|
||||
# Makefile template for Configure for the fr30 simulator
|
||||
# Copyright (C) 1998, 2000 Free Software Foundation, Inc.
|
||||
# Contributed by Cygnus Support.
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
## COMMON_PRE_CONFIG_FRAG
|
||||
|
||||
FR30_OBJS = fr30.o cpu.o decode.o sem.o model.o arch.o mloop.o
|
||||
|
||||
CONFIG_DEVICES = dv-sockser.o
|
||||
CONFIG_DEVICES =
|
||||
|
||||
SIM_OBJS = \
|
||||
$(SIM_NEW_COMMON_OBJS) \
|
||||
sim-cpu.o \
|
||||
sim-hload.o \
|
||||
sim-hrw.o \
|
||||
sim-model.o \
|
||||
sim-reg.o \
|
||||
cgen-utils.o cgen-trace.o cgen-scache.o \
|
||||
cgen-run.o sim-reason.o sim-engine.o sim-stop.o \
|
||||
sim-if.o \
|
||||
$(FR30_OBJS) \
|
||||
traps.o devices.o \
|
||||
$(CONFIG_DEVICES)
|
||||
|
||||
# Extra headers included by sim-main.h.
|
||||
SIM_EXTRA_DEPS = \
|
||||
$(CGEN_INCLUDE_DEPS) \
|
||||
arch.h cpuall.h fr30-sim.h $(srcdir)/../../opcodes/fr30-desc.h
|
||||
|
||||
SIM_EXTRA_CFLAGS =
|
||||
|
||||
SIM_RUN_OBJS = nrun.o
|
||||
SIM_EXTRA_CLEAN = fr30-clean
|
||||
|
||||
# This selects the fr30 newlib/libgloss syscall definitions.
|
||||
NL_TARGET = -DNL_TARGET_fr30
|
||||
|
||||
## COMMON_POST_CONFIG_FRAG
|
||||
|
||||
arch = fr30
|
||||
|
||||
sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
|
||||
|
||||
arch.o: arch.c $(SIM_MAIN_DEPS)
|
||||
|
||||
devices.o: devices.c $(SIM_MAIN_DEPS)
|
||||
|
||||
# FR30 objs
|
||||
|
||||
FR30BF_INCLUDE_DEPS = \
|
||||
$(CGEN_MAIN_CPU_DEPS) \
|
||||
cpu.h decode.h eng.h
|
||||
|
||||
fr30.o: fr30.c $(FR30BF_INCLUDE_DEPS)
|
||||
|
||||
# FIXME: Use of `mono' is wip.
|
||||
mloop.c eng.h: stamp-mloop
|
||||
stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
|
||||
$(SHELL) $(srccom)/genmloop.sh \
|
||||
-mono -fast -pbb -switch sem-switch.c \
|
||||
-cpu fr30bf -infile $(srcdir)/mloop.in
|
||||
$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
|
||||
$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
|
||||
touch stamp-mloop
|
||||
mloop.o: mloop.c sem-switch.c $(FR30BF_INCLUDE_DEPS)
|
||||
|
||||
cpu.o: cpu.c $(FR30BF_INCLUDE_DEPS)
|
||||
decode.o: decode.c $(FR30BF_INCLUDE_DEPS)
|
||||
sem.o: sem.c $(FR30BF_INCLUDE_DEPS)
|
||||
model.o: model.c $(FR30BF_INCLUDE_DEPS)
|
||||
|
||||
fr30-clean:
|
||||
rm -f mloop.c eng.h stamp-mloop
|
||||
rm -f tmp-*
|
||||
rm -f stamp-arch stamp-cpu
|
||||
|
||||
# cgen support, enable with --enable-cgen-maint
|
||||
CGEN_MAINT = ; @true
|
||||
# The following line is commented in or out depending upon --enable-cgen-maint.
|
||||
@CGEN_MAINT@CGEN_MAINT =
|
||||
|
||||
stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CGEN_CPU_DIR)/fr30.cpu
|
||||
$(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
|
||||
FLAGS="with-scache with-profile=fn"
|
||||
touch stamp-arch
|
||||
arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
|
||||
|
||||
stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/fr30.cpu
|
||||
$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
|
||||
cpu=fr30bf mach=fr30 SUFFIX= FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
|
||||
touch stamp-cpu
|
||||
cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu
|
||||
# OBSOLETE # Makefile template for Configure for the fr30 simulator
|
||||
# OBSOLETE # Copyright (C) 1998, 2000 Free Software Foundation, Inc.
|
||||
# OBSOLETE # Contributed by Cygnus Support.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is free software; you can redistribute it and/or modify
|
||||
# OBSOLETE # it under the terms of the GNU General Public License as published by
|
||||
# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
|
||||
# OBSOLETE # (at your option) any later version.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is distributed in the hope that it will be useful,
|
||||
# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# OBSOLETE # GNU General Public License for more details.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # You should have received a copy of the GNU General Public License along
|
||||
# OBSOLETE # with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# OBSOLETE # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# OBSOLETE
|
||||
# OBSOLETE ## COMMON_PRE_CONFIG_FRAG
|
||||
# OBSOLETE
|
||||
# OBSOLETE FR30_OBJS = fr30.o cpu.o decode.o sem.o model.o arch.o mloop.o
|
||||
# OBSOLETE
|
||||
# OBSOLETE CONFIG_DEVICES = dv-sockser.o
|
||||
# OBSOLETE CONFIG_DEVICES =
|
||||
# OBSOLETE
|
||||
# OBSOLETE SIM_OBJS = \
|
||||
# OBSOLETE $(SIM_NEW_COMMON_OBJS) \
|
||||
# OBSOLETE sim-cpu.o \
|
||||
# OBSOLETE sim-hload.o \
|
||||
# OBSOLETE sim-hrw.o \
|
||||
# OBSOLETE sim-model.o \
|
||||
# OBSOLETE sim-reg.o \
|
||||
# OBSOLETE cgen-utils.o cgen-trace.o cgen-scache.o \
|
||||
# OBSOLETE cgen-run.o sim-reason.o sim-engine.o sim-stop.o \
|
||||
# OBSOLETE sim-if.o \
|
||||
# OBSOLETE $(FR30_OBJS) \
|
||||
# OBSOLETE traps.o devices.o \
|
||||
# OBSOLETE $(CONFIG_DEVICES)
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Extra headers included by sim-main.h.
|
||||
# OBSOLETE SIM_EXTRA_DEPS = \
|
||||
# OBSOLETE $(CGEN_INCLUDE_DEPS) \
|
||||
# OBSOLETE arch.h cpuall.h fr30-sim.h $(srcdir)/../../opcodes/fr30-desc.h
|
||||
# OBSOLETE
|
||||
# OBSOLETE SIM_EXTRA_CFLAGS =
|
||||
# OBSOLETE
|
||||
# OBSOLETE SIM_RUN_OBJS = nrun.o
|
||||
# OBSOLETE SIM_EXTRA_CLEAN = fr30-clean
|
||||
# OBSOLETE
|
||||
# OBSOLETE # This selects the fr30 newlib/libgloss syscall definitions.
|
||||
# OBSOLETE NL_TARGET = -DNL_TARGET_fr30
|
||||
# OBSOLETE
|
||||
# OBSOLETE ## COMMON_POST_CONFIG_FRAG
|
||||
# OBSOLETE
|
||||
# OBSOLETE arch = fr30
|
||||
# OBSOLETE
|
||||
# OBSOLETE sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
|
||||
# OBSOLETE
|
||||
# OBSOLETE arch.o: arch.c $(SIM_MAIN_DEPS)
|
||||
# OBSOLETE
|
||||
# OBSOLETE devices.o: devices.c $(SIM_MAIN_DEPS)
|
||||
# OBSOLETE
|
||||
# OBSOLETE # FR30 objs
|
||||
# OBSOLETE
|
||||
# OBSOLETE FR30BF_INCLUDE_DEPS = \
|
||||
# OBSOLETE $(CGEN_MAIN_CPU_DEPS) \
|
||||
# OBSOLETE cpu.h decode.h eng.h
|
||||
# OBSOLETE
|
||||
# OBSOLETE fr30.o: fr30.c $(FR30BF_INCLUDE_DEPS)
|
||||
# OBSOLETE
|
||||
# OBSOLETE # FIXME: Use of `mono' is wip.
|
||||
# OBSOLETE mloop.c eng.h: stamp-mloop
|
||||
# OBSOLETE stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
|
||||
# OBSOLETE $(SHELL) $(srccom)/genmloop.sh \
|
||||
# OBSOLETE -mono -fast -pbb -switch sem-switch.c \
|
||||
# OBSOLETE -cpu fr30bf -infile $(srcdir)/mloop.in
|
||||
# OBSOLETE $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
|
||||
# OBSOLETE $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
|
||||
# OBSOLETE touch stamp-mloop
|
||||
# OBSOLETE mloop.o: mloop.c sem-switch.c $(FR30BF_INCLUDE_DEPS)
|
||||
# OBSOLETE
|
||||
# OBSOLETE cpu.o: cpu.c $(FR30BF_INCLUDE_DEPS)
|
||||
# OBSOLETE decode.o: decode.c $(FR30BF_INCLUDE_DEPS)
|
||||
# OBSOLETE sem.o: sem.c $(FR30BF_INCLUDE_DEPS)
|
||||
# OBSOLETE model.o: model.c $(FR30BF_INCLUDE_DEPS)
|
||||
# OBSOLETE
|
||||
# OBSOLETE fr30-clean:
|
||||
# OBSOLETE rm -f mloop.c eng.h stamp-mloop
|
||||
# OBSOLETE rm -f tmp-*
|
||||
# OBSOLETE rm -f stamp-arch stamp-cpu
|
||||
# OBSOLETE
|
||||
# OBSOLETE # cgen support, enable with --enable-cgen-maint
|
||||
# OBSOLETE CGEN_MAINT = ; @true
|
||||
# OBSOLETE # The following line is commented in or out depending upon --enable-cgen-maint.
|
||||
# OBSOLETE @CGEN_MAINT@CGEN_MAINT =
|
||||
# OBSOLETE
|
||||
# OBSOLETE stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CGEN_CPU_DIR)/fr30.cpu
|
||||
# OBSOLETE $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
|
||||
# OBSOLETE FLAGS="with-scache with-profile=fn"
|
||||
# OBSOLETE touch stamp-arch
|
||||
# OBSOLETE arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
|
||||
# OBSOLETE
|
||||
# OBSOLETE stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/fr30.cpu
|
||||
# OBSOLETE $(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
|
||||
# OBSOLETE cpu=fr30bf mach=fr30 SUFFIX= FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
|
||||
# OBSOLETE touch stamp-cpu
|
||||
# OBSOLETE cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu
|
||||
|
@ -1,14 +1,14 @@
|
||||
This is the fr30 simulator directory.
|
||||
|
||||
It is still work-in-progress. The current sources are reasonably
|
||||
well tested and lots of features are in. However, there's lots
|
||||
more yet to come.
|
||||
|
||||
There are lots of machine generated files in the source directory!
|
||||
They are only generated if you configure with --enable-cgen-maint,
|
||||
similar in behaviour to Makefile.in, configure under automake/autoconf.
|
||||
|
||||
For details on the generator, see ../../cgen.
|
||||
|
||||
devo/cgen isn't part of the comp-tools module yet.
|
||||
You'll need to check it out manually (also akin to automake/autoconf).
|
||||
OBSOLETE This is the fr30 simulator directory.
|
||||
OBSOLETE
|
||||
OBSOLETE It is still work-in-progress. The current sources are reasonably
|
||||
OBSOLETE well tested and lots of features are in. However, there's lots
|
||||
OBSOLETE more yet to come.
|
||||
OBSOLETE
|
||||
OBSOLETE There are lots of machine generated files in the source directory!
|
||||
OBSOLETE They are only generated if you configure with --enable-cgen-maint,
|
||||
OBSOLETE similar in behaviour to Makefile.in, configure under automake/autoconf.
|
||||
OBSOLETE
|
||||
OBSOLETE For details on the generator, see ../../cgen.
|
||||
OBSOLETE
|
||||
OBSOLETE devo/cgen isn't part of the comp-tools module yet.
|
||||
OBSOLETE You'll need to check it out manually (also akin to automake/autoconf).
|
||||
|
@ -1,14 +1,14 @@
|
||||
m32r-inherited stuff?
|
||||
----------------------
|
||||
- header file dependencies revisit
|
||||
- hooks cleanup
|
||||
- testsuites
|
||||
- FIXME's
|
||||
|
||||
|
||||
m32r stuff?
|
||||
----------------------
|
||||
- memory accesses still test if profiling is on even in fast mode
|
||||
- have semantic code use G/SET_H_FOO if not default [incl fun-access]
|
||||
- have G/SET_H_FOO macros call function if fun-access
|
||||
- --> can always use G/S_H_FOO macros
|
||||
OBSOLETE m32r-inherited stuff?
|
||||
OBSOLETE ----------------------
|
||||
OBSOLETE - header file dependencies revisit
|
||||
OBSOLETE - hooks cleanup
|
||||
OBSOLETE - testsuites
|
||||
OBSOLETE - FIXME's
|
||||
OBSOLETE
|
||||
OBSOLETE
|
||||
OBSOLETE m32r stuff?
|
||||
OBSOLETE ----------------------
|
||||
OBSOLETE - memory accesses still test if profiling is on even in fast mode
|
||||
OBSOLETE - have semantic code use G/SET_H_FOO if not default [incl fun-access]
|
||||
OBSOLETE - have G/SET_H_FOO macros call function if fun-access
|
||||
OBSOLETE - --> can always use G/S_H_FOO macros
|
||||
|
@ -1,35 +1,34 @@
|
||||
/* Simulator support for fr30.
|
||||
|
||||
THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "bfd.h"
|
||||
|
||||
const MACH *sim_machs[] =
|
||||
{
|
||||
#ifdef HAVE_CPU_FR30BF
|
||||
& fr30_mach,
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
// OBSOLETE /* Simulator support for fr30.
|
||||
// OBSOLETE
|
||||
// OBSOLETE THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
// OBSOLETE
|
||||
// OBSOLETE Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
// OBSOLETE
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-main.h"
|
||||
// OBSOLETE #include "bfd.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE const MACH *sim_machs[] =
|
||||
// OBSOLETE {
|
||||
// OBSOLETE #ifdef HAVE_CPU_FR30BF
|
||||
// OBSOLETE & fr30_mach,
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE 0
|
||||
// OBSOLETE };
|
||||
|
@ -1,45 +1,45 @@
|
||||
/* Simulator header for fr30.
|
||||
|
||||
THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FR30_ARCH_H
|
||||
#define FR30_ARCH_H
|
||||
|
||||
#define TARGET_BIG_ENDIAN 1
|
||||
|
||||
/* Enum declaration for model types. */
|
||||
typedef enum model_type {
|
||||
MODEL_FR30_1, MODEL_MAX
|
||||
} MODEL_TYPE;
|
||||
|
||||
#define MAX_MODELS ((int) MODEL_MAX)
|
||||
|
||||
/* Enum declaration for unit types. */
|
||||
typedef enum unit_type {
|
||||
UNIT_NONE, UNIT_FR30_1_U_STM, UNIT_FR30_1_U_LDM, UNIT_FR30_1_U_STORE
|
||||
, UNIT_FR30_1_U_LOAD, UNIT_FR30_1_U_CTI, UNIT_FR30_1_U_EXEC, UNIT_MAX
|
||||
} UNIT_TYPE;
|
||||
|
||||
#define MAX_UNITS (3)
|
||||
|
||||
#endif /* FR30_ARCH_H */
|
||||
// OBSOLETE /* Simulator header for fr30.
|
||||
// OBSOLETE
|
||||
// OBSOLETE THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
// OBSOLETE
|
||||
// OBSOLETE Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
// OBSOLETE
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifndef FR30_ARCH_H
|
||||
// OBSOLETE #define FR30_ARCH_H
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define TARGET_BIG_ENDIAN 1
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Enum declaration for model types. */
|
||||
// OBSOLETE typedef enum model_type {
|
||||
// OBSOLETE MODEL_FR30_1, MODEL_MAX
|
||||
// OBSOLETE } MODEL_TYPE;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define MAX_MODELS ((int) MODEL_MAX)
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Enum declaration for unit types. */
|
||||
// OBSOLETE typedef enum unit_type {
|
||||
// OBSOLETE UNIT_NONE, UNIT_FR30_1_U_STM, UNIT_FR30_1_U_LDM, UNIT_FR30_1_U_STORE
|
||||
// OBSOLETE , UNIT_FR30_1_U_LOAD, UNIT_FR30_1_U_CTI, UNIT_FR30_1_U_EXEC, UNIT_MAX
|
||||
// OBSOLETE } UNIT_TYPE;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define MAX_UNITS (3)
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* FR30_ARCH_H */
|
||||
|
4294
sim/fr30/configure
vendored
4294
sim/fr30/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,16 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
sinclude(../common/aclocal.m4)
|
||||
AC_PREREQ(2.5)dnl
|
||||
AC_INIT(Makefile.in)
|
||||
|
||||
SIM_AC_COMMON
|
||||
|
||||
SIM_AC_OPTION_ENDIAN(BIG_ENDIAN)
|
||||
SIM_AC_OPTION_ALIGNMENT(FORCED_ALIGNMENT)
|
||||
SIM_AC_OPTION_HOSTENDIAN
|
||||
SIM_AC_OPTION_SCACHE(16384)
|
||||
SIM_AC_OPTION_DEFAULT_MODEL(fr30-1)
|
||||
SIM_AC_OPTION_ENVIRONMENT
|
||||
SIM_AC_OPTION_CGEN_MAINT
|
||||
|
||||
SIM_AC_OUTPUT
|
||||
dnl OBSOLETE dnl Process this file with autoconf to produce a configure script.
|
||||
dnl OBSOLETE sinclude(../common/aclocal.m4)
|
||||
dnl OBSOLETE AC_PREREQ(2.5)dnl
|
||||
dnl OBSOLETE AC_INIT(Makefile.in)
|
||||
dnl OBSOLETE
|
||||
dnl OBSOLETE SIM_AC_COMMON
|
||||
dnl OBSOLETE
|
||||
dnl OBSOLETE SIM_AC_OPTION_ENDIAN(BIG_ENDIAN)
|
||||
dnl OBSOLETE SIM_AC_OPTION_ALIGNMENT(FORCED_ALIGNMENT)
|
||||
dnl OBSOLETE SIM_AC_OPTION_HOSTENDIAN
|
||||
dnl OBSOLETE SIM_AC_OPTION_SCACHE(16384)
|
||||
dnl OBSOLETE SIM_AC_OPTION_DEFAULT_MODEL(fr30-1)
|
||||
dnl OBSOLETE SIM_AC_OPTION_ENVIRONMENT
|
||||
dnl OBSOLETE SIM_AC_OPTION_CGEN_MAINT
|
||||
dnl OBSOLETE
|
||||
dnl OBSOLETE SIM_AC_OUTPUT
|
||||
|
714
sim/fr30/cpu.c
714
sim/fr30/cpu.c
@ -1,357 +1,357 @@
|
||||
/* Misc. support for CPU family fr30bf.
|
||||
|
||||
THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#define WANT_CPU fr30bf
|
||||
#define WANT_CPU_FR30BF
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "cgen-ops.h"
|
||||
|
||||
/* Get the value of h-pc. */
|
||||
|
||||
USI
|
||||
fr30bf_h_pc_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_pc);
|
||||
}
|
||||
|
||||
/* Set a value for h-pc. */
|
||||
|
||||
void
|
||||
fr30bf_h_pc_set (SIM_CPU *current_cpu, USI newval)
|
||||
{
|
||||
CPU (h_pc) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-gr. */
|
||||
|
||||
SI
|
||||
fr30bf_h_gr_get (SIM_CPU *current_cpu, UINT regno)
|
||||
{
|
||||
return CPU (h_gr[regno]);
|
||||
}
|
||||
|
||||
/* Set a value for h-gr. */
|
||||
|
||||
void
|
||||
fr30bf_h_gr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
|
||||
{
|
||||
CPU (h_gr[regno]) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-cr. */
|
||||
|
||||
SI
|
||||
fr30bf_h_cr_get (SIM_CPU *current_cpu, UINT regno)
|
||||
{
|
||||
return CPU (h_cr[regno]);
|
||||
}
|
||||
|
||||
/* Set a value for h-cr. */
|
||||
|
||||
void
|
||||
fr30bf_h_cr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
|
||||
{
|
||||
CPU (h_cr[regno]) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-dr. */
|
||||
|
||||
SI
|
||||
fr30bf_h_dr_get (SIM_CPU *current_cpu, UINT regno)
|
||||
{
|
||||
return GET_H_DR (regno);
|
||||
}
|
||||
|
||||
/* Set a value for h-dr. */
|
||||
|
||||
void
|
||||
fr30bf_h_dr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
|
||||
{
|
||||
SET_H_DR (regno, newval);
|
||||
}
|
||||
|
||||
/* Get the value of h-ps. */
|
||||
|
||||
USI
|
||||
fr30bf_h_ps_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return GET_H_PS ();
|
||||
}
|
||||
|
||||
/* Set a value for h-ps. */
|
||||
|
||||
void
|
||||
fr30bf_h_ps_set (SIM_CPU *current_cpu, USI newval)
|
||||
{
|
||||
SET_H_PS (newval);
|
||||
}
|
||||
|
||||
/* Get the value of h-r13. */
|
||||
|
||||
SI
|
||||
fr30bf_h_r13_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_r13);
|
||||
}
|
||||
|
||||
/* Set a value for h-r13. */
|
||||
|
||||
void
|
||||
fr30bf_h_r13_set (SIM_CPU *current_cpu, SI newval)
|
||||
{
|
||||
CPU (h_r13) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-r14. */
|
||||
|
||||
SI
|
||||
fr30bf_h_r14_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_r14);
|
||||
}
|
||||
|
||||
/* Set a value for h-r14. */
|
||||
|
||||
void
|
||||
fr30bf_h_r14_set (SIM_CPU *current_cpu, SI newval)
|
||||
{
|
||||
CPU (h_r14) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-r15. */
|
||||
|
||||
SI
|
||||
fr30bf_h_r15_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_r15);
|
||||
}
|
||||
|
||||
/* Set a value for h-r15. */
|
||||
|
||||
void
|
||||
fr30bf_h_r15_set (SIM_CPU *current_cpu, SI newval)
|
||||
{
|
||||
CPU (h_r15) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-nbit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_nbit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_nbit);
|
||||
}
|
||||
|
||||
/* Set a value for h-nbit. */
|
||||
|
||||
void
|
||||
fr30bf_h_nbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_nbit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-zbit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_zbit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_zbit);
|
||||
}
|
||||
|
||||
/* Set a value for h-zbit. */
|
||||
|
||||
void
|
||||
fr30bf_h_zbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_zbit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-vbit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_vbit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_vbit);
|
||||
}
|
||||
|
||||
/* Set a value for h-vbit. */
|
||||
|
||||
void
|
||||
fr30bf_h_vbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_vbit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-cbit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_cbit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_cbit);
|
||||
}
|
||||
|
||||
/* Set a value for h-cbit. */
|
||||
|
||||
void
|
||||
fr30bf_h_cbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_cbit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-ibit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_ibit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_ibit);
|
||||
}
|
||||
|
||||
/* Set a value for h-ibit. */
|
||||
|
||||
void
|
||||
fr30bf_h_ibit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_ibit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-sbit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_sbit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return GET_H_SBIT ();
|
||||
}
|
||||
|
||||
/* Set a value for h-sbit. */
|
||||
|
||||
void
|
||||
fr30bf_h_sbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
SET_H_SBIT (newval);
|
||||
}
|
||||
|
||||
/* Get the value of h-tbit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_tbit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_tbit);
|
||||
}
|
||||
|
||||
/* Set a value for h-tbit. */
|
||||
|
||||
void
|
||||
fr30bf_h_tbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_tbit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-d0bit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_d0bit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_d0bit);
|
||||
}
|
||||
|
||||
/* Set a value for h-d0bit. */
|
||||
|
||||
void
|
||||
fr30bf_h_d0bit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_d0bit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-d1bit. */
|
||||
|
||||
BI
|
||||
fr30bf_h_d1bit_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_d1bit);
|
||||
}
|
||||
|
||||
/* Set a value for h-d1bit. */
|
||||
|
||||
void
|
||||
fr30bf_h_d1bit_set (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
CPU (h_d1bit) = newval;
|
||||
}
|
||||
|
||||
/* Get the value of h-ccr. */
|
||||
|
||||
UQI
|
||||
fr30bf_h_ccr_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return GET_H_CCR ();
|
||||
}
|
||||
|
||||
/* Set a value for h-ccr. */
|
||||
|
||||
void
|
||||
fr30bf_h_ccr_set (SIM_CPU *current_cpu, UQI newval)
|
||||
{
|
||||
SET_H_CCR (newval);
|
||||
}
|
||||
|
||||
/* Get the value of h-scr. */
|
||||
|
||||
UQI
|
||||
fr30bf_h_scr_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return GET_H_SCR ();
|
||||
}
|
||||
|
||||
/* Set a value for h-scr. */
|
||||
|
||||
void
|
||||
fr30bf_h_scr_set (SIM_CPU *current_cpu, UQI newval)
|
||||
{
|
||||
SET_H_SCR (newval);
|
||||
}
|
||||
|
||||
/* Get the value of h-ilm. */
|
||||
|
||||
UQI
|
||||
fr30bf_h_ilm_get (SIM_CPU *current_cpu)
|
||||
{
|
||||
return GET_H_ILM ();
|
||||
}
|
||||
|
||||
/* Set a value for h-ilm. */
|
||||
|
||||
void
|
||||
fr30bf_h_ilm_set (SIM_CPU *current_cpu, UQI newval)
|
||||
{
|
||||
SET_H_ILM (newval);
|
||||
}
|
||||
|
||||
/* Record trace results for INSN. */
|
||||
|
||||
void
|
||||
fr30bf_record_trace_results (SIM_CPU *current_cpu, CGEN_INSN *insn,
|
||||
int *indices, TRACE_RECORD *tr)
|
||||
{
|
||||
}
|
||||
// OBSOLETE /* Misc. support for CPU family fr30bf.
|
||||
// OBSOLETE
|
||||
// OBSOLETE THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
// OBSOLETE
|
||||
// OBSOLETE Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
// OBSOLETE
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define WANT_CPU fr30bf
|
||||
// OBSOLETE #define WANT_CPU_FR30BF
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-main.h"
|
||||
// OBSOLETE #include "cgen-ops.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-pc. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE USI
|
||||
// OBSOLETE fr30bf_h_pc_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_pc);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-pc. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_pc_set (SIM_CPU *current_cpu, USI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_pc) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-gr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_gr_get (SIM_CPU *current_cpu, UINT regno)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_gr[regno]);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-gr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_gr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_gr[regno]) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-cr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_cr_get (SIM_CPU *current_cpu, UINT regno)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_cr[regno]);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-cr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_cr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_cr[regno]) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-dr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_dr_get (SIM_CPU *current_cpu, UINT regno)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return GET_H_DR (regno);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-dr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_dr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SET_H_DR (regno, newval);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-ps. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE USI
|
||||
// OBSOLETE fr30bf_h_ps_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return GET_H_PS ();
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-ps. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ps_set (SIM_CPU *current_cpu, USI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SET_H_PS (newval);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-r13. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_r13_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_r13);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-r13. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_r13_set (SIM_CPU *current_cpu, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_r13) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-r14. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_r14_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_r14);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-r14. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_r14_set (SIM_CPU *current_cpu, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_r14) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-r15. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_r15_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_r15);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-r15. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_r15_set (SIM_CPU *current_cpu, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_r15) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-nbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_nbit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_nbit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-nbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_nbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_nbit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-zbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_zbit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_zbit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-zbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_zbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_zbit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-vbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_vbit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_vbit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-vbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_vbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_vbit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-cbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_cbit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_cbit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-cbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_cbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_cbit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-ibit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_ibit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_ibit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-ibit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ibit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_ibit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-sbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_sbit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return GET_H_SBIT ();
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-sbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_sbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SET_H_SBIT (newval);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-tbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_tbit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_tbit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-tbit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_tbit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_tbit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-d0bit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_d0bit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_d0bit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-d0bit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_d0bit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_d0bit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-d1bit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_d1bit_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_d1bit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-d1bit. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_d1bit_set (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CPU (h_d1bit) = newval;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-ccr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE UQI
|
||||
// OBSOLETE fr30bf_h_ccr_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return GET_H_CCR ();
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-ccr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ccr_set (SIM_CPU *current_cpu, UQI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SET_H_CCR (newval);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-scr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE UQI
|
||||
// OBSOLETE fr30bf_h_scr_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return GET_H_SCR ();
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-scr. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_scr_set (SIM_CPU *current_cpu, UQI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SET_H_SCR (newval);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Get the value of h-ilm. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE UQI
|
||||
// OBSOLETE fr30bf_h_ilm_get (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return GET_H_ILM ();
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Set a value for h-ilm. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ilm_set (SIM_CPU *current_cpu, UQI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SET_H_ILM (newval);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Record trace results for INSN. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_record_trace_results (SIM_CPU *current_cpu, CGEN_INSN *insn,
|
||||
// OBSOLETE int *indices, TRACE_RECORD *tr)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE }
|
||||
|
1780
sim/fr30/cpu.h
1780
sim/fr30/cpu.h
File diff suppressed because it is too large
Load Diff
@ -1,66 +1,66 @@
|
||||
/* Simulator CPU header for fr30.
|
||||
|
||||
THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FR30_CPUALL_H
|
||||
#define FR30_CPUALL_H
|
||||
|
||||
/* Include files for each cpu family. */
|
||||
|
||||
#ifdef WANT_CPU_FR30BF
|
||||
#include "eng.h"
|
||||
#include "cgen-engine.h"
|
||||
#include "cpu.h"
|
||||
#include "decode.h"
|
||||
#endif
|
||||
|
||||
extern const MACH fr30_mach;
|
||||
|
||||
#ifndef WANT_CPU
|
||||
/* The ARGBUF struct. */
|
||||
struct argbuf {
|
||||
/* These are the baseclass definitions. */
|
||||
IADDR addr;
|
||||
const IDESC *idesc;
|
||||
char trace_p;
|
||||
char profile_p;
|
||||
/* ??? Temporary hack for skip insns. */
|
||||
char skip_count;
|
||||
char unused;
|
||||
/* cpu specific data follows */
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef WANT_CPU
|
||||
/* A cached insn.
|
||||
|
||||
??? SCACHE used to contain more than just argbuf. We could delete the
|
||||
type entirely and always just use ARGBUF, but for future concerns and as
|
||||
a level of abstraction it is left in. */
|
||||
|
||||
struct scache {
|
||||
struct argbuf argbuf;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* FR30_CPUALL_H */
|
||||
// OBSOLETE /* Simulator CPU header for fr30.
|
||||
// OBSOLETE
|
||||
// OBSOLETE THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
// OBSOLETE
|
||||
// OBSOLETE Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
// OBSOLETE
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifndef FR30_CPUALL_H
|
||||
// OBSOLETE #define FR30_CPUALL_H
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Include files for each cpu family. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifdef WANT_CPU_FR30BF
|
||||
// OBSOLETE #include "eng.h"
|
||||
// OBSOLETE #include "cgen-engine.h"
|
||||
// OBSOLETE #include "cpu.h"
|
||||
// OBSOLETE #include "decode.h"
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern const MACH fr30_mach;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifndef WANT_CPU
|
||||
// OBSOLETE /* The ARGBUF struct. */
|
||||
// OBSOLETE struct argbuf {
|
||||
// OBSOLETE /* These are the baseclass definitions. */
|
||||
// OBSOLETE IADDR addr;
|
||||
// OBSOLETE const IDESC *idesc;
|
||||
// OBSOLETE char trace_p;
|
||||
// OBSOLETE char profile_p;
|
||||
// OBSOLETE /* ??? Temporary hack for skip insns. */
|
||||
// OBSOLETE char skip_count;
|
||||
// OBSOLETE char unused;
|
||||
// OBSOLETE /* cpu specific data follows */
|
||||
// OBSOLETE };
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifndef WANT_CPU
|
||||
// OBSOLETE /* A cached insn.
|
||||
// OBSOLETE
|
||||
// OBSOLETE ??? SCACHE used to contain more than just argbuf. We could delete the
|
||||
// OBSOLETE type entirely and always just use ARGBUF, but for future concerns and as
|
||||
// OBSOLETE a level of abstraction it is left in. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE struct scache {
|
||||
// OBSOLETE struct argbuf argbuf;
|
||||
// OBSOLETE };
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* FR30_CPUALL_H */
|
||||
|
6906
sim/fr30/decode.c
6906
sim/fr30/decode.c
File diff suppressed because it is too large
Load Diff
@ -1,127 +1,127 @@
|
||||
/* Decode header for fr30bf.
|
||||
|
||||
THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FR30BF_DECODE_H
|
||||
#define FR30BF_DECODE_H
|
||||
|
||||
extern const IDESC *fr30bf_decode (SIM_CPU *, IADDR,
|
||||
CGEN_INSN_INT,
|
||||
ARGBUF *);
|
||||
extern void fr30bf_init_idesc_table (SIM_CPU *);
|
||||
extern void fr30bf_sem_init_idesc_table (SIM_CPU *);
|
||||
extern void fr30bf_semf_init_idesc_table (SIM_CPU *);
|
||||
|
||||
/* Enum declaration for instructions in cpu family fr30bf. */
|
||||
typedef enum fr30bf_insn_type {
|
||||
FR30BF_INSN_X_INVALID, FR30BF_INSN_X_AFTER, FR30BF_INSN_X_BEFORE, FR30BF_INSN_X_CTI_CHAIN
|
||||
, FR30BF_INSN_X_CHAIN, FR30BF_INSN_X_BEGIN, FR30BF_INSN_ADD, FR30BF_INSN_ADDI
|
||||
, FR30BF_INSN_ADD2, FR30BF_INSN_ADDC, FR30BF_INSN_ADDN, FR30BF_INSN_ADDNI
|
||||
, FR30BF_INSN_ADDN2, FR30BF_INSN_SUB, FR30BF_INSN_SUBC, FR30BF_INSN_SUBN
|
||||
, FR30BF_INSN_CMP, FR30BF_INSN_CMPI, FR30BF_INSN_CMP2, FR30BF_INSN_AND
|
||||
, FR30BF_INSN_OR, FR30BF_INSN_EOR, FR30BF_INSN_ANDM, FR30BF_INSN_ANDH
|
||||
, FR30BF_INSN_ANDB, FR30BF_INSN_ORM, FR30BF_INSN_ORH, FR30BF_INSN_ORB
|
||||
, FR30BF_INSN_EORM, FR30BF_INSN_EORH, FR30BF_INSN_EORB, FR30BF_INSN_BANDL
|
||||
, FR30BF_INSN_BORL, FR30BF_INSN_BEORL, FR30BF_INSN_BANDH, FR30BF_INSN_BORH
|
||||
, FR30BF_INSN_BEORH, FR30BF_INSN_BTSTL, FR30BF_INSN_BTSTH, FR30BF_INSN_MUL
|
||||
, FR30BF_INSN_MULU, FR30BF_INSN_MULH, FR30BF_INSN_MULUH, FR30BF_INSN_DIV0S
|
||||
, FR30BF_INSN_DIV0U, FR30BF_INSN_DIV1, FR30BF_INSN_DIV2, FR30BF_INSN_DIV3
|
||||
, FR30BF_INSN_DIV4S, FR30BF_INSN_LSL, FR30BF_INSN_LSLI, FR30BF_INSN_LSL2
|
||||
, FR30BF_INSN_LSR, FR30BF_INSN_LSRI, FR30BF_INSN_LSR2, FR30BF_INSN_ASR
|
||||
, FR30BF_INSN_ASRI, FR30BF_INSN_ASR2, FR30BF_INSN_LDI8, FR30BF_INSN_LDI20
|
||||
, FR30BF_INSN_LDI32, FR30BF_INSN_LD, FR30BF_INSN_LDUH, FR30BF_INSN_LDUB
|
||||
, FR30BF_INSN_LDR13, FR30BF_INSN_LDR13UH, FR30BF_INSN_LDR13UB, FR30BF_INSN_LDR14
|
||||
, FR30BF_INSN_LDR14UH, FR30BF_INSN_LDR14UB, FR30BF_INSN_LDR15, FR30BF_INSN_LDR15GR
|
||||
, FR30BF_INSN_LDR15DR, FR30BF_INSN_LDR15PS, FR30BF_INSN_ST, FR30BF_INSN_STH
|
||||
, FR30BF_INSN_STB, FR30BF_INSN_STR13, FR30BF_INSN_STR13H, FR30BF_INSN_STR13B
|
||||
, FR30BF_INSN_STR14, FR30BF_INSN_STR14H, FR30BF_INSN_STR14B, FR30BF_INSN_STR15
|
||||
, FR30BF_INSN_STR15GR, FR30BF_INSN_STR15DR, FR30BF_INSN_STR15PS, FR30BF_INSN_MOV
|
||||
, FR30BF_INSN_MOVDR, FR30BF_INSN_MOVPS, FR30BF_INSN_MOV2DR, FR30BF_INSN_MOV2PS
|
||||
, FR30BF_INSN_JMP, FR30BF_INSN_JMPD, FR30BF_INSN_CALLR, FR30BF_INSN_CALLRD
|
||||
, FR30BF_INSN_CALL, FR30BF_INSN_CALLD, FR30BF_INSN_RET, FR30BF_INSN_RET_D
|
||||
, FR30BF_INSN_INT, FR30BF_INSN_INTE, FR30BF_INSN_RETI, FR30BF_INSN_BRAD
|
||||
, FR30BF_INSN_BRA, FR30BF_INSN_BNOD, FR30BF_INSN_BNO, FR30BF_INSN_BEQD
|
||||
, FR30BF_INSN_BEQ, FR30BF_INSN_BNED, FR30BF_INSN_BNE, FR30BF_INSN_BCD
|
||||
, FR30BF_INSN_BC, FR30BF_INSN_BNCD, FR30BF_INSN_BNC, FR30BF_INSN_BND
|
||||
, FR30BF_INSN_BN, FR30BF_INSN_BPD, FR30BF_INSN_BP, FR30BF_INSN_BVD
|
||||
, FR30BF_INSN_BV, FR30BF_INSN_BNVD, FR30BF_INSN_BNV, FR30BF_INSN_BLTD
|
||||
, FR30BF_INSN_BLT, FR30BF_INSN_BGED, FR30BF_INSN_BGE, FR30BF_INSN_BLED
|
||||
, FR30BF_INSN_BLE, FR30BF_INSN_BGTD, FR30BF_INSN_BGT, FR30BF_INSN_BLSD
|
||||
, FR30BF_INSN_BLS, FR30BF_INSN_BHID, FR30BF_INSN_BHI, FR30BF_INSN_DMOVR13
|
||||
, FR30BF_INSN_DMOVR13H, FR30BF_INSN_DMOVR13B, FR30BF_INSN_DMOVR13PI, FR30BF_INSN_DMOVR13PIH
|
||||
, FR30BF_INSN_DMOVR13PIB, FR30BF_INSN_DMOVR15PI, FR30BF_INSN_DMOV2R13, FR30BF_INSN_DMOV2R13H
|
||||
, FR30BF_INSN_DMOV2R13B, FR30BF_INSN_DMOV2R13PI, FR30BF_INSN_DMOV2R13PIH, FR30BF_INSN_DMOV2R13PIB
|
||||
, FR30BF_INSN_DMOV2R15PD, FR30BF_INSN_LDRES, FR30BF_INSN_STRES, FR30BF_INSN_COPOP
|
||||
, FR30BF_INSN_COPLD, FR30BF_INSN_COPST, FR30BF_INSN_COPSV, FR30BF_INSN_NOP
|
||||
, FR30BF_INSN_ANDCCR, FR30BF_INSN_ORCCR, FR30BF_INSN_STILM, FR30BF_INSN_ADDSP
|
||||
, FR30BF_INSN_EXTSB, FR30BF_INSN_EXTUB, FR30BF_INSN_EXTSH, FR30BF_INSN_EXTUH
|
||||
, FR30BF_INSN_LDM0, FR30BF_INSN_LDM1, FR30BF_INSN_STM0, FR30BF_INSN_STM1
|
||||
, FR30BF_INSN_ENTER, FR30BF_INSN_LEAVE, FR30BF_INSN_XCHB, FR30BF_INSN_MAX
|
||||
} FR30BF_INSN_TYPE;
|
||||
|
||||
/* Enum declaration for semantic formats in cpu family fr30bf. */
|
||||
typedef enum fr30bf_sfmt_type {
|
||||
FR30BF_SFMT_EMPTY, FR30BF_SFMT_ADD, FR30BF_SFMT_ADDI, FR30BF_SFMT_ADD2
|
||||
, FR30BF_SFMT_ADDC, FR30BF_SFMT_ADDN, FR30BF_SFMT_ADDNI, FR30BF_SFMT_ADDN2
|
||||
, FR30BF_SFMT_CMP, FR30BF_SFMT_CMPI, FR30BF_SFMT_CMP2, FR30BF_SFMT_AND
|
||||
, FR30BF_SFMT_ANDM, FR30BF_SFMT_ANDH, FR30BF_SFMT_ANDB, FR30BF_SFMT_BANDL
|
||||
, FR30BF_SFMT_BTSTL, FR30BF_SFMT_MUL, FR30BF_SFMT_MULU, FR30BF_SFMT_MULH
|
||||
, FR30BF_SFMT_DIV0S, FR30BF_SFMT_DIV0U, FR30BF_SFMT_DIV1, FR30BF_SFMT_DIV2
|
||||
, FR30BF_SFMT_DIV3, FR30BF_SFMT_DIV4S, FR30BF_SFMT_LSL, FR30BF_SFMT_LSLI
|
||||
, FR30BF_SFMT_LDI8, FR30BF_SFMT_LDI20, FR30BF_SFMT_LDI32, FR30BF_SFMT_LD
|
||||
, FR30BF_SFMT_LDUH, FR30BF_SFMT_LDUB, FR30BF_SFMT_LDR13, FR30BF_SFMT_LDR13UH
|
||||
, FR30BF_SFMT_LDR13UB, FR30BF_SFMT_LDR14, FR30BF_SFMT_LDR14UH, FR30BF_SFMT_LDR14UB
|
||||
, FR30BF_SFMT_LDR15, FR30BF_SFMT_LDR15GR, FR30BF_SFMT_LDR15DR, FR30BF_SFMT_LDR15PS
|
||||
, FR30BF_SFMT_ST, FR30BF_SFMT_STH, FR30BF_SFMT_STB, FR30BF_SFMT_STR13
|
||||
, FR30BF_SFMT_STR13H, FR30BF_SFMT_STR13B, FR30BF_SFMT_STR14, FR30BF_SFMT_STR14H
|
||||
, FR30BF_SFMT_STR14B, FR30BF_SFMT_STR15, FR30BF_SFMT_STR15GR, FR30BF_SFMT_STR15DR
|
||||
, FR30BF_SFMT_STR15PS, FR30BF_SFMT_MOV, FR30BF_SFMT_MOVDR, FR30BF_SFMT_MOVPS
|
||||
, FR30BF_SFMT_MOV2DR, FR30BF_SFMT_MOV2PS, FR30BF_SFMT_JMP, FR30BF_SFMT_CALLR
|
||||
, FR30BF_SFMT_CALL, FR30BF_SFMT_RET, FR30BF_SFMT_INT, FR30BF_SFMT_INTE
|
||||
, FR30BF_SFMT_RETI, FR30BF_SFMT_BRAD, FR30BF_SFMT_BNOD, FR30BF_SFMT_BEQD
|
||||
, FR30BF_SFMT_BCD, FR30BF_SFMT_BND, FR30BF_SFMT_BVD, FR30BF_SFMT_BLTD
|
||||
, FR30BF_SFMT_BLED, FR30BF_SFMT_BLSD, FR30BF_SFMT_DMOVR13, FR30BF_SFMT_DMOVR13H
|
||||
, FR30BF_SFMT_DMOVR13B, FR30BF_SFMT_DMOVR13PI, FR30BF_SFMT_DMOVR13PIH, FR30BF_SFMT_DMOVR13PIB
|
||||
, FR30BF_SFMT_DMOVR15PI, FR30BF_SFMT_DMOV2R13, FR30BF_SFMT_DMOV2R13H, FR30BF_SFMT_DMOV2R13B
|
||||
, FR30BF_SFMT_DMOV2R13PI, FR30BF_SFMT_DMOV2R13PIH, FR30BF_SFMT_DMOV2R13PIB, FR30BF_SFMT_DMOV2R15PD
|
||||
, FR30BF_SFMT_LDRES, FR30BF_SFMT_COPOP, FR30BF_SFMT_ANDCCR, FR30BF_SFMT_STILM
|
||||
, FR30BF_SFMT_ADDSP, FR30BF_SFMT_EXTSB, FR30BF_SFMT_EXTUB, FR30BF_SFMT_EXTSH
|
||||
, FR30BF_SFMT_EXTUH, FR30BF_SFMT_LDM0, FR30BF_SFMT_LDM1, FR30BF_SFMT_STM0
|
||||
, FR30BF_SFMT_STM1, FR30BF_SFMT_ENTER, FR30BF_SFMT_LEAVE, FR30BF_SFMT_XCHB
|
||||
} FR30BF_SFMT_TYPE;
|
||||
|
||||
/* Function unit handlers (user written). */
|
||||
|
||||
extern int fr30bf_model_fr30_1_u_stm (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*reglist*/);
|
||||
extern int fr30bf_model_fr30_1_u_ldm (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*reglist*/);
|
||||
extern int fr30bf_model_fr30_1_u_store (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Ri*/, INT /*Rj*/);
|
||||
extern int fr30bf_model_fr30_1_u_load (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Rj*/, INT /*Ri*/);
|
||||
extern int fr30bf_model_fr30_1_u_cti (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Ri*/);
|
||||
extern int fr30bf_model_fr30_1_u_exec (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Ri*/, INT /*Rj*/, INT /*Ri*/);
|
||||
|
||||
/* Profiling before/after handlers (user written) */
|
||||
|
||||
extern void fr30bf_model_insn_before (SIM_CPU *, int /*first_p*/);
|
||||
extern void fr30bf_model_insn_after (SIM_CPU *, int /*last_p*/, int /*cycles*/);
|
||||
|
||||
#endif /* FR30BF_DECODE_H */
|
||||
// OBSOLETE /* Decode header for fr30bf.
|
||||
// OBSOLETE
|
||||
// OBSOLETE THIS FILE IS MACHINE GENERATED WITH CGEN.
|
||||
// OBSOLETE
|
||||
// OBSOLETE Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
// OBSOLETE
|
||||
// OBSOLETE */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifndef FR30BF_DECODE_H
|
||||
// OBSOLETE #define FR30BF_DECODE_H
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern const IDESC *fr30bf_decode (SIM_CPU *, IADDR,
|
||||
// OBSOLETE CGEN_INSN_INT,
|
||||
// OBSOLETE ARGBUF *);
|
||||
// OBSOLETE extern void fr30bf_init_idesc_table (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_sem_init_idesc_table (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_semf_init_idesc_table (SIM_CPU *);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Enum declaration for instructions in cpu family fr30bf. */
|
||||
// OBSOLETE typedef enum fr30bf_insn_type {
|
||||
// OBSOLETE FR30BF_INSN_X_INVALID, FR30BF_INSN_X_AFTER, FR30BF_INSN_X_BEFORE, FR30BF_INSN_X_CTI_CHAIN
|
||||
// OBSOLETE , FR30BF_INSN_X_CHAIN, FR30BF_INSN_X_BEGIN, FR30BF_INSN_ADD, FR30BF_INSN_ADDI
|
||||
// OBSOLETE , FR30BF_INSN_ADD2, FR30BF_INSN_ADDC, FR30BF_INSN_ADDN, FR30BF_INSN_ADDNI
|
||||
// OBSOLETE , FR30BF_INSN_ADDN2, FR30BF_INSN_SUB, FR30BF_INSN_SUBC, FR30BF_INSN_SUBN
|
||||
// OBSOLETE , FR30BF_INSN_CMP, FR30BF_INSN_CMPI, FR30BF_INSN_CMP2, FR30BF_INSN_AND
|
||||
// OBSOLETE , FR30BF_INSN_OR, FR30BF_INSN_EOR, FR30BF_INSN_ANDM, FR30BF_INSN_ANDH
|
||||
// OBSOLETE , FR30BF_INSN_ANDB, FR30BF_INSN_ORM, FR30BF_INSN_ORH, FR30BF_INSN_ORB
|
||||
// OBSOLETE , FR30BF_INSN_EORM, FR30BF_INSN_EORH, FR30BF_INSN_EORB, FR30BF_INSN_BANDL
|
||||
// OBSOLETE , FR30BF_INSN_BORL, FR30BF_INSN_BEORL, FR30BF_INSN_BANDH, FR30BF_INSN_BORH
|
||||
// OBSOLETE , FR30BF_INSN_BEORH, FR30BF_INSN_BTSTL, FR30BF_INSN_BTSTH, FR30BF_INSN_MUL
|
||||
// OBSOLETE , FR30BF_INSN_MULU, FR30BF_INSN_MULH, FR30BF_INSN_MULUH, FR30BF_INSN_DIV0S
|
||||
// OBSOLETE , FR30BF_INSN_DIV0U, FR30BF_INSN_DIV1, FR30BF_INSN_DIV2, FR30BF_INSN_DIV3
|
||||
// OBSOLETE , FR30BF_INSN_DIV4S, FR30BF_INSN_LSL, FR30BF_INSN_LSLI, FR30BF_INSN_LSL2
|
||||
// OBSOLETE , FR30BF_INSN_LSR, FR30BF_INSN_LSRI, FR30BF_INSN_LSR2, FR30BF_INSN_ASR
|
||||
// OBSOLETE , FR30BF_INSN_ASRI, FR30BF_INSN_ASR2, FR30BF_INSN_LDI8, FR30BF_INSN_LDI20
|
||||
// OBSOLETE , FR30BF_INSN_LDI32, FR30BF_INSN_LD, FR30BF_INSN_LDUH, FR30BF_INSN_LDUB
|
||||
// OBSOLETE , FR30BF_INSN_LDR13, FR30BF_INSN_LDR13UH, FR30BF_INSN_LDR13UB, FR30BF_INSN_LDR14
|
||||
// OBSOLETE , FR30BF_INSN_LDR14UH, FR30BF_INSN_LDR14UB, FR30BF_INSN_LDR15, FR30BF_INSN_LDR15GR
|
||||
// OBSOLETE , FR30BF_INSN_LDR15DR, FR30BF_INSN_LDR15PS, FR30BF_INSN_ST, FR30BF_INSN_STH
|
||||
// OBSOLETE , FR30BF_INSN_STB, FR30BF_INSN_STR13, FR30BF_INSN_STR13H, FR30BF_INSN_STR13B
|
||||
// OBSOLETE , FR30BF_INSN_STR14, FR30BF_INSN_STR14H, FR30BF_INSN_STR14B, FR30BF_INSN_STR15
|
||||
// OBSOLETE , FR30BF_INSN_STR15GR, FR30BF_INSN_STR15DR, FR30BF_INSN_STR15PS, FR30BF_INSN_MOV
|
||||
// OBSOLETE , FR30BF_INSN_MOVDR, FR30BF_INSN_MOVPS, FR30BF_INSN_MOV2DR, FR30BF_INSN_MOV2PS
|
||||
// OBSOLETE , FR30BF_INSN_JMP, FR30BF_INSN_JMPD, FR30BF_INSN_CALLR, FR30BF_INSN_CALLRD
|
||||
// OBSOLETE , FR30BF_INSN_CALL, FR30BF_INSN_CALLD, FR30BF_INSN_RET, FR30BF_INSN_RET_D
|
||||
// OBSOLETE , FR30BF_INSN_INT, FR30BF_INSN_INTE, FR30BF_INSN_RETI, FR30BF_INSN_BRAD
|
||||
// OBSOLETE , FR30BF_INSN_BRA, FR30BF_INSN_BNOD, FR30BF_INSN_BNO, FR30BF_INSN_BEQD
|
||||
// OBSOLETE , FR30BF_INSN_BEQ, FR30BF_INSN_BNED, FR30BF_INSN_BNE, FR30BF_INSN_BCD
|
||||
// OBSOLETE , FR30BF_INSN_BC, FR30BF_INSN_BNCD, FR30BF_INSN_BNC, FR30BF_INSN_BND
|
||||
// OBSOLETE , FR30BF_INSN_BN, FR30BF_INSN_BPD, FR30BF_INSN_BP, FR30BF_INSN_BVD
|
||||
// OBSOLETE , FR30BF_INSN_BV, FR30BF_INSN_BNVD, FR30BF_INSN_BNV, FR30BF_INSN_BLTD
|
||||
// OBSOLETE , FR30BF_INSN_BLT, FR30BF_INSN_BGED, FR30BF_INSN_BGE, FR30BF_INSN_BLED
|
||||
// OBSOLETE , FR30BF_INSN_BLE, FR30BF_INSN_BGTD, FR30BF_INSN_BGT, FR30BF_INSN_BLSD
|
||||
// OBSOLETE , FR30BF_INSN_BLS, FR30BF_INSN_BHID, FR30BF_INSN_BHI, FR30BF_INSN_DMOVR13
|
||||
// OBSOLETE , FR30BF_INSN_DMOVR13H, FR30BF_INSN_DMOVR13B, FR30BF_INSN_DMOVR13PI, FR30BF_INSN_DMOVR13PIH
|
||||
// OBSOLETE , FR30BF_INSN_DMOVR13PIB, FR30BF_INSN_DMOVR15PI, FR30BF_INSN_DMOV2R13, FR30BF_INSN_DMOV2R13H
|
||||
// OBSOLETE , FR30BF_INSN_DMOV2R13B, FR30BF_INSN_DMOV2R13PI, FR30BF_INSN_DMOV2R13PIH, FR30BF_INSN_DMOV2R13PIB
|
||||
// OBSOLETE , FR30BF_INSN_DMOV2R15PD, FR30BF_INSN_LDRES, FR30BF_INSN_STRES, FR30BF_INSN_COPOP
|
||||
// OBSOLETE , FR30BF_INSN_COPLD, FR30BF_INSN_COPST, FR30BF_INSN_COPSV, FR30BF_INSN_NOP
|
||||
// OBSOLETE , FR30BF_INSN_ANDCCR, FR30BF_INSN_ORCCR, FR30BF_INSN_STILM, FR30BF_INSN_ADDSP
|
||||
// OBSOLETE , FR30BF_INSN_EXTSB, FR30BF_INSN_EXTUB, FR30BF_INSN_EXTSH, FR30BF_INSN_EXTUH
|
||||
// OBSOLETE , FR30BF_INSN_LDM0, FR30BF_INSN_LDM1, FR30BF_INSN_STM0, FR30BF_INSN_STM1
|
||||
// OBSOLETE , FR30BF_INSN_ENTER, FR30BF_INSN_LEAVE, FR30BF_INSN_XCHB, FR30BF_INSN_MAX
|
||||
// OBSOLETE } FR30BF_INSN_TYPE;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Enum declaration for semantic formats in cpu family fr30bf. */
|
||||
// OBSOLETE typedef enum fr30bf_sfmt_type {
|
||||
// OBSOLETE FR30BF_SFMT_EMPTY, FR30BF_SFMT_ADD, FR30BF_SFMT_ADDI, FR30BF_SFMT_ADD2
|
||||
// OBSOLETE , FR30BF_SFMT_ADDC, FR30BF_SFMT_ADDN, FR30BF_SFMT_ADDNI, FR30BF_SFMT_ADDN2
|
||||
// OBSOLETE , FR30BF_SFMT_CMP, FR30BF_SFMT_CMPI, FR30BF_SFMT_CMP2, FR30BF_SFMT_AND
|
||||
// OBSOLETE , FR30BF_SFMT_ANDM, FR30BF_SFMT_ANDH, FR30BF_SFMT_ANDB, FR30BF_SFMT_BANDL
|
||||
// OBSOLETE , FR30BF_SFMT_BTSTL, FR30BF_SFMT_MUL, FR30BF_SFMT_MULU, FR30BF_SFMT_MULH
|
||||
// OBSOLETE , FR30BF_SFMT_DIV0S, FR30BF_SFMT_DIV0U, FR30BF_SFMT_DIV1, FR30BF_SFMT_DIV2
|
||||
// OBSOLETE , FR30BF_SFMT_DIV3, FR30BF_SFMT_DIV4S, FR30BF_SFMT_LSL, FR30BF_SFMT_LSLI
|
||||
// OBSOLETE , FR30BF_SFMT_LDI8, FR30BF_SFMT_LDI20, FR30BF_SFMT_LDI32, FR30BF_SFMT_LD
|
||||
// OBSOLETE , FR30BF_SFMT_LDUH, FR30BF_SFMT_LDUB, FR30BF_SFMT_LDR13, FR30BF_SFMT_LDR13UH
|
||||
// OBSOLETE , FR30BF_SFMT_LDR13UB, FR30BF_SFMT_LDR14, FR30BF_SFMT_LDR14UH, FR30BF_SFMT_LDR14UB
|
||||
// OBSOLETE , FR30BF_SFMT_LDR15, FR30BF_SFMT_LDR15GR, FR30BF_SFMT_LDR15DR, FR30BF_SFMT_LDR15PS
|
||||
// OBSOLETE , FR30BF_SFMT_ST, FR30BF_SFMT_STH, FR30BF_SFMT_STB, FR30BF_SFMT_STR13
|
||||
// OBSOLETE , FR30BF_SFMT_STR13H, FR30BF_SFMT_STR13B, FR30BF_SFMT_STR14, FR30BF_SFMT_STR14H
|
||||
// OBSOLETE , FR30BF_SFMT_STR14B, FR30BF_SFMT_STR15, FR30BF_SFMT_STR15GR, FR30BF_SFMT_STR15DR
|
||||
// OBSOLETE , FR30BF_SFMT_STR15PS, FR30BF_SFMT_MOV, FR30BF_SFMT_MOVDR, FR30BF_SFMT_MOVPS
|
||||
// OBSOLETE , FR30BF_SFMT_MOV2DR, FR30BF_SFMT_MOV2PS, FR30BF_SFMT_JMP, FR30BF_SFMT_CALLR
|
||||
// OBSOLETE , FR30BF_SFMT_CALL, FR30BF_SFMT_RET, FR30BF_SFMT_INT, FR30BF_SFMT_INTE
|
||||
// OBSOLETE , FR30BF_SFMT_RETI, FR30BF_SFMT_BRAD, FR30BF_SFMT_BNOD, FR30BF_SFMT_BEQD
|
||||
// OBSOLETE , FR30BF_SFMT_BCD, FR30BF_SFMT_BND, FR30BF_SFMT_BVD, FR30BF_SFMT_BLTD
|
||||
// OBSOLETE , FR30BF_SFMT_BLED, FR30BF_SFMT_BLSD, FR30BF_SFMT_DMOVR13, FR30BF_SFMT_DMOVR13H
|
||||
// OBSOLETE , FR30BF_SFMT_DMOVR13B, FR30BF_SFMT_DMOVR13PI, FR30BF_SFMT_DMOVR13PIH, FR30BF_SFMT_DMOVR13PIB
|
||||
// OBSOLETE , FR30BF_SFMT_DMOVR15PI, FR30BF_SFMT_DMOV2R13, FR30BF_SFMT_DMOV2R13H, FR30BF_SFMT_DMOV2R13B
|
||||
// OBSOLETE , FR30BF_SFMT_DMOV2R13PI, FR30BF_SFMT_DMOV2R13PIH, FR30BF_SFMT_DMOV2R13PIB, FR30BF_SFMT_DMOV2R15PD
|
||||
// OBSOLETE , FR30BF_SFMT_LDRES, FR30BF_SFMT_COPOP, FR30BF_SFMT_ANDCCR, FR30BF_SFMT_STILM
|
||||
// OBSOLETE , FR30BF_SFMT_ADDSP, FR30BF_SFMT_EXTSB, FR30BF_SFMT_EXTUB, FR30BF_SFMT_EXTSH
|
||||
// OBSOLETE , FR30BF_SFMT_EXTUH, FR30BF_SFMT_LDM0, FR30BF_SFMT_LDM1, FR30BF_SFMT_STM0
|
||||
// OBSOLETE , FR30BF_SFMT_STM1, FR30BF_SFMT_ENTER, FR30BF_SFMT_LEAVE, FR30BF_SFMT_XCHB
|
||||
// OBSOLETE } FR30BF_SFMT_TYPE;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Function unit handlers (user written). */
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern int fr30bf_model_fr30_1_u_stm (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*reglist*/);
|
||||
// OBSOLETE extern int fr30bf_model_fr30_1_u_ldm (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*reglist*/);
|
||||
// OBSOLETE extern int fr30bf_model_fr30_1_u_store (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Ri*/, INT /*Rj*/);
|
||||
// OBSOLETE extern int fr30bf_model_fr30_1_u_load (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Rj*/, INT /*Ri*/);
|
||||
// OBSOLETE extern int fr30bf_model_fr30_1_u_cti (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Ri*/);
|
||||
// OBSOLETE extern int fr30bf_model_fr30_1_u_exec (SIM_CPU *, const IDESC *, int /*unit_num*/, int /*referenced*/, INT /*Ri*/, INT /*Rj*/, INT /*Ri*/);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Profiling before/after handlers (user written) */
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern void fr30bf_model_insn_before (SIM_CPU *, int /*first_p*/);
|
||||
// OBSOLETE extern void fr30bf_model_insn_after (SIM_CPU *, int /*last_p*/, int /*cycles*/);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* FR30BF_DECODE_H */
|
||||
|
@ -1,98 +1,98 @@
|
||||
/* fr30 device support
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* ??? All of this is just to get something going. wip! */
|
||||
|
||||
#include "sim-main.h"
|
||||
|
||||
#ifdef HAVE_DV_SOCKSER
|
||||
#include "dv-sockser.h"
|
||||
#endif
|
||||
|
||||
device fr30_devices;
|
||||
|
||||
int
|
||||
device_io_read_buffer (device *me, void *source, int space,
|
||||
address_word addr, unsigned nr_bytes,
|
||||
SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
|
||||
{
|
||||
if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
|
||||
return nr_bytes;
|
||||
|
||||
#ifdef HAVE_DV_SOCKSER
|
||||
if (addr == UART_INCHAR_ADDR)
|
||||
{
|
||||
int c = dv_sockser_read (sd);
|
||||
if (c == -1)
|
||||
return 0;
|
||||
*(char *) source = c;
|
||||
return 1;
|
||||
}
|
||||
if (addr == UART_STATUS_ADDR)
|
||||
{
|
||||
int status = dv_sockser_status (sd);
|
||||
unsigned char *p = source;
|
||||
p[0] = 0;
|
||||
p[1] = (((status & DV_SOCKSER_INPUT_EMPTY)
|
||||
#ifdef UART_INPUT_READY0
|
||||
? UART_INPUT_READY : 0)
|
||||
#else
|
||||
? 0 : UART_INPUT_READY)
|
||||
#endif
|
||||
+ ((status & DV_SOCKSER_OUTPUT_EMPTY) ? UART_OUTPUT_READY : 0));
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
return nr_bytes;
|
||||
}
|
||||
|
||||
int
|
||||
device_io_write_buffer (device *me, const void *source, int space,
|
||||
address_word addr, unsigned nr_bytes,
|
||||
SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
|
||||
{
|
||||
#if WITH_SCACHE
|
||||
if (addr == MCCR_ADDR)
|
||||
{
|
||||
if ((*(const char *) source & MCCR_CP) != 0)
|
||||
scache_flush (sd);
|
||||
return nr_bytes;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
|
||||
return nr_bytes;
|
||||
|
||||
#if HAVE_DV_SOCKSER
|
||||
if (addr == UART_OUTCHAR_ADDR)
|
||||
{
|
||||
int rc = dv_sockser_write (sd, *(char *) source);
|
||||
return rc == 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return nr_bytes;
|
||||
}
|
||||
|
||||
void
|
||||
device_error (device *me, char *message, ...)
|
||||
{
|
||||
}
|
||||
// OBSOLETE /* fr30 device support
|
||||
// OBSOLETE Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
// OBSOLETE Contributed by Cygnus Solutions.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* ??? All of this is just to get something going. wip! */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-main.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifdef HAVE_DV_SOCKSER
|
||||
// OBSOLETE #include "dv-sockser.h"
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE device fr30_devices;
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE device_io_read_buffer (device *me, void *source, int space,
|
||||
// OBSOLETE address_word addr, unsigned nr_bytes,
|
||||
// OBSOLETE SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
|
||||
// OBSOLETE return nr_bytes;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifdef HAVE_DV_SOCKSER
|
||||
// OBSOLETE if (addr == UART_INCHAR_ADDR)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int c = dv_sockser_read (sd);
|
||||
// OBSOLETE if (c == -1)
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE *(char *) source = c;
|
||||
// OBSOLETE return 1;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE if (addr == UART_STATUS_ADDR)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int status = dv_sockser_status (sd);
|
||||
// OBSOLETE unsigned char *p = source;
|
||||
// OBSOLETE p[0] = 0;
|
||||
// OBSOLETE p[1] = (((status & DV_SOCKSER_INPUT_EMPTY)
|
||||
// OBSOLETE #ifdef UART_INPUT_READY0
|
||||
// OBSOLETE ? UART_INPUT_READY : 0)
|
||||
// OBSOLETE #else
|
||||
// OBSOLETE ? 0 : UART_INPUT_READY)
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE + ((status & DV_SOCKSER_OUTPUT_EMPTY) ? UART_OUTPUT_READY : 0));
|
||||
// OBSOLETE return 2;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE return nr_bytes;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE device_io_write_buffer (device *me, const void *source, int space,
|
||||
// OBSOLETE address_word addr, unsigned nr_bytes,
|
||||
// OBSOLETE SIM_DESC sd, SIM_CPU *cpu, sim_cia cia)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE #if WITH_SCACHE
|
||||
// OBSOLETE if (addr == MCCR_ADDR)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if ((*(const char *) source & MCCR_CP) != 0)
|
||||
// OBSOLETE scache_flush (sd);
|
||||
// OBSOLETE return nr_bytes;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
|
||||
// OBSOLETE return nr_bytes;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if HAVE_DV_SOCKSER
|
||||
// OBSOLETE if (addr == UART_OUTCHAR_ADDR)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int rc = dv_sockser_write (sd, *(char *) source);
|
||||
// OBSOLETE return rc == 1;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE return nr_bytes;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE device_error (device *me, char *message, ...)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE }
|
||||
|
@ -1,96 +1,96 @@
|
||||
/* collection of junk waiting time to sort out
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
This file is part of the GNU Simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef FR30_SIM_H
|
||||
#define FR30_SIM_H
|
||||
|
||||
/* gdb register numbers */
|
||||
#define PC_REGNUM 16
|
||||
#define PS_REGNUM 17
|
||||
#define TBR_REGNUM 18
|
||||
#define RP_REGNUM 19
|
||||
#define SSP_REGNUM 20
|
||||
#define USP_REGNUM 21
|
||||
#define MDH_REGNUM 22
|
||||
#define MDL_REGNUM 23
|
||||
|
||||
extern BI fr30bf_h_sbit_get_handler (SIM_CPU *);
|
||||
extern void fr30bf_h_sbit_set_handler (SIM_CPU *, BI);
|
||||
|
||||
extern UQI fr30bf_h_ccr_get_handler (SIM_CPU *);
|
||||
extern void fr30bf_h_ccr_set_handler (SIM_CPU *, UQI);
|
||||
|
||||
extern UQI fr30bf_h_scr_get_handler (SIM_CPU *);
|
||||
extern void fr30bf_h_scr_set_handler (SIM_CPU *, UQI);
|
||||
|
||||
extern UQI fr30bf_h_ilm_get_handler (SIM_CPU *);
|
||||
extern void fr30bf_h_ilm_set_handler (SIM_CPU *, UQI);
|
||||
|
||||
extern USI fr30bf_h_ps_get_handler (SIM_CPU *);
|
||||
extern void fr30bf_h_ps_set_handler (SIM_CPU *, USI);
|
||||
|
||||
extern SI fr30bf_h_dr_get_handler (SIM_CPU *, UINT);
|
||||
extern void fr30bf_h_dr_set_handler (SIM_CPU *, UINT, SI);
|
||||
|
||||
#define GETTWI GETTSI
|
||||
#define SETTWI SETTSI
|
||||
|
||||
/* Hardware/device support.
|
||||
??? Will eventually want to move device stuff to config files. */
|
||||
|
||||
/* Special purpose traps. */
|
||||
#define TRAP_SYSCALL 10
|
||||
#define TRAP_BREAKPOINT 9
|
||||
|
||||
/* Support for the MCCR register (Cache Control Register) is needed in order
|
||||
for overlays to work correctly with the scache: cached instructions need
|
||||
to be flushed when the instruction space is changed at runtime. */
|
||||
|
||||
/* Cache Control Register */
|
||||
#define MCCR_ADDR 0xffffffff
|
||||
#define MCCR_CP 0x80
|
||||
/* not supported */
|
||||
#define MCCR_CM0 2
|
||||
#define MCCR_CM1 1
|
||||
|
||||
/* Serial device addresses. */
|
||||
/* These are the values for the MSA2000 board.
|
||||
??? Will eventually need to move this to a config file. */
|
||||
#define UART_INCHAR_ADDR 0xff004009
|
||||
#define UART_OUTCHAR_ADDR 0xff004007
|
||||
#define UART_STATUS_ADDR 0xff004002
|
||||
|
||||
#define UART_INPUT_READY 0x4
|
||||
#define UART_OUTPUT_READY 0x1
|
||||
|
||||
/* Start address and length of all device support. */
|
||||
#define FR30_DEVICE_ADDR 0xff000000
|
||||
#define FR30_DEVICE_LEN 0x00ffffff
|
||||
|
||||
/* sim_core_attach device argument. */
|
||||
extern device fr30_devices;
|
||||
|
||||
/* FIXME: Temporary, until device support ready. */
|
||||
struct _device { int foo; };
|
||||
|
||||
/* Handle the trap insn. */
|
||||
USI fr30_int (SIM_CPU *, PCADDR, int);
|
||||
|
||||
#endif /* FR30_SIM_H */
|
||||
// OBSOLETE /* collection of junk waiting time to sort out
|
||||
// OBSOLETE Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
// OBSOLETE Contributed by Cygnus Solutions.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU Simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifndef FR30_SIM_H
|
||||
// OBSOLETE #define FR30_SIM_H
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* gdb register numbers */
|
||||
// OBSOLETE #define PC_REGNUM 16
|
||||
// OBSOLETE #define PS_REGNUM 17
|
||||
// OBSOLETE #define TBR_REGNUM 18
|
||||
// OBSOLETE #define RP_REGNUM 19
|
||||
// OBSOLETE #define SSP_REGNUM 20
|
||||
// OBSOLETE #define USP_REGNUM 21
|
||||
// OBSOLETE #define MDH_REGNUM 22
|
||||
// OBSOLETE #define MDL_REGNUM 23
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern BI fr30bf_h_sbit_get_handler (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_h_sbit_set_handler (SIM_CPU *, BI);
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern UQI fr30bf_h_ccr_get_handler (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_h_ccr_set_handler (SIM_CPU *, UQI);
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern UQI fr30bf_h_scr_get_handler (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_h_scr_set_handler (SIM_CPU *, UQI);
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern UQI fr30bf_h_ilm_get_handler (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_h_ilm_set_handler (SIM_CPU *, UQI);
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern USI fr30bf_h_ps_get_handler (SIM_CPU *);
|
||||
// OBSOLETE extern void fr30bf_h_ps_set_handler (SIM_CPU *, USI);
|
||||
// OBSOLETE
|
||||
// OBSOLETE extern SI fr30bf_h_dr_get_handler (SIM_CPU *, UINT);
|
||||
// OBSOLETE extern void fr30bf_h_dr_set_handler (SIM_CPU *, UINT, SI);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define GETTWI GETTSI
|
||||
// OBSOLETE #define SETTWI SETTSI
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Hardware/device support.
|
||||
// OBSOLETE ??? Will eventually want to move device stuff to config files. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Special purpose traps. */
|
||||
// OBSOLETE #define TRAP_SYSCALL 10
|
||||
// OBSOLETE #define TRAP_BREAKPOINT 9
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Support for the MCCR register (Cache Control Register) is needed in order
|
||||
// OBSOLETE for overlays to work correctly with the scache: cached instructions need
|
||||
// OBSOLETE to be flushed when the instruction space is changed at runtime. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cache Control Register */
|
||||
// OBSOLETE #define MCCR_ADDR 0xffffffff
|
||||
// OBSOLETE #define MCCR_CP 0x80
|
||||
// OBSOLETE /* not supported */
|
||||
// OBSOLETE #define MCCR_CM0 2
|
||||
// OBSOLETE #define MCCR_CM1 1
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Serial device addresses. */
|
||||
// OBSOLETE /* These are the values for the MSA2000 board.
|
||||
// OBSOLETE ??? Will eventually need to move this to a config file. */
|
||||
// OBSOLETE #define UART_INCHAR_ADDR 0xff004009
|
||||
// OBSOLETE #define UART_OUTCHAR_ADDR 0xff004007
|
||||
// OBSOLETE #define UART_STATUS_ADDR 0xff004002
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define UART_INPUT_READY 0x4
|
||||
// OBSOLETE #define UART_OUTPUT_READY 0x1
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Start address and length of all device support. */
|
||||
// OBSOLETE #define FR30_DEVICE_ADDR 0xff000000
|
||||
// OBSOLETE #define FR30_DEVICE_LEN 0x00ffffff
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* sim_core_attach device argument. */
|
||||
// OBSOLETE extern device fr30_devices;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* FIXME: Temporary, until device support ready. */
|
||||
// OBSOLETE struct _device { int foo; };
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Handle the trap insn. */
|
||||
// OBSOLETE USI fr30_int (SIM_CPU *, PCADDR, int);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* FR30_SIM_H */
|
||||
|
846
sim/fr30/fr30.c
846
sim/fr30/fr30.c
@ -1,423 +1,423 @@
|
||||
/* fr30 simulator support code
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define WANT_CPU
|
||||
#define WANT_CPU_FR30BF
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "cgen-mem.h"
|
||||
#include "cgen-ops.h"
|
||||
|
||||
/* Convert gdb dedicated register number to actual dr reg number. */
|
||||
|
||||
static int
|
||||
decode_gdb_dr_regnum (int gdb_regnum)
|
||||
{
|
||||
switch (gdb_regnum)
|
||||
{
|
||||
case TBR_REGNUM : return H_DR_TBR;
|
||||
case RP_REGNUM : return H_DR_RP;
|
||||
case SSP_REGNUM : return H_DR_SSP;
|
||||
case USP_REGNUM : return H_DR_USP;
|
||||
case MDH_REGNUM : return H_DR_MDH;
|
||||
case MDL_REGNUM : return H_DR_MDL;
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* The contents of BUF are in target byte order. */
|
||||
|
||||
int
|
||||
fr30bf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
|
||||
{
|
||||
if (rn < 16)
|
||||
SETTWI (buf, fr30bf_h_gr_get (current_cpu, rn));
|
||||
else
|
||||
switch (rn)
|
||||
{
|
||||
case PC_REGNUM :
|
||||
SETTWI (buf, fr30bf_h_pc_get (current_cpu));
|
||||
break;
|
||||
case PS_REGNUM :
|
||||
SETTWI (buf, fr30bf_h_ps_get (current_cpu));
|
||||
break;
|
||||
case TBR_REGNUM :
|
||||
case RP_REGNUM :
|
||||
case SSP_REGNUM :
|
||||
case USP_REGNUM :
|
||||
case MDH_REGNUM :
|
||||
case MDL_REGNUM :
|
||||
SETTWI (buf, fr30bf_h_dr_get (current_cpu,
|
||||
decode_gdb_dr_regnum (rn)));
|
||||
break;
|
||||
default :
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1; /*FIXME*/
|
||||
}
|
||||
|
||||
/* The contents of BUF are in target byte order. */
|
||||
|
||||
int
|
||||
fr30bf_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
|
||||
{
|
||||
if (rn < 16)
|
||||
fr30bf_h_gr_set (current_cpu, rn, GETTWI (buf));
|
||||
else
|
||||
switch (rn)
|
||||
{
|
||||
case PC_REGNUM :
|
||||
fr30bf_h_pc_set (current_cpu, GETTWI (buf));
|
||||
break;
|
||||
case PS_REGNUM :
|
||||
fr30bf_h_ps_set (current_cpu, GETTWI (buf));
|
||||
break;
|
||||
case TBR_REGNUM :
|
||||
case RP_REGNUM :
|
||||
case SSP_REGNUM :
|
||||
case USP_REGNUM :
|
||||
case MDH_REGNUM :
|
||||
case MDL_REGNUM :
|
||||
fr30bf_h_dr_set (current_cpu,
|
||||
decode_gdb_dr_regnum (rn),
|
||||
GETTWI (buf));
|
||||
break;
|
||||
default :
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1; /*FIXME*/
|
||||
}
|
||||
|
||||
/* Cover fns to access the ccr bits. */
|
||||
|
||||
BI
|
||||
fr30bf_h_sbit_get_handler (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_sbit);
|
||||
}
|
||||
|
||||
void
|
||||
fr30bf_h_sbit_set_handler (SIM_CPU *current_cpu, BI newval)
|
||||
{
|
||||
int old_sbit = CPU (h_sbit);
|
||||
int new_sbit = (newval != 0);
|
||||
|
||||
CPU (h_sbit) = new_sbit;
|
||||
|
||||
/* When switching stack modes, update the registers. */
|
||||
if (old_sbit != new_sbit)
|
||||
{
|
||||
if (old_sbit)
|
||||
{
|
||||
/* Switching user -> system. */
|
||||
CPU (h_dr[H_DR_USP]) = CPU (h_gr[H_GR_SP]);
|
||||
CPU (h_gr[H_GR_SP]) = CPU (h_dr[H_DR_SSP]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Switching system -> user. */
|
||||
CPU (h_dr[H_DR_SSP]) = CPU (h_gr[H_GR_SP]);
|
||||
CPU (h_gr[H_GR_SP]) = CPU (h_dr[H_DR_USP]);
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: r15 interlock */
|
||||
}
|
||||
|
||||
/* Cover fns to access the ccr bits. */
|
||||
|
||||
UQI
|
||||
fr30bf_h_ccr_get_handler (SIM_CPU *current_cpu)
|
||||
{
|
||||
int ccr = ( (GET_H_CBIT () << 0)
|
||||
| (GET_H_VBIT () << 1)
|
||||
| (GET_H_ZBIT () << 2)
|
||||
| (GET_H_NBIT () << 3)
|
||||
| (GET_H_IBIT () << 4)
|
||||
| (GET_H_SBIT () << 5));
|
||||
|
||||
return ccr;
|
||||
}
|
||||
|
||||
void
|
||||
fr30bf_h_ccr_set_handler (SIM_CPU *current_cpu, UQI newval)
|
||||
{
|
||||
int ccr = newval & 0x3f;
|
||||
|
||||
SET_H_CBIT ((ccr & 1) != 0);
|
||||
SET_H_VBIT ((ccr & 2) != 0);
|
||||
SET_H_ZBIT ((ccr & 4) != 0);
|
||||
SET_H_NBIT ((ccr & 8) != 0);
|
||||
SET_H_IBIT ((ccr & 0x10) != 0);
|
||||
SET_H_SBIT ((ccr & 0x20) != 0);
|
||||
}
|
||||
|
||||
/* Cover fns to access the scr bits. */
|
||||
|
||||
UQI
|
||||
fr30bf_h_scr_get_handler (SIM_CPU *current_cpu)
|
||||
{
|
||||
int scr = ( (GET_H_TBIT () << 0)
|
||||
| (GET_H_D0BIT () << 1)
|
||||
| (GET_H_D1BIT () << 2));
|
||||
return scr;
|
||||
}
|
||||
|
||||
void
|
||||
fr30bf_h_scr_set_handler (SIM_CPU *current_cpu, UQI newval)
|
||||
{
|
||||
int scr = newval & 7;
|
||||
|
||||
SET_H_TBIT ((scr & 1) != 0);
|
||||
SET_H_D0BIT ((scr & 2) != 0);
|
||||
SET_H_D1BIT ((scr & 4) != 0);
|
||||
}
|
||||
|
||||
/* Cover fns to access the ilm bits. */
|
||||
|
||||
UQI
|
||||
fr30bf_h_ilm_get_handler (SIM_CPU *current_cpu)
|
||||
{
|
||||
return CPU (h_ilm);
|
||||
}
|
||||
|
||||
void
|
||||
fr30bf_h_ilm_set_handler (SIM_CPU *current_cpu, UQI newval)
|
||||
{
|
||||
int ilm = newval & 0x1f;
|
||||
int current_ilm = CPU (h_ilm);
|
||||
|
||||
/* We can only set new ilm values < 16 if the current ilm is < 16. Otherwise
|
||||
we add 16 to the value we are given. */
|
||||
if (current_ilm >= 16 && ilm < 16)
|
||||
ilm += 16;
|
||||
|
||||
CPU (h_ilm) = ilm;
|
||||
}
|
||||
|
||||
/* Cover fns to access the ps register. */
|
||||
|
||||
USI
|
||||
fr30bf_h_ps_get_handler (SIM_CPU *current_cpu)
|
||||
{
|
||||
int ccr = GET_H_CCR ();
|
||||
int scr = GET_H_SCR ();
|
||||
int ilm = GET_H_ILM ();
|
||||
|
||||
return ccr | (scr << 8) | (ilm << 16);
|
||||
}
|
||||
|
||||
void
|
||||
fr30bf_h_ps_set_handler (SIM_CPU *current_cpu, USI newval)
|
||||
{
|
||||
int ccr = newval & 0xff;
|
||||
int scr = (newval >> 8) & 7;
|
||||
int ilm = (newval >> 16) & 0x1f;
|
||||
|
||||
SET_H_CCR (ccr);
|
||||
SET_H_SCR (scr);
|
||||
SET_H_ILM (ilm);
|
||||
}
|
||||
|
||||
/* Cover fns to access the dedicated registers. */
|
||||
|
||||
SI
|
||||
fr30bf_h_dr_get_handler (SIM_CPU *current_cpu, UINT dr)
|
||||
{
|
||||
switch (dr)
|
||||
{
|
||||
case H_DR_SSP :
|
||||
if (! GET_H_SBIT ())
|
||||
return GET_H_GR (H_GR_SP);
|
||||
else
|
||||
return CPU (h_dr[H_DR_SSP]);
|
||||
case H_DR_USP :
|
||||
if (GET_H_SBIT ())
|
||||
return GET_H_GR (H_GR_SP);
|
||||
else
|
||||
return CPU (h_dr[H_DR_USP]);
|
||||
case H_DR_TBR :
|
||||
case H_DR_RP :
|
||||
case H_DR_MDH :
|
||||
case H_DR_MDL :
|
||||
return CPU (h_dr[dr]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
fr30bf_h_dr_set_handler (SIM_CPU *current_cpu, UINT dr, SI newval)
|
||||
{
|
||||
switch (dr)
|
||||
{
|
||||
case H_DR_SSP :
|
||||
if (! GET_H_SBIT ())
|
||||
SET_H_GR (H_GR_SP, newval);
|
||||
else
|
||||
CPU (h_dr[H_DR_SSP]) = newval;
|
||||
break;
|
||||
case H_DR_USP :
|
||||
if (GET_H_SBIT ())
|
||||
SET_H_GR (H_GR_SP, newval);
|
||||
else
|
||||
CPU (h_dr[H_DR_USP]) = newval;
|
||||
break;
|
||||
case H_DR_TBR :
|
||||
case H_DR_RP :
|
||||
case H_DR_MDH :
|
||||
case H_DR_MDL :
|
||||
CPU (h_dr[dr]) = newval;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if WITH_PROFILE_MODEL_P
|
||||
|
||||
/* FIXME: Some of these should be inline or macros. Later. */
|
||||
|
||||
/* Initialize cycle counting for an insn.
|
||||
FIRST_P is non-zero if this is the first insn in a set of parallel
|
||||
insns. */
|
||||
|
||||
void
|
||||
fr30bf_model_insn_before (SIM_CPU *cpu, int first_p)
|
||||
{
|
||||
MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
d->load_regs_pending = 0;
|
||||
}
|
||||
|
||||
/* Record the cycles computed for an insn.
|
||||
LAST_P is non-zero if this is the last insn in a set of parallel insns,
|
||||
and we update the total cycle count.
|
||||
CYCLES is the cycle count of the insn. */
|
||||
|
||||
void
|
||||
fr30bf_model_insn_after (SIM_CPU *cpu, int last_p, int cycles)
|
||||
{
|
||||
PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
|
||||
MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
|
||||
PROFILE_MODEL_TOTAL_CYCLES (p) += cycles;
|
||||
PROFILE_MODEL_CUR_INSN_CYCLES (p) = cycles;
|
||||
d->load_regs = d->load_regs_pending;
|
||||
}
|
||||
|
||||
static INLINE int
|
||||
check_load_stall (SIM_CPU *cpu, int regno)
|
||||
{
|
||||
const MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
UINT load_regs = d->load_regs;
|
||||
|
||||
if (regno != -1
|
||||
&& (load_regs & (1 << regno)) != 0)
|
||||
{
|
||||
PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
|
||||
++ PROFILE_MODEL_LOAD_STALL_CYCLES (p);
|
||||
if (TRACE_INSN_P (cpu))
|
||||
cgen_trace_printf (cpu, " ; Load stall.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
fr30bf_model_fr30_1_u_exec (SIM_CPU *cpu, const IDESC *idesc,
|
||||
int unit_num, int referenced,
|
||||
INT in_Ri, INT in_Rj, INT out_Ri)
|
||||
{
|
||||
int cycles = idesc->timing->units[unit_num].done;
|
||||
cycles += check_load_stall (cpu, in_Ri);
|
||||
cycles += check_load_stall (cpu, in_Rj);
|
||||
return cycles;
|
||||
}
|
||||
|
||||
int
|
||||
fr30bf_model_fr30_1_u_cti (SIM_CPU *cpu, const IDESC *idesc,
|
||||
int unit_num, int referenced,
|
||||
INT in_Ri)
|
||||
{
|
||||
PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
|
||||
/* (1 << 1): The pc is the 2nd element in inputs, outputs.
|
||||
??? can be cleaned up */
|
||||
int taken_p = (referenced & (1 << 1)) != 0;
|
||||
int cycles = idesc->timing->units[unit_num].done;
|
||||
int delay_slot_p = CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_DELAY_SLOT);
|
||||
|
||||
cycles += check_load_stall (cpu, in_Ri);
|
||||
if (taken_p)
|
||||
{
|
||||
/* ??? Handling cti's without delay slots this way will run afoul of
|
||||
accurate system simulation. Later. */
|
||||
if (! delay_slot_p)
|
||||
{
|
||||
++cycles;
|
||||
++PROFILE_MODEL_CTI_STALL_CYCLES (p);
|
||||
}
|
||||
++PROFILE_MODEL_TAKEN_COUNT (p);
|
||||
}
|
||||
else
|
||||
++PROFILE_MODEL_UNTAKEN_COUNT (p);
|
||||
|
||||
return cycles;
|
||||
}
|
||||
|
||||
int
|
||||
fr30bf_model_fr30_1_u_load (SIM_CPU *cpu, const IDESC *idesc,
|
||||
int unit_num, int referenced,
|
||||
INT in_Rj, INT out_Ri)
|
||||
{
|
||||
MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
int cycles = idesc->timing->units[unit_num].done;
|
||||
d->load_regs_pending |= 1 << out_Ri;
|
||||
cycles += check_load_stall (cpu, in_Rj);
|
||||
return cycles;
|
||||
}
|
||||
|
||||
int
|
||||
fr30bf_model_fr30_1_u_store (SIM_CPU *cpu, const IDESC *idesc,
|
||||
int unit_num, int referenced,
|
||||
INT in_Ri, INT in_Rj)
|
||||
{
|
||||
int cycles = idesc->timing->units[unit_num].done;
|
||||
cycles += check_load_stall (cpu, in_Ri);
|
||||
cycles += check_load_stall (cpu, in_Rj);
|
||||
return cycles;
|
||||
}
|
||||
|
||||
int
|
||||
fr30bf_model_fr30_1_u_ldm (SIM_CPU *cpu, const IDESC *idesc,
|
||||
int unit_num, int referenced,
|
||||
INT reglist)
|
||||
{
|
||||
return idesc->timing->units[unit_num].done;
|
||||
}
|
||||
|
||||
int
|
||||
fr30bf_model_fr30_1_u_stm (SIM_CPU *cpu, const IDESC *idesc,
|
||||
int unit_num, int referenced,
|
||||
INT reglist)
|
||||
{
|
||||
return idesc->timing->units[unit_num].done;
|
||||
}
|
||||
|
||||
#endif /* WITH_PROFILE_MODEL_P */
|
||||
// OBSOLETE /* fr30 simulator support code
|
||||
// OBSOLETE Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
// OBSOLETE Contributed by Cygnus Solutions.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define WANT_CPU
|
||||
// OBSOLETE #define WANT_CPU_FR30BF
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-main.h"
|
||||
// OBSOLETE #include "cgen-mem.h"
|
||||
// OBSOLETE #include "cgen-ops.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Convert gdb dedicated register number to actual dr reg number. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static int
|
||||
// OBSOLETE decode_gdb_dr_regnum (int gdb_regnum)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE switch (gdb_regnum)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case TBR_REGNUM : return H_DR_TBR;
|
||||
// OBSOLETE case RP_REGNUM : return H_DR_RP;
|
||||
// OBSOLETE case SSP_REGNUM : return H_DR_SSP;
|
||||
// OBSOLETE case USP_REGNUM : return H_DR_USP;
|
||||
// OBSOLETE case MDH_REGNUM : return H_DR_MDH;
|
||||
// OBSOLETE case MDL_REGNUM : return H_DR_MDL;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE abort ();
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The contents of BUF are in target byte order. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if (rn < 16)
|
||||
// OBSOLETE SETTWI (buf, fr30bf_h_gr_get (current_cpu, rn));
|
||||
// OBSOLETE else
|
||||
// OBSOLETE switch (rn)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case PC_REGNUM :
|
||||
// OBSOLETE SETTWI (buf, fr30bf_h_pc_get (current_cpu));
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case PS_REGNUM :
|
||||
// OBSOLETE SETTWI (buf, fr30bf_h_ps_get (current_cpu));
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TBR_REGNUM :
|
||||
// OBSOLETE case RP_REGNUM :
|
||||
// OBSOLETE case SSP_REGNUM :
|
||||
// OBSOLETE case USP_REGNUM :
|
||||
// OBSOLETE case MDH_REGNUM :
|
||||
// OBSOLETE case MDL_REGNUM :
|
||||
// OBSOLETE SETTWI (buf, fr30bf_h_dr_get (current_cpu,
|
||||
// OBSOLETE decode_gdb_dr_regnum (rn)));
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE default :
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE return -1; /*FIXME*/
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The contents of BUF are in target byte order. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if (rn < 16)
|
||||
// OBSOLETE fr30bf_h_gr_set (current_cpu, rn, GETTWI (buf));
|
||||
// OBSOLETE else
|
||||
// OBSOLETE switch (rn)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case PC_REGNUM :
|
||||
// OBSOLETE fr30bf_h_pc_set (current_cpu, GETTWI (buf));
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case PS_REGNUM :
|
||||
// OBSOLETE fr30bf_h_ps_set (current_cpu, GETTWI (buf));
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TBR_REGNUM :
|
||||
// OBSOLETE case RP_REGNUM :
|
||||
// OBSOLETE case SSP_REGNUM :
|
||||
// OBSOLETE case USP_REGNUM :
|
||||
// OBSOLETE case MDH_REGNUM :
|
||||
// OBSOLETE case MDL_REGNUM :
|
||||
// OBSOLETE fr30bf_h_dr_set (current_cpu,
|
||||
// OBSOLETE decode_gdb_dr_regnum (rn),
|
||||
// OBSOLETE GETTWI (buf));
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE default :
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE return -1; /*FIXME*/
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover fns to access the ccr bits. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE BI
|
||||
// OBSOLETE fr30bf_h_sbit_get_handler (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_sbit);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_sbit_set_handler (SIM_CPU *current_cpu, BI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int old_sbit = CPU (h_sbit);
|
||||
// OBSOLETE int new_sbit = (newval != 0);
|
||||
// OBSOLETE
|
||||
// OBSOLETE CPU (h_sbit) = new_sbit;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* When switching stack modes, update the registers. */
|
||||
// OBSOLETE if (old_sbit != new_sbit)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if (old_sbit)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Switching user -> system. */
|
||||
// OBSOLETE CPU (h_dr[H_DR_USP]) = CPU (h_gr[H_GR_SP]);
|
||||
// OBSOLETE CPU (h_gr[H_GR_SP]) = CPU (h_dr[H_DR_SSP]);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Switching system -> user. */
|
||||
// OBSOLETE CPU (h_dr[H_DR_SSP]) = CPU (h_gr[H_GR_SP]);
|
||||
// OBSOLETE CPU (h_gr[H_GR_SP]) = CPU (h_dr[H_DR_USP]);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* TODO: r15 interlock */
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover fns to access the ccr bits. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE UQI
|
||||
// OBSOLETE fr30bf_h_ccr_get_handler (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int ccr = ( (GET_H_CBIT () << 0)
|
||||
// OBSOLETE | (GET_H_VBIT () << 1)
|
||||
// OBSOLETE | (GET_H_ZBIT () << 2)
|
||||
// OBSOLETE | (GET_H_NBIT () << 3)
|
||||
// OBSOLETE | (GET_H_IBIT () << 4)
|
||||
// OBSOLETE | (GET_H_SBIT () << 5));
|
||||
// OBSOLETE
|
||||
// OBSOLETE return ccr;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ccr_set_handler (SIM_CPU *current_cpu, UQI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int ccr = newval & 0x3f;
|
||||
// OBSOLETE
|
||||
// OBSOLETE SET_H_CBIT ((ccr & 1) != 0);
|
||||
// OBSOLETE SET_H_VBIT ((ccr & 2) != 0);
|
||||
// OBSOLETE SET_H_ZBIT ((ccr & 4) != 0);
|
||||
// OBSOLETE SET_H_NBIT ((ccr & 8) != 0);
|
||||
// OBSOLETE SET_H_IBIT ((ccr & 0x10) != 0);
|
||||
// OBSOLETE SET_H_SBIT ((ccr & 0x20) != 0);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover fns to access the scr bits. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE UQI
|
||||
// OBSOLETE fr30bf_h_scr_get_handler (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int scr = ( (GET_H_TBIT () << 0)
|
||||
// OBSOLETE | (GET_H_D0BIT () << 1)
|
||||
// OBSOLETE | (GET_H_D1BIT () << 2));
|
||||
// OBSOLETE return scr;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_scr_set_handler (SIM_CPU *current_cpu, UQI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int scr = newval & 7;
|
||||
// OBSOLETE
|
||||
// OBSOLETE SET_H_TBIT ((scr & 1) != 0);
|
||||
// OBSOLETE SET_H_D0BIT ((scr & 2) != 0);
|
||||
// OBSOLETE SET_H_D1BIT ((scr & 4) != 0);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover fns to access the ilm bits. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE UQI
|
||||
// OBSOLETE fr30bf_h_ilm_get_handler (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return CPU (h_ilm);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ilm_set_handler (SIM_CPU *current_cpu, UQI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int ilm = newval & 0x1f;
|
||||
// OBSOLETE int current_ilm = CPU (h_ilm);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* We can only set new ilm values < 16 if the current ilm is < 16. Otherwise
|
||||
// OBSOLETE we add 16 to the value we are given. */
|
||||
// OBSOLETE if (current_ilm >= 16 && ilm < 16)
|
||||
// OBSOLETE ilm += 16;
|
||||
// OBSOLETE
|
||||
// OBSOLETE CPU (h_ilm) = ilm;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover fns to access the ps register. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE USI
|
||||
// OBSOLETE fr30bf_h_ps_get_handler (SIM_CPU *current_cpu)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int ccr = GET_H_CCR ();
|
||||
// OBSOLETE int scr = GET_H_SCR ();
|
||||
// OBSOLETE int ilm = GET_H_ILM ();
|
||||
// OBSOLETE
|
||||
// OBSOLETE return ccr | (scr << 8) | (ilm << 16);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_ps_set_handler (SIM_CPU *current_cpu, USI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int ccr = newval & 0xff;
|
||||
// OBSOLETE int scr = (newval >> 8) & 7;
|
||||
// OBSOLETE int ilm = (newval >> 16) & 0x1f;
|
||||
// OBSOLETE
|
||||
// OBSOLETE SET_H_CCR (ccr);
|
||||
// OBSOLETE SET_H_SCR (scr);
|
||||
// OBSOLETE SET_H_ILM (ilm);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover fns to access the dedicated registers. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SI
|
||||
// OBSOLETE fr30bf_h_dr_get_handler (SIM_CPU *current_cpu, UINT dr)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE switch (dr)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case H_DR_SSP :
|
||||
// OBSOLETE if (! GET_H_SBIT ())
|
||||
// OBSOLETE return GET_H_GR (H_GR_SP);
|
||||
// OBSOLETE else
|
||||
// OBSOLETE return CPU (h_dr[H_DR_SSP]);
|
||||
// OBSOLETE case H_DR_USP :
|
||||
// OBSOLETE if (GET_H_SBIT ())
|
||||
// OBSOLETE return GET_H_GR (H_GR_SP);
|
||||
// OBSOLETE else
|
||||
// OBSOLETE return CPU (h_dr[H_DR_USP]);
|
||||
// OBSOLETE case H_DR_TBR :
|
||||
// OBSOLETE case H_DR_RP :
|
||||
// OBSOLETE case H_DR_MDH :
|
||||
// OBSOLETE case H_DR_MDL :
|
||||
// OBSOLETE return CPU (h_dr[dr]);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_h_dr_set_handler (SIM_CPU *current_cpu, UINT dr, SI newval)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE switch (dr)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case H_DR_SSP :
|
||||
// OBSOLETE if (! GET_H_SBIT ())
|
||||
// OBSOLETE SET_H_GR (H_GR_SP, newval);
|
||||
// OBSOLETE else
|
||||
// OBSOLETE CPU (h_dr[H_DR_SSP]) = newval;
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case H_DR_USP :
|
||||
// OBSOLETE if (GET_H_SBIT ())
|
||||
// OBSOLETE SET_H_GR (H_GR_SP, newval);
|
||||
// OBSOLETE else
|
||||
// OBSOLETE CPU (h_dr[H_DR_USP]) = newval;
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case H_DR_TBR :
|
||||
// OBSOLETE case H_DR_RP :
|
||||
// OBSOLETE case H_DR_MDH :
|
||||
// OBSOLETE case H_DR_MDL :
|
||||
// OBSOLETE CPU (h_dr[dr]) = newval;
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if WITH_PROFILE_MODEL_P
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* FIXME: Some of these should be inline or macros. Later. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Initialize cycle counting for an insn.
|
||||
// OBSOLETE FIRST_P is non-zero if this is the first insn in a set of parallel
|
||||
// OBSOLETE insns. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_model_insn_before (SIM_CPU *cpu, int first_p)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
// OBSOLETE d->load_regs_pending = 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Record the cycles computed for an insn.
|
||||
// OBSOLETE LAST_P is non-zero if this is the last insn in a set of parallel insns,
|
||||
// OBSOLETE and we update the total cycle count.
|
||||
// OBSOLETE CYCLES is the cycle count of the insn. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30bf_model_insn_after (SIM_CPU *cpu, int last_p, int cycles)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
|
||||
// OBSOLETE MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
// OBSOLETE
|
||||
// OBSOLETE PROFILE_MODEL_TOTAL_CYCLES (p) += cycles;
|
||||
// OBSOLETE PROFILE_MODEL_CUR_INSN_CYCLES (p) = cycles;
|
||||
// OBSOLETE d->load_regs = d->load_regs_pending;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE static INLINE int
|
||||
// OBSOLETE check_load_stall (SIM_CPU *cpu, int regno)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE const MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
// OBSOLETE UINT load_regs = d->load_regs;
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (regno != -1
|
||||
// OBSOLETE && (load_regs & (1 << regno)) != 0)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
|
||||
// OBSOLETE ++ PROFILE_MODEL_LOAD_STALL_CYCLES (p);
|
||||
// OBSOLETE if (TRACE_INSN_P (cpu))
|
||||
// OBSOLETE cgen_trace_printf (cpu, " ; Load stall.");
|
||||
// OBSOLETE return 1;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_model_fr30_1_u_exec (SIM_CPU *cpu, const IDESC *idesc,
|
||||
// OBSOLETE int unit_num, int referenced,
|
||||
// OBSOLETE INT in_Ri, INT in_Rj, INT out_Ri)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int cycles = idesc->timing->units[unit_num].done;
|
||||
// OBSOLETE cycles += check_load_stall (cpu, in_Ri);
|
||||
// OBSOLETE cycles += check_load_stall (cpu, in_Rj);
|
||||
// OBSOLETE return cycles;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_model_fr30_1_u_cti (SIM_CPU *cpu, const IDESC *idesc,
|
||||
// OBSOLETE int unit_num, int referenced,
|
||||
// OBSOLETE INT in_Ri)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE PROFILE_DATA *p = CPU_PROFILE_DATA (cpu);
|
||||
// OBSOLETE /* (1 << 1): The pc is the 2nd element in inputs, outputs.
|
||||
// OBSOLETE ??? can be cleaned up */
|
||||
// OBSOLETE int taken_p = (referenced & (1 << 1)) != 0;
|
||||
// OBSOLETE int cycles = idesc->timing->units[unit_num].done;
|
||||
// OBSOLETE int delay_slot_p = CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_DELAY_SLOT);
|
||||
// OBSOLETE
|
||||
// OBSOLETE cycles += check_load_stall (cpu, in_Ri);
|
||||
// OBSOLETE if (taken_p)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* ??? Handling cti's without delay slots this way will run afoul of
|
||||
// OBSOLETE accurate system simulation. Later. */
|
||||
// OBSOLETE if (! delay_slot_p)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE ++cycles;
|
||||
// OBSOLETE ++PROFILE_MODEL_CTI_STALL_CYCLES (p);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE ++PROFILE_MODEL_TAKEN_COUNT (p);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE ++PROFILE_MODEL_UNTAKEN_COUNT (p);
|
||||
// OBSOLETE
|
||||
// OBSOLETE return cycles;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_model_fr30_1_u_load (SIM_CPU *cpu, const IDESC *idesc,
|
||||
// OBSOLETE int unit_num, int referenced,
|
||||
// OBSOLETE INT in_Rj, INT out_Ri)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE MODEL_FR30_1_DATA *d = CPU_MODEL_DATA (cpu);
|
||||
// OBSOLETE int cycles = idesc->timing->units[unit_num].done;
|
||||
// OBSOLETE d->load_regs_pending |= 1 << out_Ri;
|
||||
// OBSOLETE cycles += check_load_stall (cpu, in_Rj);
|
||||
// OBSOLETE return cycles;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_model_fr30_1_u_store (SIM_CPU *cpu, const IDESC *idesc,
|
||||
// OBSOLETE int unit_num, int referenced,
|
||||
// OBSOLETE INT in_Ri, INT in_Rj)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int cycles = idesc->timing->units[unit_num].done;
|
||||
// OBSOLETE cycles += check_load_stall (cpu, in_Ri);
|
||||
// OBSOLETE cycles += check_load_stall (cpu, in_Rj);
|
||||
// OBSOLETE return cycles;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_model_fr30_1_u_ldm (SIM_CPU *cpu, const IDESC *idesc,
|
||||
// OBSOLETE int unit_num, int referenced,
|
||||
// OBSOLETE INT reglist)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return idesc->timing->units[unit_num].done;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE int
|
||||
// OBSOLETE fr30bf_model_fr30_1_u_stm (SIM_CPU *cpu, const IDESC *idesc,
|
||||
// OBSOLETE int unit_num, int referenced,
|
||||
// OBSOLETE INT reglist)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE return idesc->timing->units[unit_num].done;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #endif /* WITH_PROFILE_MODEL_P */
|
||||
|
@ -1,236 +1,236 @@
|
||||
# Simulator main loop for fr30. -*- C -*-
|
||||
# Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
# Contributed by Cygnus Solutions.
|
||||
#
|
||||
# This file is part of the GNU Simulators.
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Syntax:
|
||||
# /bin/sh mainloop.in command
|
||||
#
|
||||
# Command is one of:
|
||||
#
|
||||
# init
|
||||
# support
|
||||
# extract-{simple,scache,pbb}
|
||||
# {full,fast}-exec-{simple,scache,pbb}
|
||||
#
|
||||
# A target need only provide a "full" version of one of simple,scache,pbb.
|
||||
# If the target wants it can also provide a fast version of same.
|
||||
# It can't provide more than this, however for illustration's sake the FR30
|
||||
# port provides examples of all.
|
||||
|
||||
# ??? After a few more ports are done, revisit.
|
||||
# Will eventually need to machine generate a lot of this.
|
||||
|
||||
case "x$1" in
|
||||
|
||||
xsupport)
|
||||
|
||||
cat <<EOF
|
||||
|
||||
static INLINE const IDESC *
|
||||
extract (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN_INT insn, ARGBUF *abuf,
|
||||
int fast_p)
|
||||
{
|
||||
const IDESC *id = @cpu@_decode (current_cpu, pc, insn, abuf);
|
||||
@cpu@_fill_argbuf (current_cpu, abuf, id, pc, fast_p);
|
||||
if (! fast_p)
|
||||
{
|
||||
int trace_p = PC_IN_TRACE_RANGE_P (current_cpu, pc);
|
||||
int profile_p = PC_IN_PROFILE_RANGE_P (current_cpu, pc);
|
||||
@cpu@_fill_argbuf_tp (current_cpu, abuf, trace_p, profile_p);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
static INLINE SEM_PC
|
||||
execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
|
||||
{
|
||||
SEM_PC vpc;
|
||||
|
||||
if (fast_p)
|
||||
{
|
||||
#if ! WITH_SEM_SWITCH_FAST
|
||||
#if WITH_SCACHE
|
||||
vpc = (*sc->argbuf.semantic.sem_fast) (current_cpu, sc);
|
||||
#else
|
||||
vpc = (*sc->argbuf.semantic.sem_fast) (current_cpu, &sc->argbuf);
|
||||
#endif
|
||||
#else
|
||||
abort ();
|
||||
#endif /* WITH_SEM_SWITCH_FAST */
|
||||
}
|
||||
else
|
||||
{
|
||||
#if ! WITH_SEM_SWITCH_FULL
|
||||
ARGBUF *abuf = &sc->argbuf;
|
||||
const IDESC *idesc = abuf->idesc;
|
||||
#if WITH_SCACHE_PBB
|
||||
int virtual_p = CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_VIRTUAL);
|
||||
#else
|
||||
int virtual_p = 0;
|
||||
#endif
|
||||
|
||||
if (! virtual_p)
|
||||
{
|
||||
/* FIXME: call x-before */
|
||||
if (ARGBUF_PROFILE_P (abuf))
|
||||
PROFILE_COUNT_INSN (current_cpu, abuf->addr, idesc->num);
|
||||
/* FIXME: Later make cover macros: PROFILE_INSN_{INIT,FINI}. */
|
||||
if (PROFILE_MODEL_P (current_cpu)
|
||||
&& ARGBUF_PROFILE_P (abuf))
|
||||
@cpu@_model_insn_before (current_cpu, 1 /*first_p*/);
|
||||
TRACE_INSN_INIT (current_cpu, abuf, 1);
|
||||
TRACE_INSN (current_cpu, idesc->idata,
|
||||
(const struct argbuf *) abuf, abuf->addr);
|
||||
}
|
||||
#if WITH_SCACHE
|
||||
vpc = (*sc->argbuf.semantic.sem_full) (current_cpu, sc);
|
||||
#else
|
||||
vpc = (*sc->argbuf.semantic.sem_full) (current_cpu, abuf);
|
||||
#endif
|
||||
if (! virtual_p)
|
||||
{
|
||||
/* FIXME: call x-after */
|
||||
if (PROFILE_MODEL_P (current_cpu)
|
||||
&& ARGBUF_PROFILE_P (abuf))
|
||||
{
|
||||
int cycles;
|
||||
|
||||
cycles = (*idesc->timing->model_fn) (current_cpu, sc);
|
||||
@cpu@_model_insn_after (current_cpu, 1 /*last_p*/, cycles);
|
||||
}
|
||||
TRACE_INSN_FINI (current_cpu, abuf, 1);
|
||||
}
|
||||
#else
|
||||
abort ();
|
||||
#endif /* WITH_SEM_SWITCH_FULL */
|
||||
}
|
||||
|
||||
return vpc;
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
;;
|
||||
|
||||
xinit)
|
||||
|
||||
cat <<EOF
|
||||
/*xxxinit*/
|
||||
EOF
|
||||
|
||||
;;
|
||||
|
||||
xextract-simple | xextract-scache)
|
||||
|
||||
# Inputs: current_cpu, vpc, sc, FAST_P
|
||||
# Outputs: sc filled in
|
||||
|
||||
cat <<EOF
|
||||
{
|
||||
CGEN_INSN_INT insn = GETIMEMUHI (current_cpu, vpc);
|
||||
extract (current_cpu, vpc, insn, SEM_ARGBUF (sc), FAST_P);
|
||||
}
|
||||
EOF
|
||||
|
||||
;;
|
||||
|
||||
xextract-pbb)
|
||||
|
||||
# Inputs: current_cpu, pc, sc, max_insns, FAST_P
|
||||
# Outputs: sc, pc
|
||||
# sc must be left pointing past the last created entry.
|
||||
# pc must be left pointing past the last created entry.
|
||||
# If the pbb is terminated by a cti insn, SET_CTI_VPC(sc) must be called
|
||||
# to record the vpc of the cti insn.
|
||||
# SET_INSN_COUNT(n) must be called to record number of real insns.
|
||||
|
||||
cat <<EOF
|
||||
{
|
||||
const IDESC *idesc;
|
||||
int icount = 0;
|
||||
|
||||
while (max_insns > 0)
|
||||
{
|
||||
UHI insn = GETIMEMUHI (current_cpu, pc);
|
||||
idesc = extract (current_cpu, pc, insn, &sc->argbuf, FAST_P);
|
||||
++sc;
|
||||
--max_insns;
|
||||
++icount;
|
||||
pc += idesc->length;
|
||||
if (IDESC_CTI_P (idesc))
|
||||
{
|
||||
SET_CTI_VPC (sc - 1);
|
||||
|
||||
/* Delay slot? */
|
||||
/* ??? breakpoints in delay slots */
|
||||
if (CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_DELAY_SLOT))
|
||||
{
|
||||
UHI insn = GETIMEMUHI (current_cpu, pc);
|
||||
idesc = extract (current_cpu, pc, insn, &sc->argbuf, FAST_P);
|
||||
if (CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_NOT_IN_DELAY_SLOT))
|
||||
{
|
||||
/* malformed program */
|
||||
sim_io_eprintf (CPU_STATE (current_cpu),
|
||||
"malformed program, \`%s' insn in delay slot\n",
|
||||
CGEN_INSN_NAME (idesc->idata));
|
||||
}
|
||||
else
|
||||
{
|
||||
++sc;
|
||||
--max_insns;
|
||||
++icount;
|
||||
pc += idesc->length;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Finish:
|
||||
SET_INSN_COUNT (icount);
|
||||
}
|
||||
EOF
|
||||
|
||||
;;
|
||||
|
||||
xfull-exec-* | xfast-exec-*)
|
||||
|
||||
# Inputs: current_cpu, sc, FAST_P
|
||||
# Outputs: vpc
|
||||
# vpc contains the address of the next insn to execute
|
||||
|
||||
cat <<EOF
|
||||
{
|
||||
#if (! FAST_P && WITH_SEM_SWITCH_FULL) || (FAST_P && WITH_SEM_SWITCH_FAST)
|
||||
#define DEFINE_SWITCH
|
||||
#include "sem-switch.c"
|
||||
#else
|
||||
vpc = execute (current_cpu, vpc, FAST_P);
|
||||
#endif
|
||||
}
|
||||
EOF
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid argument to mainloop.in: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
# OBSOLETE # Simulator main loop for fr30. -*- C -*-
|
||||
# OBSOLETE # Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
# OBSOLETE # Contributed by Cygnus Solutions.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This file is part of the GNU Simulators.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is free software; you can redistribute it and/or modify
|
||||
# OBSOLETE # it under the terms of the GNU General Public License as published by
|
||||
# OBSOLETE # the Free Software Foundation; either version 2, or (at your option)
|
||||
# OBSOLETE # any later version.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is distributed in the hope that it will be useful,
|
||||
# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# OBSOLETE # GNU General Public License for more details.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # You should have received a copy of the GNU General Public License along
|
||||
# OBSOLETE # with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# OBSOLETE # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Syntax:
|
||||
# OBSOLETE # /bin/sh mainloop.in command
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # Command is one of:
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # init
|
||||
# OBSOLETE # support
|
||||
# OBSOLETE # extract-{simple,scache,pbb}
|
||||
# OBSOLETE # {full,fast}-exec-{simple,scache,pbb}
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # A target need only provide a "full" version of one of simple,scache,pbb.
|
||||
# OBSOLETE # If the target wants it can also provide a fast version of same.
|
||||
# OBSOLETE # It can't provide more than this, however for illustration's sake the FR30
|
||||
# OBSOLETE # port provides examples of all.
|
||||
# OBSOLETE
|
||||
# OBSOLETE # ??? After a few more ports are done, revisit.
|
||||
# OBSOLETE # Will eventually need to machine generate a lot of this.
|
||||
# OBSOLETE
|
||||
# OBSOLETE case "x$1" in
|
||||
# OBSOLETE
|
||||
# OBSOLETE xsupport)
|
||||
# OBSOLETE
|
||||
# OBSOLETE cat <<EOF
|
||||
# OBSOLETE
|
||||
# OBSOLETE static INLINE const IDESC *
|
||||
# OBSOLETE extract (SIM_CPU *current_cpu, PCADDR pc, CGEN_INSN_INT insn, ARGBUF *abuf,
|
||||
# OBSOLETE int fast_p)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE const IDESC *id = @cpu@_decode (current_cpu, pc, insn, abuf);
|
||||
# OBSOLETE @cpu@_fill_argbuf (current_cpu, abuf, id, pc, fast_p);
|
||||
# OBSOLETE if (! fast_p)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE int trace_p = PC_IN_TRACE_RANGE_P (current_cpu, pc);
|
||||
# OBSOLETE int profile_p = PC_IN_PROFILE_RANGE_P (current_cpu, pc);
|
||||
# OBSOLETE @cpu@_fill_argbuf_tp (current_cpu, abuf, trace_p, profile_p);
|
||||
# OBSOLETE }
|
||||
# OBSOLETE return id;
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE static INLINE SEM_PC
|
||||
# OBSOLETE execute (SIM_CPU *current_cpu, SCACHE *sc, int fast_p)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE SEM_PC vpc;
|
||||
# OBSOLETE
|
||||
# OBSOLETE if (fast_p)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE #if ! WITH_SEM_SWITCH_FAST
|
||||
# OBSOLETE #if WITH_SCACHE
|
||||
# OBSOLETE vpc = (*sc->argbuf.semantic.sem_fast) (current_cpu, sc);
|
||||
# OBSOLETE #else
|
||||
# OBSOLETE vpc = (*sc->argbuf.semantic.sem_fast) (current_cpu, &sc->argbuf);
|
||||
# OBSOLETE #endif
|
||||
# OBSOLETE #else
|
||||
# OBSOLETE abort ();
|
||||
# OBSOLETE #endif /* WITH_SEM_SWITCH_FAST */
|
||||
# OBSOLETE }
|
||||
# OBSOLETE else
|
||||
# OBSOLETE {
|
||||
# OBSOLETE #if ! WITH_SEM_SWITCH_FULL
|
||||
# OBSOLETE ARGBUF *abuf = &sc->argbuf;
|
||||
# OBSOLETE const IDESC *idesc = abuf->idesc;
|
||||
# OBSOLETE #if WITH_SCACHE_PBB
|
||||
# OBSOLETE int virtual_p = CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_VIRTUAL);
|
||||
# OBSOLETE #else
|
||||
# OBSOLETE int virtual_p = 0;
|
||||
# OBSOLETE #endif
|
||||
# OBSOLETE
|
||||
# OBSOLETE if (! virtual_p)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE /* FIXME: call x-before */
|
||||
# OBSOLETE if (ARGBUF_PROFILE_P (abuf))
|
||||
# OBSOLETE PROFILE_COUNT_INSN (current_cpu, abuf->addr, idesc->num);
|
||||
# OBSOLETE /* FIXME: Later make cover macros: PROFILE_INSN_{INIT,FINI}. */
|
||||
# OBSOLETE if (PROFILE_MODEL_P (current_cpu)
|
||||
# OBSOLETE && ARGBUF_PROFILE_P (abuf))
|
||||
# OBSOLETE @cpu@_model_insn_before (current_cpu, 1 /*first_p*/);
|
||||
# OBSOLETE TRACE_INSN_INIT (current_cpu, abuf, 1);
|
||||
# OBSOLETE TRACE_INSN (current_cpu, idesc->idata,
|
||||
# OBSOLETE (const struct argbuf *) abuf, abuf->addr);
|
||||
# OBSOLETE }
|
||||
# OBSOLETE #if WITH_SCACHE
|
||||
# OBSOLETE vpc = (*sc->argbuf.semantic.sem_full) (current_cpu, sc);
|
||||
# OBSOLETE #else
|
||||
# OBSOLETE vpc = (*sc->argbuf.semantic.sem_full) (current_cpu, abuf);
|
||||
# OBSOLETE #endif
|
||||
# OBSOLETE if (! virtual_p)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE /* FIXME: call x-after */
|
||||
# OBSOLETE if (PROFILE_MODEL_P (current_cpu)
|
||||
# OBSOLETE && ARGBUF_PROFILE_P (abuf))
|
||||
# OBSOLETE {
|
||||
# OBSOLETE int cycles;
|
||||
# OBSOLETE
|
||||
# OBSOLETE cycles = (*idesc->timing->model_fn) (current_cpu, sc);
|
||||
# OBSOLETE @cpu@_model_insn_after (current_cpu, 1 /*last_p*/, cycles);
|
||||
# OBSOLETE }
|
||||
# OBSOLETE TRACE_INSN_FINI (current_cpu, abuf, 1);
|
||||
# OBSOLETE }
|
||||
# OBSOLETE #else
|
||||
# OBSOLETE abort ();
|
||||
# OBSOLETE #endif /* WITH_SEM_SWITCH_FULL */
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE return vpc;
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE EOF
|
||||
# OBSOLETE
|
||||
# OBSOLETE ;;
|
||||
# OBSOLETE
|
||||
# OBSOLETE xinit)
|
||||
# OBSOLETE
|
||||
# OBSOLETE cat <<EOF
|
||||
# OBSOLETE /*xxxinit*/
|
||||
# OBSOLETE EOF
|
||||
# OBSOLETE
|
||||
# OBSOLETE ;;
|
||||
# OBSOLETE
|
||||
# OBSOLETE xextract-simple | xextract-scache)
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Inputs: current_cpu, vpc, sc, FAST_P
|
||||
# OBSOLETE # Outputs: sc filled in
|
||||
# OBSOLETE
|
||||
# OBSOLETE cat <<EOF
|
||||
# OBSOLETE {
|
||||
# OBSOLETE CGEN_INSN_INT insn = GETIMEMUHI (current_cpu, vpc);
|
||||
# OBSOLETE extract (current_cpu, vpc, insn, SEM_ARGBUF (sc), FAST_P);
|
||||
# OBSOLETE }
|
||||
# OBSOLETE EOF
|
||||
# OBSOLETE
|
||||
# OBSOLETE ;;
|
||||
# OBSOLETE
|
||||
# OBSOLETE xextract-pbb)
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Inputs: current_cpu, pc, sc, max_insns, FAST_P
|
||||
# OBSOLETE # Outputs: sc, pc
|
||||
# OBSOLETE # sc must be left pointing past the last created entry.
|
||||
# OBSOLETE # pc must be left pointing past the last created entry.
|
||||
# OBSOLETE # If the pbb is terminated by a cti insn, SET_CTI_VPC(sc) must be called
|
||||
# OBSOLETE # to record the vpc of the cti insn.
|
||||
# OBSOLETE # SET_INSN_COUNT(n) must be called to record number of real insns.
|
||||
# OBSOLETE
|
||||
# OBSOLETE cat <<EOF
|
||||
# OBSOLETE {
|
||||
# OBSOLETE const IDESC *idesc;
|
||||
# OBSOLETE int icount = 0;
|
||||
# OBSOLETE
|
||||
# OBSOLETE while (max_insns > 0)
|
||||
# OBSOLETE {
|
||||
# OBSOLETE UHI insn = GETIMEMUHI (current_cpu, pc);
|
||||
# OBSOLETE idesc = extract (current_cpu, pc, insn, &sc->argbuf, FAST_P);
|
||||
# OBSOLETE ++sc;
|
||||
# OBSOLETE --max_insns;
|
||||
# OBSOLETE ++icount;
|
||||
# OBSOLETE pc += idesc->length;
|
||||
# OBSOLETE if (IDESC_CTI_P (idesc))
|
||||
# OBSOLETE {
|
||||
# OBSOLETE SET_CTI_VPC (sc - 1);
|
||||
# OBSOLETE
|
||||
# OBSOLETE /* Delay slot? */
|
||||
# OBSOLETE /* ??? breakpoints in delay slots */
|
||||
# OBSOLETE if (CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_DELAY_SLOT))
|
||||
# OBSOLETE {
|
||||
# OBSOLETE UHI insn = GETIMEMUHI (current_cpu, pc);
|
||||
# OBSOLETE idesc = extract (current_cpu, pc, insn, &sc->argbuf, FAST_P);
|
||||
# OBSOLETE if (CGEN_ATTR_VALUE (NULL, idesc->attrs, CGEN_INSN_NOT_IN_DELAY_SLOT))
|
||||
# OBSOLETE {
|
||||
# OBSOLETE /* malformed program */
|
||||
# OBSOLETE sim_io_eprintf (CPU_STATE (current_cpu),
|
||||
# OBSOLETE "malformed program, \`%s' insn in delay slot\n",
|
||||
# OBSOLETE CGEN_INSN_NAME (idesc->idata));
|
||||
# OBSOLETE }
|
||||
# OBSOLETE else
|
||||
# OBSOLETE {
|
||||
# OBSOLETE ++sc;
|
||||
# OBSOLETE --max_insns;
|
||||
# OBSOLETE ++icount;
|
||||
# OBSOLETE pc += idesc->length;
|
||||
# OBSOLETE }
|
||||
# OBSOLETE }
|
||||
# OBSOLETE break;
|
||||
# OBSOLETE }
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE Finish:
|
||||
# OBSOLETE SET_INSN_COUNT (icount);
|
||||
# OBSOLETE }
|
||||
# OBSOLETE EOF
|
||||
# OBSOLETE
|
||||
# OBSOLETE ;;
|
||||
# OBSOLETE
|
||||
# OBSOLETE xfull-exec-* | xfast-exec-*)
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Inputs: current_cpu, sc, FAST_P
|
||||
# OBSOLETE # Outputs: vpc
|
||||
# OBSOLETE # vpc contains the address of the next insn to execute
|
||||
# OBSOLETE
|
||||
# OBSOLETE cat <<EOF
|
||||
# OBSOLETE {
|
||||
# OBSOLETE #if (! FAST_P && WITH_SEM_SWITCH_FULL) || (FAST_P && WITH_SEM_SWITCH_FAST)
|
||||
# OBSOLETE #define DEFINE_SWITCH
|
||||
# OBSOLETE #include "sem-switch.c"
|
||||
# OBSOLETE #else
|
||||
# OBSOLETE vpc = execute (current_cpu, vpc, FAST_P);
|
||||
# OBSOLETE #endif
|
||||
# OBSOLETE }
|
||||
# OBSOLETE EOF
|
||||
# OBSOLETE
|
||||
# OBSOLETE ;;
|
||||
# OBSOLETE
|
||||
# OBSOLETE *)
|
||||
# OBSOLETE echo "Invalid argument to mainloop.in: $1" >&2
|
||||
# OBSOLETE exit 1
|
||||
# OBSOLETE ;;
|
||||
# OBSOLETE
|
||||
# OBSOLETE esac
|
||||
|
8007
sim/fr30/model.c
8007
sim/fr30/model.c
File diff suppressed because it is too large
Load Diff
10818
sim/fr30/sem-switch.c
10818
sim/fr30/sem-switch.c
File diff suppressed because it is too large
Load Diff
11459
sim/fr30/sem.c
11459
sim/fr30/sem.c
File diff suppressed because it is too large
Load Diff
@ -1,208 +1,208 @@
|
||||
/* Main simulator entry points specific to the FR30.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "sim-main.h"
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "sim-options.h"
|
||||
#include "libiberty.h"
|
||||
#include "bfd.h"
|
||||
|
||||
static void free_state (SIM_DESC);
|
||||
static void print_fr30_misc_cpu (SIM_CPU *cpu, int verbose);
|
||||
|
||||
/* Records simulator descriptor so utilities like fr30_dump_regs can be
|
||||
called from gdb. */
|
||||
SIM_DESC current_state;
|
||||
|
||||
/* Cover function of sim_state_free to free the cpu buffers as well. */
|
||||
|
||||
static void
|
||||
free_state (SIM_DESC sd)
|
||||
{
|
||||
if (STATE_MODULES (sd) != NULL)
|
||||
sim_module_uninstall (sd);
|
||||
sim_cpu_free_all (sd);
|
||||
sim_state_free (sd);
|
||||
}
|
||||
|
||||
/* Create an instance of the simulator. */
|
||||
|
||||
SIM_DESC
|
||||
sim_open (kind, callback, abfd, argv)
|
||||
SIM_OPEN_KIND kind;
|
||||
host_callback *callback;
|
||||
struct _bfd *abfd;
|
||||
char **argv;
|
||||
{
|
||||
char c;
|
||||
int i;
|
||||
SIM_DESC sd = sim_state_alloc (kind, callback);
|
||||
|
||||
/* The cpu data is kept in a separately allocated chunk of memory. */
|
||||
if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
|
||||
{
|
||||
free_state (sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0 /* FIXME: pc is in mach-specific struct */
|
||||
/* FIXME: watchpoints code shouldn't need this */
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
STATE_WATCHPOINTS (sd)->pc = &(PC);
|
||||
STATE_WATCHPOINTS (sd)->sizeof_pc = sizeof (PC);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
|
||||
{
|
||||
free_state (sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0 /* FIXME: 'twould be nice if we could do this */
|
||||
/* These options override any module options.
|
||||
Obviously ambiguity should be avoided, however the caller may wish to
|
||||
augment the meaning of an option. */
|
||||
if (extra_options != NULL)
|
||||
sim_add_option_table (sd, extra_options);
|
||||
#endif
|
||||
|
||||
/* getopt will print the error message so we just have to exit if this fails.
|
||||
FIXME: Hmmm... in the case of gdb we need getopt to call
|
||||
print_filtered. */
|
||||
if (sim_parse_args (sd, argv) != SIM_RC_OK)
|
||||
{
|
||||
free_state (sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Allocate a handler for the control registers and other devices
|
||||
if no memory for that range has been allocated by the user.
|
||||
All are allocated in one chunk to keep things from being
|
||||
unnecessarily complicated. */
|
||||
if (sim_core_read_buffer (sd, NULL, read_map, &c, FR30_DEVICE_ADDR, 1) == 0)
|
||||
sim_core_attach (sd, NULL,
|
||||
0 /*level*/,
|
||||
access_read_write,
|
||||
0 /*space ???*/,
|
||||
FR30_DEVICE_ADDR, FR30_DEVICE_LEN /*nr_bytes*/,
|
||||
0 /*modulo*/,
|
||||
&fr30_devices,
|
||||
NULL /*buffer*/);
|
||||
#endif
|
||||
|
||||
/* Allocate core managed memory if none specified by user.
|
||||
Use address 4 here in case the user wanted address 0 unmapped. */
|
||||
if (sim_core_read_buffer (sd, NULL, read_map, &c, 4, 1) == 0)
|
||||
sim_do_commandf (sd, "memory region 0,0x%lx", FR30_DEFAULT_MEM_SIZE);
|
||||
|
||||
/* check for/establish the reference program image */
|
||||
if (sim_analyze_program (sd,
|
||||
(STATE_PROG_ARGV (sd) != NULL
|
||||
? *STATE_PROG_ARGV (sd)
|
||||
: NULL),
|
||||
abfd) != SIM_RC_OK)
|
||||
{
|
||||
free_state (sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Establish any remaining configuration options. */
|
||||
if (sim_config (sd) != SIM_RC_OK)
|
||||
{
|
||||
free_state (sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sim_post_argv_init (sd) != SIM_RC_OK)
|
||||
{
|
||||
free_state (sd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Open a copy of the cpu descriptor table. */
|
||||
{
|
||||
CGEN_CPU_DESC cd = fr30_cgen_cpu_open_1 (STATE_ARCHITECTURE (sd)->printable_name,
|
||||
CGEN_ENDIAN_BIG);
|
||||
for (i = 0; i < MAX_NR_PROCESSORS; ++i)
|
||||
{
|
||||
SIM_CPU *cpu = STATE_CPU (sd, i);
|
||||
CPU_CPU_DESC (cpu) = cd;
|
||||
CPU_DISASSEMBLER (cpu) = sim_cgen_disassemble_insn;
|
||||
}
|
||||
fr30_cgen_init_dis (cd);
|
||||
}
|
||||
|
||||
/* Initialize various cgen things not done by common framework.
|
||||
Must be done after fr30_cgen_cpu_open. */
|
||||
cgen_init (sd);
|
||||
|
||||
/* Store in a global so things like sparc32_dump_regs can be invoked
|
||||
from the gdb command line. */
|
||||
current_state = sd;
|
||||
|
||||
return sd;
|
||||
}
|
||||
|
||||
void
|
||||
sim_close (sd, quitting)
|
||||
SIM_DESC sd;
|
||||
int quitting;
|
||||
{
|
||||
fr30_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
|
||||
sim_module_uninstall (sd);
|
||||
}
|
||||
|
||||
SIM_RC
|
||||
sim_create_inferior (sd, abfd, argv, envp)
|
||||
SIM_DESC sd;
|
||||
struct _bfd *abfd;
|
||||
char **argv;
|
||||
char **envp;
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
SIM_ADDR addr;
|
||||
|
||||
if (abfd != NULL)
|
||||
addr = bfd_get_start_address (abfd);
|
||||
else
|
||||
addr = 0;
|
||||
sim_pc_set (current_cpu, addr);
|
||||
|
||||
#if 0
|
||||
STATE_ARGV (sd) = sim_copy_argv (argv);
|
||||
STATE_ENVP (sd) = sim_copy_argv (envp);
|
||||
#endif
|
||||
|
||||
return SIM_RC_OK;
|
||||
}
|
||||
|
||||
void
|
||||
sim_do_command (sd, cmd)
|
||||
SIM_DESC sd;
|
||||
char *cmd;
|
||||
{
|
||||
if (sim_args_command (sd, cmd) != SIM_RC_OK)
|
||||
sim_io_eprintf (sd, "Unknown command `%s'\n", cmd);
|
||||
}
|
||||
// OBSOLETE /* Main simulator entry points specific to the FR30.
|
||||
// OBSOLETE Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
// OBSOLETE Contributed by Cygnus Solutions.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-main.h"
|
||||
// OBSOLETE #ifdef HAVE_STDLIB_H
|
||||
// OBSOLETE #include <stdlib.h>
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE #include "sim-options.h"
|
||||
// OBSOLETE #include "libiberty.h"
|
||||
// OBSOLETE #include "bfd.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void free_state (SIM_DESC);
|
||||
// OBSOLETE static void print_fr30_misc_cpu (SIM_CPU *cpu, int verbose);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Records simulator descriptor so utilities like fr30_dump_regs can be
|
||||
// OBSOLETE called from gdb. */
|
||||
// OBSOLETE SIM_DESC current_state;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Cover function of sim_state_free to free the cpu buffers as well. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE free_state (SIM_DESC sd)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if (STATE_MODULES (sd) != NULL)
|
||||
// OBSOLETE sim_module_uninstall (sd);
|
||||
// OBSOLETE sim_cpu_free_all (sd);
|
||||
// OBSOLETE sim_state_free (sd);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Create an instance of the simulator. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SIM_DESC
|
||||
// OBSOLETE sim_open (kind, callback, abfd, argv)
|
||||
// OBSOLETE SIM_OPEN_KIND kind;
|
||||
// OBSOLETE host_callback *callback;
|
||||
// OBSOLETE struct _bfd *abfd;
|
||||
// OBSOLETE char **argv;
|
||||
// OBSOLETE {
|
||||
// OBSOLETE char c;
|
||||
// OBSOLETE int i;
|
||||
// OBSOLETE SIM_DESC sd = sim_state_alloc (kind, callback);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The cpu data is kept in a separately allocated chunk of memory. */
|
||||
// OBSOLETE if (sim_cpu_alloc_all (sd, 1, cgen_cpu_max_extra_bytes ()) != SIM_RC_OK)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE free_state (sd);
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if 0 /* FIXME: pc is in mach-specific struct */
|
||||
// OBSOLETE /* FIXME: watchpoints code shouldn't need this */
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
// OBSOLETE STATE_WATCHPOINTS (sd)->pc = &(PC);
|
||||
// OBSOLETE STATE_WATCHPOINTS (sd)->sizeof_pc = sizeof (PC);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE free_state (sd);
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if 0 /* FIXME: 'twould be nice if we could do this */
|
||||
// OBSOLETE /* These options override any module options.
|
||||
// OBSOLETE Obviously ambiguity should be avoided, however the caller may wish to
|
||||
// OBSOLETE augment the meaning of an option. */
|
||||
// OBSOLETE if (extra_options != NULL)
|
||||
// OBSOLETE sim_add_option_table (sd, extra_options);
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* getopt will print the error message so we just have to exit if this fails.
|
||||
// OBSOLETE FIXME: Hmmm... in the case of gdb we need getopt to call
|
||||
// OBSOLETE print_filtered. */
|
||||
// OBSOLETE if (sim_parse_args (sd, argv) != SIM_RC_OK)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE free_state (sd);
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if 0
|
||||
// OBSOLETE /* Allocate a handler for the control registers and other devices
|
||||
// OBSOLETE if no memory for that range has been allocated by the user.
|
||||
// OBSOLETE All are allocated in one chunk to keep things from being
|
||||
// OBSOLETE unnecessarily complicated. */
|
||||
// OBSOLETE if (sim_core_read_buffer (sd, NULL, read_map, &c, FR30_DEVICE_ADDR, 1) == 0)
|
||||
// OBSOLETE sim_core_attach (sd, NULL,
|
||||
// OBSOLETE 0 /*level*/,
|
||||
// OBSOLETE access_read_write,
|
||||
// OBSOLETE 0 /*space ???*/,
|
||||
// OBSOLETE FR30_DEVICE_ADDR, FR30_DEVICE_LEN /*nr_bytes*/,
|
||||
// OBSOLETE 0 /*modulo*/,
|
||||
// OBSOLETE &fr30_devices,
|
||||
// OBSOLETE NULL /*buffer*/);
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Allocate core managed memory if none specified by user.
|
||||
// OBSOLETE Use address 4 here in case the user wanted address 0 unmapped. */
|
||||
// OBSOLETE if (sim_core_read_buffer (sd, NULL, read_map, &c, 4, 1) == 0)
|
||||
// OBSOLETE sim_do_commandf (sd, "memory region 0,0x%lx", FR30_DEFAULT_MEM_SIZE);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* check for/establish the reference program image */
|
||||
// OBSOLETE if (sim_analyze_program (sd,
|
||||
// OBSOLETE (STATE_PROG_ARGV (sd) != NULL
|
||||
// OBSOLETE ? *STATE_PROG_ARGV (sd)
|
||||
// OBSOLETE : NULL),
|
||||
// OBSOLETE abfd) != SIM_RC_OK)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE free_state (sd);
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Establish any remaining configuration options. */
|
||||
// OBSOLETE if (sim_config (sd) != SIM_RC_OK)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE free_state (sd);
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (sim_post_argv_init (sd) != SIM_RC_OK)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE free_state (sd);
|
||||
// OBSOLETE return 0;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Open a copy of the cpu descriptor table. */
|
||||
// OBSOLETE {
|
||||
// OBSOLETE CGEN_CPU_DESC cd = fr30_cgen_cpu_open_1 (STATE_ARCHITECTURE (sd)->printable_name,
|
||||
// OBSOLETE CGEN_ENDIAN_BIG);
|
||||
// OBSOLETE for (i = 0; i < MAX_NR_PROCESSORS; ++i)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_CPU *cpu = STATE_CPU (sd, i);
|
||||
// OBSOLETE CPU_CPU_DESC (cpu) = cd;
|
||||
// OBSOLETE CPU_DISASSEMBLER (cpu) = sim_cgen_disassemble_insn;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE fr30_cgen_init_dis (cd);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Initialize various cgen things not done by common framework.
|
||||
// OBSOLETE Must be done after fr30_cgen_cpu_open. */
|
||||
// OBSOLETE cgen_init (sd);
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Store in a global so things like sparc32_dump_regs can be invoked
|
||||
// OBSOLETE from the gdb command line. */
|
||||
// OBSOLETE current_state = sd;
|
||||
// OBSOLETE
|
||||
// OBSOLETE return sd;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE sim_close (sd, quitting)
|
||||
// OBSOLETE SIM_DESC sd;
|
||||
// OBSOLETE int quitting;
|
||||
// OBSOLETE {
|
||||
// OBSOLETE fr30_cgen_cpu_close (CPU_CPU_DESC (STATE_CPU (sd, 0)));
|
||||
// OBSOLETE sim_module_uninstall (sd);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE SIM_RC
|
||||
// OBSOLETE sim_create_inferior (sd, abfd, argv, envp)
|
||||
// OBSOLETE SIM_DESC sd;
|
||||
// OBSOLETE struct _bfd *abfd;
|
||||
// OBSOLETE char **argv;
|
||||
// OBSOLETE char **envp;
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
// OBSOLETE SIM_ADDR addr;
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (abfd != NULL)
|
||||
// OBSOLETE addr = bfd_get_start_address (abfd);
|
||||
// OBSOLETE else
|
||||
// OBSOLETE addr = 0;
|
||||
// OBSOLETE sim_pc_set (current_cpu, addr);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if 0
|
||||
// OBSOLETE STATE_ARGV (sd) = sim_copy_argv (argv);
|
||||
// OBSOLETE STATE_ENVP (sd) = sim_copy_argv (envp);
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE return SIM_RC_OK;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE sim_do_command (sd, cmd)
|
||||
// OBSOLETE SIM_DESC sd;
|
||||
// OBSOLETE char *cmd;
|
||||
// OBSOLETE {
|
||||
// OBSOLETE if (sim_args_command (sd, cmd) != SIM_RC_OK)
|
||||
// OBSOLETE sim_io_eprintf (sd, "Unknown command `%s'\n", cmd);
|
||||
// OBSOLETE }
|
||||
|
@ -1,70 +1,70 @@
|
||||
/* Main header for the fr30. */
|
||||
|
||||
#define USING_SIM_BASE_H /* FIXME: quick hack */
|
||||
|
||||
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
|
||||
typedef struct _sim_cpu SIM_CPU;
|
||||
|
||||
/* sim-basics.h includes config.h but cgen-types.h must be included before
|
||||
sim-basics.h and cgen-types.h needs config.h. */
|
||||
#include "config.h"
|
||||
|
||||
#include "symcat.h"
|
||||
#include "sim-basics.h"
|
||||
#include "cgen-types.h"
|
||||
#include "fr30-desc.h"
|
||||
#include "fr30-opc.h"
|
||||
#include "arch.h"
|
||||
|
||||
/* These must be defined before sim-base.h. */
|
||||
typedef USI sim_cia;
|
||||
|
||||
#define CIA_GET(cpu) CPU_PC_GET (cpu)
|
||||
#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
|
||||
|
||||
#include "sim-base.h"
|
||||
#include "cgen-sim.h"
|
||||
#include "fr30-sim.h"
|
||||
|
||||
/* The _sim_cpu struct. */
|
||||
|
||||
struct _sim_cpu {
|
||||
/* sim/common cpu base. */
|
||||
sim_cpu_base base;
|
||||
|
||||
/* Static parts of cgen. */
|
||||
CGEN_CPU cgen_cpu;
|
||||
|
||||
/* CPU specific parts go here.
|
||||
Note that in files that don't need to access these pieces WANT_CPU_FOO
|
||||
won't be defined and thus these parts won't appear. This is ok in the
|
||||
sense that things work. It is a source of bugs though.
|
||||
One has to of course be careful to not take the size of this
|
||||
struct and no structure members accessed in non-cpu specific files can
|
||||
go after here. Oh for a better language. */
|
||||
#if defined (WANT_CPU_FR30BF)
|
||||
FR30BF_CPU_DATA cpu_data;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* The sim_state struct. */
|
||||
|
||||
struct sim_state {
|
||||
sim_cpu *cpu;
|
||||
#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
|
||||
|
||||
CGEN_STATE cgen_state;
|
||||
|
||||
sim_state_base base;
|
||||
};
|
||||
|
||||
/* Misc. */
|
||||
|
||||
/* Catch address exceptions. */
|
||||
extern SIM_CORE_SIGNAL_FN fr30_core_signal;
|
||||
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
|
||||
fr30_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
|
||||
(TRANSFER), (ERROR))
|
||||
|
||||
/* Default memory size. */
|
||||
#define FR30_DEFAULT_MEM_SIZE 0x800000 /* 8M */
|
||||
// OBSOLETE /* Main header for the fr30. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define USING_SIM_BASE_H /* FIXME: quick hack */
|
||||
// OBSOLETE
|
||||
// OBSOLETE struct _sim_cpu; /* FIXME: should be in sim-basics.h */
|
||||
// OBSOLETE typedef struct _sim_cpu SIM_CPU;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* sim-basics.h includes config.h but cgen-types.h must be included before
|
||||
// OBSOLETE sim-basics.h and cgen-types.h needs config.h. */
|
||||
// OBSOLETE #include "config.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "symcat.h"
|
||||
// OBSOLETE #include "sim-basics.h"
|
||||
// OBSOLETE #include "cgen-types.h"
|
||||
// OBSOLETE #include "fr30-desc.h"
|
||||
// OBSOLETE #include "fr30-opc.h"
|
||||
// OBSOLETE #include "arch.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* These must be defined before sim-base.h. */
|
||||
// OBSOLETE typedef USI sim_cia;
|
||||
// OBSOLETE
|
||||
// OBSOLETE #define CIA_GET(cpu) CPU_PC_GET (cpu)
|
||||
// OBSOLETE #define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-base.h"
|
||||
// OBSOLETE #include "cgen-sim.h"
|
||||
// OBSOLETE #include "fr30-sim.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The _sim_cpu struct. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE struct _sim_cpu {
|
||||
// OBSOLETE /* sim/common cpu base. */
|
||||
// OBSOLETE sim_cpu_base base;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Static parts of cgen. */
|
||||
// OBSOLETE CGEN_CPU cgen_cpu;
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* CPU specific parts go here.
|
||||
// OBSOLETE Note that in files that don't need to access these pieces WANT_CPU_FOO
|
||||
// OBSOLETE won't be defined and thus these parts won't appear. This is ok in the
|
||||
// OBSOLETE sense that things work. It is a source of bugs though.
|
||||
// OBSOLETE One has to of course be careful to not take the size of this
|
||||
// OBSOLETE struct and no structure members accessed in non-cpu specific files can
|
||||
// OBSOLETE go after here. Oh for a better language. */
|
||||
// OBSOLETE #if defined (WANT_CPU_FR30BF)
|
||||
// OBSOLETE FR30BF_CPU_DATA cpu_data;
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The sim_state struct. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE struct sim_state {
|
||||
// OBSOLETE sim_cpu *cpu;
|
||||
// OBSOLETE #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
|
||||
// OBSOLETE
|
||||
// OBSOLETE CGEN_STATE cgen_state;
|
||||
// OBSOLETE
|
||||
// OBSOLETE sim_state_base base;
|
||||
// OBSOLETE };
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Misc. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Catch address exceptions. */
|
||||
// OBSOLETE extern SIM_CORE_SIGNAL_FN fr30_core_signal;
|
||||
// OBSOLETE #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
|
||||
// OBSOLETE fr30_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
|
||||
// OBSOLETE (TRANSFER), (ERROR))
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Default memory size. */
|
||||
// OBSOLETE #define FR30_DEFAULT_MEM_SIZE 0x800000 /* 8M */
|
||||
|
436
sim/fr30/traps.c
436
sim/fr30/traps.c
@ -1,218 +1,218 @@
|
||||
/* fr30 exception, interrupt, and trap (EIT) support
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "targ-vals.h"
|
||||
#include "cgen-engine.h"
|
||||
|
||||
/* The semantic code invokes this for invalid (unrecognized) instructions. */
|
||||
|
||||
SEM_PC
|
||||
sim_engine_invalid_insn (SIM_CPU *current_cpu, IADDR cia, SEM_PC vpc)
|
||||
{
|
||||
SIM_DESC sd = CPU_STATE (current_cpu);
|
||||
|
||||
#if 0
|
||||
if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)
|
||||
{
|
||||
h_bsm_set (current_cpu, h_sm_get (current_cpu));
|
||||
h_bie_set (current_cpu, h_ie_get (current_cpu));
|
||||
h_bcond_set (current_cpu, h_cond_get (current_cpu));
|
||||
/* sm not changed */
|
||||
h_ie_set (current_cpu, 0);
|
||||
h_cond_set (current_cpu, 0);
|
||||
|
||||
h_bpc_set (current_cpu, cia);
|
||||
|
||||
sim_engine_restart (CPU_STATE (current_cpu), current_cpu, NULL,
|
||||
EIT_RSVD_INSN_ADDR);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
sim_engine_halt (sd, current_cpu, NULL, cia, sim_stopped, SIM_SIGILL);
|
||||
return vpc;
|
||||
}
|
||||
|
||||
/* Process an address exception. */
|
||||
|
||||
void
|
||||
fr30_core_signal (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia,
|
||||
unsigned int map, int nr_bytes, address_word addr,
|
||||
transfer_type transfer, sim_core_signals sig)
|
||||
{
|
||||
#if 0
|
||||
if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)
|
||||
{
|
||||
h_bsm_set (current_cpu, h_sm_get (current_cpu));
|
||||
h_bie_set (current_cpu, h_ie_get (current_cpu));
|
||||
h_bcond_set (current_cpu, h_cond_get (current_cpu));
|
||||
/* sm not changed */
|
||||
h_ie_set (current_cpu, 0);
|
||||
h_cond_set (current_cpu, 0);
|
||||
|
||||
h_bpc_set (current_cpu, cia);
|
||||
|
||||
sim_engine_restart (CPU_STATE (current_cpu), current_cpu, NULL,
|
||||
EIT_ADDR_EXCP_ADDR);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
sim_core_signal (sd, current_cpu, cia, map, nr_bytes, addr,
|
||||
transfer, sig);
|
||||
}
|
||||
|
||||
/* Read/write functions for system call interface. */
|
||||
|
||||
static int
|
||||
syscall_read_mem (host_callback *cb, struct cb_syscall *sc,
|
||||
unsigned long taddr, char *buf, int bytes)
|
||||
{
|
||||
SIM_DESC sd = (SIM_DESC) sc->p1;
|
||||
SIM_CPU *cpu = (SIM_CPU *) sc->p2;
|
||||
|
||||
return sim_core_read_buffer (sd, cpu, read_map, buf, taddr, bytes);
|
||||
}
|
||||
|
||||
static int
|
||||
syscall_write_mem (host_callback *cb, struct cb_syscall *sc,
|
||||
unsigned long taddr, const char *buf, int bytes)
|
||||
{
|
||||
SIM_DESC sd = (SIM_DESC) sc->p1;
|
||||
SIM_CPU *cpu = (SIM_CPU *) sc->p2;
|
||||
|
||||
return sim_core_write_buffer (sd, cpu, write_map, buf, taddr, bytes);
|
||||
}
|
||||
|
||||
/* Subroutine of fr30_int to save the PS and PC and setup for INT and INTE. */
|
||||
|
||||
static void
|
||||
setup_int (SIM_CPU *current_cpu, PCADDR pc)
|
||||
{
|
||||
USI ssp = fr30bf_h_dr_get (current_cpu, H_DR_SSP);
|
||||
USI ps = fr30bf_h_ps_get (current_cpu);
|
||||
|
||||
ssp -= 4;
|
||||
SETMEMSI (current_cpu, pc, ssp, ps);
|
||||
ssp -= 4;
|
||||
SETMEMSI (current_cpu, pc, ssp, pc + 2);
|
||||
fr30bf_h_dr_set (current_cpu, H_DR_SSP, ssp);
|
||||
fr30bf_h_sbit_set (current_cpu, 0);
|
||||
}
|
||||
|
||||
/* Trap support.
|
||||
The result is the pc address to continue at.
|
||||
Preprocessing like saving the various registers has already been done. */
|
||||
|
||||
USI
|
||||
fr30_int (SIM_CPU *current_cpu, PCADDR pc, int num)
|
||||
{
|
||||
SIM_DESC sd = CPU_STATE (current_cpu);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
|
||||
#ifdef SIM_HAVE_BREAKPOINTS
|
||||
/* Check for breakpoints "owned" by the simulator first, regardless
|
||||
of --environment. */
|
||||
if (num == TRAP_BREAKPOINT)
|
||||
{
|
||||
/* First try sim-break.c. If it's a breakpoint the simulator "owns"
|
||||
it doesn't return. Otherwise it returns and let's us try. */
|
||||
sim_handle_breakpoint (sd, current_cpu, pc);
|
||||
/* Fall through. */
|
||||
}
|
||||
#endif
|
||||
|
||||
if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)
|
||||
{
|
||||
/* The new pc is the trap vector entry.
|
||||
We assume there's a branch there to some handler. */
|
||||
USI new_pc;
|
||||
setup_int (current_cpu, pc);
|
||||
fr30bf_h_ibit_set (current_cpu, 0);
|
||||
new_pc = GETMEMSI (current_cpu, pc,
|
||||
fr30bf_h_dr_get (current_cpu, H_DR_TBR)
|
||||
+ 1024 - ((num + 1) * 4));
|
||||
return new_pc;
|
||||
}
|
||||
|
||||
switch (num)
|
||||
{
|
||||
case TRAP_SYSCALL :
|
||||
{
|
||||
/* TODO: find out what the ABI for this is */
|
||||
CB_SYSCALL s;
|
||||
|
||||
CB_SYSCALL_INIT (&s);
|
||||
s.func = fr30bf_h_gr_get (current_cpu, 0);
|
||||
s.arg1 = fr30bf_h_gr_get (current_cpu, 4);
|
||||
s.arg2 = fr30bf_h_gr_get (current_cpu, 5);
|
||||
s.arg3 = fr30bf_h_gr_get (current_cpu, 6);
|
||||
|
||||
if (s.func == TARGET_SYS_exit)
|
||||
{
|
||||
sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, s.arg1);
|
||||
}
|
||||
|
||||
s.p1 = (PTR) sd;
|
||||
s.p2 = (PTR) current_cpu;
|
||||
s.read_mem = syscall_read_mem;
|
||||
s.write_mem = syscall_write_mem;
|
||||
cb_syscall (cb, &s);
|
||||
fr30bf_h_gr_set (current_cpu, 2, s.errcode); /* TODO: check this one */
|
||||
fr30bf_h_gr_set (current_cpu, 4, s.result);
|
||||
fr30bf_h_gr_set (current_cpu, 1, s.result2); /* TODO: check this one */
|
||||
break;
|
||||
}
|
||||
|
||||
case TRAP_BREAKPOINT:
|
||||
sim_engine_halt (sd, current_cpu, NULL, pc,
|
||||
sim_stopped, SIM_SIGTRAP);
|
||||
break;
|
||||
|
||||
default :
|
||||
{
|
||||
USI new_pc;
|
||||
setup_int (current_cpu, pc);
|
||||
fr30bf_h_ibit_set (current_cpu, 0);
|
||||
new_pc = GETMEMSI (current_cpu, pc,
|
||||
fr30bf_h_dr_get (current_cpu, H_DR_TBR)
|
||||
+ 1024 - ((num + 1) * 4));
|
||||
return new_pc;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fake an "reti" insn.
|
||||
Since we didn't push anything to stack, all we need to do is
|
||||
update pc. */
|
||||
return pc + 2;
|
||||
}
|
||||
|
||||
USI
|
||||
fr30_inte (SIM_CPU *current_cpu, PCADDR pc, int num)
|
||||
{
|
||||
/* The new pc is the trap #9 vector entry.
|
||||
We assume there's a branch there to some handler. */
|
||||
USI new_pc;
|
||||
setup_int (current_cpu, pc);
|
||||
fr30bf_h_ilm_set (current_cpu, 4);
|
||||
new_pc = GETMEMSI (current_cpu, pc,
|
||||
fr30bf_h_dr_get (current_cpu, H_DR_TBR)
|
||||
+ 1024 - ((9 + 1) * 4));
|
||||
return new_pc;
|
||||
}
|
||||
// OBSOLETE /* fr30 exception, interrupt, and trap (EIT) support
|
||||
// OBSOLETE Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
// OBSOLETE Contributed by Cygnus Solutions.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This file is part of the GNU simulators.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is free software; you can redistribute it and/or modify
|
||||
// OBSOLETE it under the terms of the GNU General Public License as published by
|
||||
// OBSOLETE the Free Software Foundation; either version 2, or (at your option)
|
||||
// OBSOLETE any later version.
|
||||
// OBSOLETE
|
||||
// OBSOLETE This program is distributed in the hope that it will be useful,
|
||||
// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// OBSOLETE GNU General Public License for more details.
|
||||
// OBSOLETE
|
||||
// OBSOLETE You should have received a copy of the GNU General Public License along
|
||||
// OBSOLETE with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
// OBSOLETE 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE #include "sim-main.h"
|
||||
// OBSOLETE #include "targ-vals.h"
|
||||
// OBSOLETE #include "cgen-engine.h"
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* The semantic code invokes this for invalid (unrecognized) instructions. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE SEM_PC
|
||||
// OBSOLETE sim_engine_invalid_insn (SIM_CPU *current_cpu, IADDR cia, SEM_PC vpc)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_DESC sd = CPU_STATE (current_cpu);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #if 0
|
||||
// OBSOLETE if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE h_bsm_set (current_cpu, h_sm_get (current_cpu));
|
||||
// OBSOLETE h_bie_set (current_cpu, h_ie_get (current_cpu));
|
||||
// OBSOLETE h_bcond_set (current_cpu, h_cond_get (current_cpu));
|
||||
// OBSOLETE /* sm not changed */
|
||||
// OBSOLETE h_ie_set (current_cpu, 0);
|
||||
// OBSOLETE h_cond_set (current_cpu, 0);
|
||||
// OBSOLETE
|
||||
// OBSOLETE h_bpc_set (current_cpu, cia);
|
||||
// OBSOLETE
|
||||
// OBSOLETE sim_engine_restart (CPU_STATE (current_cpu), current_cpu, NULL,
|
||||
// OBSOLETE EIT_RSVD_INSN_ADDR);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE sim_engine_halt (sd, current_cpu, NULL, cia, sim_stopped, SIM_SIGILL);
|
||||
// OBSOLETE return vpc;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Process an address exception. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE void
|
||||
// OBSOLETE fr30_core_signal (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia,
|
||||
// OBSOLETE unsigned int map, int nr_bytes, address_word addr,
|
||||
// OBSOLETE transfer_type transfer, sim_core_signals sig)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE #if 0
|
||||
// OBSOLETE if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE h_bsm_set (current_cpu, h_sm_get (current_cpu));
|
||||
// OBSOLETE h_bie_set (current_cpu, h_ie_get (current_cpu));
|
||||
// OBSOLETE h_bcond_set (current_cpu, h_cond_get (current_cpu));
|
||||
// OBSOLETE /* sm not changed */
|
||||
// OBSOLETE h_ie_set (current_cpu, 0);
|
||||
// OBSOLETE h_cond_set (current_cpu, 0);
|
||||
// OBSOLETE
|
||||
// OBSOLETE h_bpc_set (current_cpu, cia);
|
||||
// OBSOLETE
|
||||
// OBSOLETE sim_engine_restart (CPU_STATE (current_cpu), current_cpu, NULL,
|
||||
// OBSOLETE EIT_ADDR_EXCP_ADDR);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE sim_core_signal (sd, current_cpu, cia, map, nr_bytes, addr,
|
||||
// OBSOLETE transfer, sig);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Read/write functions for system call interface. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static int
|
||||
// OBSOLETE syscall_read_mem (host_callback *cb, struct cb_syscall *sc,
|
||||
// OBSOLETE unsigned long taddr, char *buf, int bytes)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_DESC sd = (SIM_DESC) sc->p1;
|
||||
// OBSOLETE SIM_CPU *cpu = (SIM_CPU *) sc->p2;
|
||||
// OBSOLETE
|
||||
// OBSOLETE return sim_core_read_buffer (sd, cpu, read_map, buf, taddr, bytes);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE static int
|
||||
// OBSOLETE syscall_write_mem (host_callback *cb, struct cb_syscall *sc,
|
||||
// OBSOLETE unsigned long taddr, const char *buf, int bytes)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_DESC sd = (SIM_DESC) sc->p1;
|
||||
// OBSOLETE SIM_CPU *cpu = (SIM_CPU *) sc->p2;
|
||||
// OBSOLETE
|
||||
// OBSOLETE return sim_core_write_buffer (sd, cpu, write_map, buf, taddr, bytes);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Subroutine of fr30_int to save the PS and PC and setup for INT and INTE. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE setup_int (SIM_CPU *current_cpu, PCADDR pc)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE USI ssp = fr30bf_h_dr_get (current_cpu, H_DR_SSP);
|
||||
// OBSOLETE USI ps = fr30bf_h_ps_get (current_cpu);
|
||||
// OBSOLETE
|
||||
// OBSOLETE ssp -= 4;
|
||||
// OBSOLETE SETMEMSI (current_cpu, pc, ssp, ps);
|
||||
// OBSOLETE ssp -= 4;
|
||||
// OBSOLETE SETMEMSI (current_cpu, pc, ssp, pc + 2);
|
||||
// OBSOLETE fr30bf_h_dr_set (current_cpu, H_DR_SSP, ssp);
|
||||
// OBSOLETE fr30bf_h_sbit_set (current_cpu, 0);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Trap support.
|
||||
// OBSOLETE The result is the pc address to continue at.
|
||||
// OBSOLETE Preprocessing like saving the various registers has already been done. */
|
||||
// OBSOLETE
|
||||
// OBSOLETE USI
|
||||
// OBSOLETE fr30_int (SIM_CPU *current_cpu, PCADDR pc, int num)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE SIM_DESC sd = CPU_STATE (current_cpu);
|
||||
// OBSOLETE host_callback *cb = STATE_CALLBACK (sd);
|
||||
// OBSOLETE
|
||||
// OBSOLETE #ifdef SIM_HAVE_BREAKPOINTS
|
||||
// OBSOLETE /* Check for breakpoints "owned" by the simulator first, regardless
|
||||
// OBSOLETE of --environment. */
|
||||
// OBSOLETE if (num == TRAP_BREAKPOINT)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* First try sim-break.c. If it's a breakpoint the simulator "owns"
|
||||
// OBSOLETE it doesn't return. Otherwise it returns and let's us try. */
|
||||
// OBSOLETE sim_handle_breakpoint (sd, current_cpu, pc);
|
||||
// OBSOLETE /* Fall through. */
|
||||
// OBSOLETE }
|
||||
// OBSOLETE #endif
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* The new pc is the trap vector entry.
|
||||
// OBSOLETE We assume there's a branch there to some handler. */
|
||||
// OBSOLETE USI new_pc;
|
||||
// OBSOLETE setup_int (current_cpu, pc);
|
||||
// OBSOLETE fr30bf_h_ibit_set (current_cpu, 0);
|
||||
// OBSOLETE new_pc = GETMEMSI (current_cpu, pc,
|
||||
// OBSOLETE fr30bf_h_dr_get (current_cpu, H_DR_TBR)
|
||||
// OBSOLETE + 1024 - ((num + 1) * 4));
|
||||
// OBSOLETE return new_pc;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE switch (num)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case TRAP_SYSCALL :
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* TODO: find out what the ABI for this is */
|
||||
// OBSOLETE CB_SYSCALL s;
|
||||
// OBSOLETE
|
||||
// OBSOLETE CB_SYSCALL_INIT (&s);
|
||||
// OBSOLETE s.func = fr30bf_h_gr_get (current_cpu, 0);
|
||||
// OBSOLETE s.arg1 = fr30bf_h_gr_get (current_cpu, 4);
|
||||
// OBSOLETE s.arg2 = fr30bf_h_gr_get (current_cpu, 5);
|
||||
// OBSOLETE s.arg3 = fr30bf_h_gr_get (current_cpu, 6);
|
||||
// OBSOLETE
|
||||
// OBSOLETE if (s.func == TARGET_SYS_exit)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE sim_engine_halt (sd, current_cpu, NULL, pc, sim_exited, s.arg1);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE s.p1 = (PTR) sd;
|
||||
// OBSOLETE s.p2 = (PTR) current_cpu;
|
||||
// OBSOLETE s.read_mem = syscall_read_mem;
|
||||
// OBSOLETE s.write_mem = syscall_write_mem;
|
||||
// OBSOLETE cb_syscall (cb, &s);
|
||||
// OBSOLETE fr30bf_h_gr_set (current_cpu, 2, s.errcode); /* TODO: check this one */
|
||||
// OBSOLETE fr30bf_h_gr_set (current_cpu, 4, s.result);
|
||||
// OBSOLETE fr30bf_h_gr_set (current_cpu, 1, s.result2); /* TODO: check this one */
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE case TRAP_BREAKPOINT:
|
||||
// OBSOLETE sim_engine_halt (sd, current_cpu, NULL, pc,
|
||||
// OBSOLETE sim_stopped, SIM_SIGTRAP);
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE
|
||||
// OBSOLETE default :
|
||||
// OBSOLETE {
|
||||
// OBSOLETE USI new_pc;
|
||||
// OBSOLETE setup_int (current_cpu, pc);
|
||||
// OBSOLETE fr30bf_h_ibit_set (current_cpu, 0);
|
||||
// OBSOLETE new_pc = GETMEMSI (current_cpu, pc,
|
||||
// OBSOLETE fr30bf_h_dr_get (current_cpu, H_DR_TBR)
|
||||
// OBSOLETE + 1024 - ((num + 1) * 4));
|
||||
// OBSOLETE return new_pc;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE /* Fake an "reti" insn.
|
||||
// OBSOLETE Since we didn't push anything to stack, all we need to do is
|
||||
// OBSOLETE update pc. */
|
||||
// OBSOLETE return pc + 2;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE
|
||||
// OBSOLETE USI
|
||||
// OBSOLETE fr30_inte (SIM_CPU *current_cpu, PCADDR pc, int num)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* The new pc is the trap #9 vector entry.
|
||||
// OBSOLETE We assume there's a branch there to some handler. */
|
||||
// OBSOLETE USI new_pc;
|
||||
// OBSOLETE setup_int (current_cpu, pc);
|
||||
// OBSOLETE fr30bf_h_ilm_set (current_cpu, 4);
|
||||
// OBSOLETE new_pc = GETMEMSI (current_cpu, pc,
|
||||
// OBSOLETE fr30bf_h_dr_get (current_cpu, H_DR_TBR)
|
||||
// OBSOLETE + 1024 - ((9 + 1) * 4));
|
||||
// OBSOLETE return new_pc;
|
||||
// OBSOLETE }
|
||||
|
Loading…
x
Reference in New Issue
Block a user