2 /* Main header for the Vitesse IQ2000. */
7 #define USING_SIM_BASE_H /* FIXME: quick hack */
9 struct _sim_cpu
; /* FIXME: should be in sim-basics.h */
10 typedef struct _sim_cpu SIM_CPU
;
12 /* sim-basics.h includes config.h but cgen-types.h must be included before
13 sim-basics.h and cgen-types.h needs config.h. */
17 #include "sim-basics.h"
18 #include "cgen-types.h"
19 #include "iq2000-desc.h"
20 #include "iq2000-opc.h"
23 /* Pull in IQ2000_{DATA,INSN}_{MASK,VALUE}. */
24 #include "elf/iq2000.h"
28 #include "iq2000-sim.h"
30 /* The _sim_cpu struct. */
33 /* sim/common cpu base. */
36 /* Static parts of cgen. */
39 /* CPU specific parts go here.
40 Note that in files that don't need to access these pieces WANT_CPU_FOO
41 won't be defined and thus these parts won't appear. This is ok in the
42 sense that things work. It is a source of bugs though.
43 One has to of course be careful to not take the size of this
44 struct and no structure members accessed in non-cpu specific files can
45 go after here. Oh for a better language. */
46 #if defined (WANT_CPU_IQ2000BF)
47 IQ2000BF_CPU_DATA cpu_data
;
51 /* The sim_state struct. */
54 sim_cpu
*cpu
[MAX_NR_PROCESSORS
];
56 CGEN_STATE cgen_state
;
63 /* Catch address exceptions. */
64 extern SIM_CORE_SIGNAL_FN iq2000_core_signal
;
65 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
66 iq2000_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
69 /* Convert between CPU-internal addresses and sim_core addresses. */
70 #define CPU2DATA(addr) (IQ2000_DATA_VALUE + (addr))
71 #define DATA2CPU(addr) ((addr) - IQ2000_DATA_VALUE)
72 #define CPU2INSN(addr) (IQ2000_INSN_VALUE + ((addr) & ~IQ2000_INSN_MASK))
73 #define INSN2CPU(addr) ((addr) - IQ2000_INSN_VALUE)
74 #define IQ2000_INSN_MEM_SIZE (CPU2INSN(0x800000) - CPU2INSN(0x0000))
75 #define IQ2000_DATA_MEM_SIZE (CPU2DATA(0x800000) - CPU2DATA(0x0000))
77 #endif /* SIM_MAIN_H */