1996-08-29 01:06:42 +00:00
|
|
|
#include <signal.h>
|
1997-09-03 04:10:33 +00:00
|
|
|
#include "sim-main.h"
|
|
|
|
#include "sim-options.h"
|
|
|
|
#include "v850_sim.h"
|
|
|
|
|
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
#include <string.h>
|
|
|
|
#else
|
|
|
|
#ifdef HAVE_STRINGS_H
|
|
|
|
#include <strings.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1996-08-29 01:06:42 +00:00
|
|
|
#include "bfd.h"
|
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
#ifndef INLINE
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define INLINE inline
|
|
|
|
#else
|
|
|
|
#define INLINE
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
|
|
|
|
/* For compatibility */
|
|
|
|
SIM_DESC simulator;
|
1996-08-29 01:06:42 +00:00
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* v850 interrupt model */
|
|
|
|
|
1997-04-17 10:54:07 +00:00
|
|
|
enum interrupt_type
|
|
|
|
{
|
|
|
|
int_reset,
|
|
|
|
int_nmi,
|
|
|
|
int_intov1,
|
|
|
|
int_intp10,
|
|
|
|
int_intp11,
|
|
|
|
int_intp12,
|
|
|
|
int_intp13,
|
|
|
|
int_intcm4,
|
|
|
|
num_int_types
|
|
|
|
};
|
|
|
|
|
|
|
|
char *interrupt_names[] = {
|
|
|
|
"reset",
|
|
|
|
"nmi",
|
|
|
|
"intov1",
|
|
|
|
"intp10",
|
|
|
|
"intp11",
|
|
|
|
"intp12",
|
|
|
|
"intp13",
|
|
|
|
"intcm4",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
static void
|
|
|
|
do_interrupt (sd, data)
|
|
|
|
SIM_DESC sd;
|
|
|
|
void *data;
|
|
|
|
{
|
1997-09-10 22:47:12 +00:00
|
|
|
char **interrupt_name = (char**)data;
|
|
|
|
enum interrupt_type inttype;
|
|
|
|
inttype = (interrupt_name - STATE_WATCHPOINTS (sd)->interrupt_names);
|
1997-09-08 17:42:48 +00:00
|
|
|
/* Disable further interrupts. */
|
|
|
|
PSW |= PSW_ID;
|
|
|
|
/* Indicate that we're doing interrupt not exception processing. */
|
|
|
|
PSW &= ~PSW_EP;
|
|
|
|
if (inttype == int_reset)
|
|
|
|
{
|
|
|
|
PC = 0;
|
|
|
|
PSW = 0x20;
|
|
|
|
ECR = 0;
|
|
|
|
/* (Might be useful to init other regs with random values.) */
|
|
|
|
}
|
|
|
|
else if (inttype == int_nmi)
|
|
|
|
{
|
|
|
|
if (PSW & PSW_NP)
|
|
|
|
{
|
|
|
|
/* We're already working on an NMI, so this one must wait
|
|
|
|
around until the previous one is done. The processor
|
|
|
|
ignores subsequent NMIs, so we don't need to count them. */
|
|
|
|
State.pending_nmi = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FEPC = PC;
|
|
|
|
FEPSW = PSW;
|
|
|
|
/* Set the FECC part of the ECR. */
|
|
|
|
ECR &= 0x0000ffff;
|
|
|
|
ECR |= 0x10;
|
|
|
|
PSW |= PSW_NP;
|
|
|
|
PC = 0x10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
EIPC = PC;
|
|
|
|
EIPSW = PSW;
|
|
|
|
/* Clear the EICC part of the ECR, will set below. */
|
|
|
|
ECR &= 0xffff0000;
|
|
|
|
switch (inttype)
|
|
|
|
{
|
|
|
|
case int_intov1:
|
|
|
|
PC = 0x80;
|
|
|
|
ECR |= 0x80;
|
|
|
|
break;
|
|
|
|
case int_intp10:
|
|
|
|
PC = 0x90;
|
|
|
|
ECR |= 0x90;
|
|
|
|
break;
|
|
|
|
case int_intp11:
|
|
|
|
PC = 0xa0;
|
|
|
|
ECR |= 0xa0;
|
|
|
|
break;
|
|
|
|
case int_intp12:
|
|
|
|
PC = 0xb0;
|
|
|
|
ECR |= 0xb0;
|
|
|
|
break;
|
|
|
|
case int_intp13:
|
|
|
|
PC = 0xc0;
|
|
|
|
ECR |= 0xc0;
|
|
|
|
break;
|
|
|
|
case int_intcm4:
|
|
|
|
PC = 0xd0;
|
|
|
|
ECR |= 0xd0;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* Should never be possible. */
|
|
|
|
abort ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1996-09-10 02:51:07 +00:00
|
|
|
|
1997-04-17 10:54:07 +00:00
|
|
|
/* These default values correspond to expected usage for the chip. */
|
|
|
|
|
1996-09-11 20:54:21 +00:00
|
|
|
int v850_debug;
|
1996-09-03 16:25:51 +00:00
|
|
|
|
|
|
|
uint32 OP[4];
|
1996-08-29 01:06:42 +00:00
|
|
|
|
1996-09-10 02:51:07 +00:00
|
|
|
static long hash PARAMS ((long));
|
1997-09-03 04:10:33 +00:00
|
|
|
#if 0
|
1996-09-10 02:51:07 +00:00
|
|
|
static void do_format_1_2 PARAMS ((uint32));
|
|
|
|
static void do_format_3 PARAMS ((uint32));
|
|
|
|
static void do_format_4 PARAMS ((uint32));
|
|
|
|
static void do_format_5 PARAMS ((uint32));
|
|
|
|
static void do_format_6 PARAMS ((uint32));
|
|
|
|
static void do_format_7 PARAMS ((uint32));
|
|
|
|
static void do_format_8 PARAMS ((uint32));
|
|
|
|
static void do_format_9_10 PARAMS ((uint32));
|
1997-09-03 04:10:33 +00:00
|
|
|
#endif
|
1996-08-29 01:06:42 +00:00
|
|
|
|
|
|
|
#define MAX_HASH 63
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1996-08-29 01:06:42 +00:00
|
|
|
struct hash_entry
|
|
|
|
{
|
|
|
|
struct hash_entry *next;
|
1997-09-03 07:30:17 +00:00
|
|
|
unsigned long opcode;
|
|
|
|
unsigned long mask;
|
1996-08-29 01:06:42 +00:00
|
|
|
struct simops *ops;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hash_entry hash_table[MAX_HASH+1];
|
|
|
|
|
1996-09-10 02:51:07 +00:00
|
|
|
|
|
|
|
static INLINE long
|
1996-08-29 01:06:42 +00:00
|
|
|
hash(insn)
|
|
|
|
long insn;
|
|
|
|
{
|
1997-08-25 23:14:25 +00:00
|
|
|
if ( (insn & 0x0600) == 0
|
1996-09-10 02:51:07 +00:00
|
|
|
|| (insn & 0x0700) == 0x0200
|
|
|
|
|| (insn & 0x0700) == 0x0600
|
|
|
|
|| (insn & 0x0780) == 0x0700)
|
1996-08-29 23:39:23 +00:00
|
|
|
return (insn & 0x07e0) >> 5;
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1996-08-30 16:35:10 +00:00
|
|
|
if ((insn & 0x0700) == 0x0300
|
|
|
|
|| (insn & 0x0700) == 0x0400
|
|
|
|
|| (insn & 0x0700) == 0x0500)
|
|
|
|
return (insn & 0x0780) >> 7;
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1996-08-30 16:35:10 +00:00
|
|
|
if ((insn & 0x07c0) == 0x0780)
|
1996-08-29 23:39:23 +00:00
|
|
|
return (insn & 0x07c0) >> 6;
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1996-08-30 16:35:10 +00:00
|
|
|
return (insn & 0x07e0) >> 5;
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
#if 0
|
1996-08-29 01:06:42 +00:00
|
|
|
static struct hash_entry *
|
1997-09-03 04:10:33 +00:00
|
|
|
lookup_hash (sd, ins)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
uint32 ins;
|
|
|
|
{
|
|
|
|
struct hash_entry *h;
|
|
|
|
|
1996-08-29 23:39:23 +00:00
|
|
|
h = &hash_table[hash(ins)];
|
1996-08-29 01:06:42 +00:00
|
|
|
|
1996-09-10 02:51:07 +00:00
|
|
|
while ((ins & h->mask) != h->opcode)
|
1996-08-29 01:06:42 +00:00
|
|
|
{
|
|
|
|
if (h->next == NULL)
|
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
sim_io_error (sd, "ERROR looking up hash for 0x%lx, PC=0x%lx",
|
|
|
|
(long) ins, (long) PC);
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
h = h->next;
|
|
|
|
}
|
|
|
|
return (h);
|
|
|
|
}
|
1997-09-08 17:42:48 +00:00
|
|
|
#endif
|
1996-08-29 01:06:42 +00:00
|
|
|
|
1997-04-17 10:54:07 +00:00
|
|
|
SIM_DESC
|
1997-08-25 23:14:25 +00:00
|
|
|
sim_open (kind, cb, abfd, argv)
|
1997-04-17 10:54:07 +00:00
|
|
|
SIM_OPEN_KIND kind;
|
1997-08-25 23:14:25 +00:00
|
|
|
host_callback *cb;
|
|
|
|
struct _bfd *abfd;
|
1997-04-17 10:54:07 +00:00
|
|
|
char **argv;
|
1996-08-29 01:06:42 +00:00
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
SIM_DESC sd = sim_state_alloc (kind, cb);
|
1997-09-16 04:49:24 +00:00
|
|
|
int mach;
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
/* for compatibility */
|
|
|
|
simulator = sd;
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
/* FIXME: should be better way of setting up interrupts */
|
|
|
|
STATE_WATCHPOINTS (sd)->pc = &(PC);
|
|
|
|
STATE_WATCHPOINTS (sd)->sizeof_pc = sizeof (PC);
|
|
|
|
STATE_WATCHPOINTS (sd)->interrupt_handler = do_interrupt;
|
|
|
|
STATE_WATCHPOINTS (sd)->interrupt_names = interrupt_names;
|
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
|
|
|
|
return 0;
|
|
|
|
|
1997-09-04 10:10:02 +00:00
|
|
|
/* Allocate core managed memory */
|
1997-09-12 02:44:03 +00:00
|
|
|
|
1997-09-04 10:10:02 +00:00
|
|
|
/* "Mirror" the ROM addresses below 1MB. */
|
1997-09-12 02:44:03 +00:00
|
|
|
sim_do_commandf (sd, "memory region 0,0x100000,0x%lx", V850_ROM_SIZE);
|
1997-09-04 10:10:02 +00:00
|
|
|
/* Chunk of ram adjacent to rom */
|
1997-09-12 02:44:03 +00:00
|
|
|
sim_do_commandf (sd, "memory region 0x100000,0x%lx", V850_LOW_END-0x100000);
|
1997-09-04 10:10:02 +00:00
|
|
|
/* peripheral I/O region - mirror 1K across 4k (0x1000) */
|
|
|
|
sim_do_command (sd, "memory region 0xfff000,0x1000,1024");
|
|
|
|
/* similarly if in the internal RAM region */
|
|
|
|
sim_do_command (sd, "memory region 0xffe000,0x1000,1024");
|
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
/* 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)
|
1996-09-11 20:54:21 +00:00
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
/* Uninstall the modules to avoid memory leaks,
|
|
|
|
file descriptor leaks, etc. */
|
|
|
|
sim_module_uninstall (sd);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check for/establish the a reference program image */
|
|
|
|
if (sim_analyze_program (sd,
|
|
|
|
(STATE_PROG_ARGV (sd) != NULL
|
|
|
|
? *STATE_PROG_ARGV (sd)
|
|
|
|
: NULL),
|
|
|
|
abfd) != SIM_RC_OK)
|
|
|
|
{
|
|
|
|
sim_module_uninstall (sd);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* establish any remaining configuration options */
|
|
|
|
if (sim_config (sd) != SIM_RC_OK)
|
|
|
|
{
|
|
|
|
sim_module_uninstall (sd);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sim_post_argv_init (sd) != SIM_RC_OK)
|
|
|
|
{
|
|
|
|
/* Uninstall the modules to avoid memory leaks,
|
|
|
|
file descriptor leaks, etc. */
|
|
|
|
sim_module_uninstall (sd);
|
|
|
|
return 0;
|
1996-09-11 20:54:21 +00:00
|
|
|
}
|
1996-08-29 01:06:42 +00:00
|
|
|
|
|
|
|
|
1997-09-16 04:49:24 +00:00
|
|
|
/* determine the machine type */
|
|
|
|
if (STATE_ARCHITECTURE (sd) != NULL
|
|
|
|
&& STATE_ARCHITECTURE (sd)->arch == bfd_arch_v850)
|
|
|
|
mach = STATE_ARCHITECTURE (sd)->mach;
|
|
|
|
else
|
|
|
|
mach = bfd_mach_v850; /* default */
|
|
|
|
|
|
|
|
/* set machine specific configuration */
|
|
|
|
switch (mach)
|
|
|
|
{
|
|
|
|
case bfd_mach_v850:
|
|
|
|
/* start-sanitize-v850e */
|
|
|
|
case bfd_mach_v850e:
|
|
|
|
/* end-sanitize-v850e */
|
|
|
|
STATE_CPU (sd, 0)->psw_mask = (PSW_NP | PSW_EP | PSW_ID | PSW_SAT
|
|
|
|
| PSW_CY | PSW_OV | PSW_S | PSW_Z);
|
|
|
|
break;
|
|
|
|
/* start-sanitize-v850eq */
|
|
|
|
case bfd_mach_v850eq:
|
|
|
|
PSW |= PSW_US;
|
|
|
|
STATE_CPU (sd, 0)->psw_mask = (PSW_US
|
|
|
|
| PSW_NP | PSW_EP | PSW_ID | PSW_SAT
|
|
|
|
| PSW_CY | PSW_OV | PSW_S | PSW_Z);
|
|
|
|
break;
|
|
|
|
/* end-sanitize-v850eq */
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
1997-04-17 10:54:07 +00:00
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
return sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
1997-04-17 10:54:07 +00:00
|
|
|
sim_close (sd, quitting)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
int quitting;
|
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
sim_module_uninstall (sd);
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
1997-04-18 12:24:52 +00:00
|
|
|
int
|
|
|
|
sim_stop (sd)
|
|
|
|
SIM_DESC sd;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
#if 0
|
1996-08-29 01:06:42 +00:00
|
|
|
void
|
1997-09-08 17:42:48 +00:00
|
|
|
sim_engine_run (sd, next_cpu_nr, siggnal)
|
1997-04-17 10:54:07 +00:00
|
|
|
SIM_DESC sd;
|
1997-09-08 17:42:48 +00:00
|
|
|
int next_cpu_nr;
|
|
|
|
int siggnal;
|
1996-08-29 01:06:42 +00:00
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
uint32 inst;
|
1997-09-03 07:30:17 +00:00
|
|
|
SIM_ADDR oldpc;
|
1997-09-03 04:10:33 +00:00
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
while (1)
|
1997-04-17 10:54:07 +00:00
|
|
|
{
|
1997-08-25 23:14:25 +00:00
|
|
|
struct hash_entry * h;
|
1997-04-17 10:54:07 +00:00
|
|
|
/* Fetch the current instruction. */
|
1997-08-25 23:14:25 +00:00
|
|
|
inst = RLW (PC);
|
1997-04-17 10:54:07 +00:00
|
|
|
oldpc = PC;
|
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
h = lookup_hash (sd, inst);
|
1997-08-25 23:14:25 +00:00
|
|
|
OP[0] = inst & 0x1f;
|
|
|
|
OP[1] = (inst >> 11) & 0x1f;
|
|
|
|
OP[2] = (inst >> 16) & 0xffff;
|
|
|
|
OP[3] = inst;
|
|
|
|
|
1997-09-03 04:10:33 +00:00
|
|
|
/* fprintf (stderr, "PC = %x, SP = %x\n", PC, SP ); */
|
1997-08-25 23:14:25 +00:00
|
|
|
|
|
|
|
if (inst == 0)
|
1997-04-17 10:54:07 +00:00
|
|
|
{
|
1997-08-25 23:14:25 +00:00
|
|
|
fprintf (stderr, "NOP encountered!\n");
|
|
|
|
break;
|
1997-04-17 10:54:07 +00:00
|
|
|
}
|
1997-08-25 23:14:25 +00:00
|
|
|
|
|
|
|
PC += h->ops->func ();
|
|
|
|
|
|
|
|
if (oldpc == PC)
|
1997-04-17 10:54:07 +00:00
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
sim_io_eprintf (sd, "simulator loop at %lx\n", (long) PC );
|
1997-08-25 23:14:25 +00:00
|
|
|
break;
|
1997-04-17 10:54:07 +00:00
|
|
|
}
|
1997-08-25 23:14:25 +00:00
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
if (sim_events_tick (sd))
|
1997-04-17 10:54:07 +00:00
|
|
|
{
|
1997-09-08 17:42:48 +00:00
|
|
|
sim_events_process (sd);
|
1997-04-17 10:54:07 +00:00
|
|
|
}
|
|
|
|
}
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
1997-09-08 17:42:48 +00:00
|
|
|
#endif
|
1996-08-29 01:06:42 +00:00
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
#if 0
|
1996-08-29 01:06:42 +00:00
|
|
|
int
|
1997-04-17 10:54:07 +00:00
|
|
|
sim_trace (sd)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
{
|
1996-09-11 20:54:21 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
v850_debug = DEBUG;
|
|
|
|
#endif
|
1997-04-17 10:54:07 +00:00
|
|
|
sim_resume (sd, 0, 0);
|
1996-09-11 20:54:21 +00:00
|
|
|
return 1;
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
1997-09-08 17:42:48 +00:00
|
|
|
#endif
|
1996-08-29 01:06:42 +00:00
|
|
|
|
|
|
|
void
|
1997-04-17 10:54:07 +00:00
|
|
|
sim_info (sd, verbose)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
int verbose;
|
|
|
|
{
|
1997-09-12 02:44:03 +00:00
|
|
|
profile_print (sd, STATE_VERBOSE_P (sd), NULL, NULL);
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
1997-04-17 10:54:07 +00:00
|
|
|
SIM_RC
|
1997-09-03 04:10:33 +00:00
|
|
|
sim_create_inferior (sd, prog_bfd, argv, env)
|
1997-04-17 10:54:07 +00:00
|
|
|
SIM_DESC sd;
|
1997-09-03 04:10:33 +00:00
|
|
|
struct _bfd *prog_bfd;
|
1996-08-29 01:06:42 +00:00
|
|
|
char **argv;
|
|
|
|
char **env;
|
|
|
|
{
|
1997-09-03 04:10:33 +00:00
|
|
|
memset (&State, 0, sizeof (State));
|
|
|
|
if (prog_bfd != NULL)
|
1997-08-27 04:44:41 +00:00
|
|
|
PC = bfd_get_start_address (prog_bfd);
|
1997-09-15 08:18:20 +00:00
|
|
|
/* start-sanitize-v850eq */
|
|
|
|
/* For v850eq, set PSW[US] by default */
|
|
|
|
if (STATE_ARCHITECTURE (sd) != NULL
|
|
|
|
&& STATE_ARCHITECTURE (sd)->arch == bfd_arch_v850
|
|
|
|
&& STATE_ARCHITECTURE (sd)->mach == bfd_mach_v850eq)
|
|
|
|
PSW |= PSW_US;
|
|
|
|
/* end-sanitize-v850eq */
|
1997-04-17 10:54:07 +00:00
|
|
|
return SIM_RC_OK;
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1997-04-17 10:54:07 +00:00
|
|
|
sim_fetch_register (sd, rn, memory)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
int rn;
|
|
|
|
unsigned char *memory;
|
|
|
|
{
|
1997-09-04 10:10:02 +00:00
|
|
|
*(unsigned32*)memory = H2T_4 (State.regs[rn]);
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1997-04-17 10:54:07 +00:00
|
|
|
sim_store_register (sd, rn, memory)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
int rn;
|
|
|
|
unsigned char *memory;
|
|
|
|
{
|
1997-09-04 10:10:02 +00:00
|
|
|
State.regs[rn] = T2H_4 (*(unsigned32*)memory);
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|
|
|
|
|
1997-04-17 10:54:07 +00:00
|
|
|
void
|
|
|
|
sim_do_command (sd, cmd)
|
|
|
|
SIM_DESC sd;
|
1996-08-29 01:06:42 +00:00
|
|
|
char *cmd;
|
1997-04-17 10:54:07 +00:00
|
|
|
{
|
|
|
|
char *mm_cmd = "memory-map";
|
|
|
|
char *int_cmd = "interrupt";
|
|
|
|
|
1997-09-08 17:42:48 +00:00
|
|
|
if (sim_args_command (sd, cmd) != SIM_RC_OK)
|
|
|
|
{
|
|
|
|
if (strncmp (cmd, mm_cmd, strlen (mm_cmd) == 0))
|
|
|
|
sim_io_eprintf (sd, "`memory-map' command replaced by `sim memory'\n");
|
|
|
|
else if (strncmp (cmd, int_cmd, strlen (int_cmd)) == 0)
|
|
|
|
sim_io_eprintf (sd, "`interrupt' command replaced by `sim watch'\n");
|
|
|
|
else
|
|
|
|
sim_io_eprintf (sd, "Unknown command `%s'\n", cmd);
|
|
|
|
}
|
1996-08-29 01:06:42 +00:00
|
|
|
}
|