]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/iq2000/sim-main.h
sim: switch config.h usage to defs.h
[thirdparty/binutils-gdb.git] / sim / iq2000 / sim-main.h
CommitLineData
edece237
CV
1
2/* Main header for the Vitesse IQ2000. */
3
4#ifndef SIM_MAIN_H
5#define SIM_MAIN_H
6
f0c1b768
MF
7/* This is a global setting. Different cpu families can't mix-n-match -scache
8 and -pbb. However some cpu families may use -simple while others use
9 one of -scache/-pbb. ???? */
10#define WITH_SCACHE_PBB 1
11
edece237
CV
12#include "symcat.h"
13#include "sim-basics.h"
14#include "cgen-types.h"
15#include "iq2000-desc.h"
16#include "iq2000-opc.h"
17#include "arch.h"
18
19/* Pull in IQ2000_{DATA,INSN}_{MASK,VALUE}. */
20#include "elf/iq2000.h"
21
edece237
CV
22#include "sim-base.h"
23#include "cgen-sim.h"
edece237
CV
24\f
25/* The _sim_cpu struct. */
26
27struct _sim_cpu {
28 /* sim/common cpu base. */
29 sim_cpu_base base;
30
31 /* Static parts of cgen. */
32 CGEN_CPU cgen_cpu;
33
34 /* CPU specific parts go here.
35 Note that in files that don't need to access these pieces WANT_CPU_FOO
36 won't be defined and thus these parts won't appear. This is ok in the
37 sense that things work. It is a source of bugs though.
38 One has to of course be careful to not take the size of this
39 struct and no structure members accessed in non-cpu specific files can
40 go after here. Oh for a better language. */
41#if defined (WANT_CPU_IQ2000BF)
42 IQ2000BF_CPU_DATA cpu_data;
43#endif
44};
45\f
46/* The sim_state struct. */
47
48struct sim_state {
f95f4ed2 49 sim_cpu *cpu[MAX_NR_PROCESSORS];
edece237
CV
50
51 CGEN_STATE cgen_state;
52
53 sim_state_base base;
54};
55\f
56/* Misc. */
57
58/* Catch address exceptions. */
59extern SIM_CORE_SIGNAL_FN iq2000_core_signal;
60#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
61iq2000_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
62 (TRANSFER), (ERROR))
63
64/* Convert between CPU-internal addresses and sim_core addresses. */
65#define CPU2DATA(addr) (IQ2000_DATA_VALUE + (addr))
66#define DATA2CPU(addr) ((addr) - IQ2000_DATA_VALUE)
67#define CPU2INSN(addr) (IQ2000_INSN_VALUE + ((addr) & ~IQ2000_INSN_MASK))
68#define INSN2CPU(addr) ((addr) - IQ2000_INSN_VALUE)
69#define IQ2000_INSN_MEM_SIZE (CPU2INSN(0x800000) - CPU2INSN(0x0000))
70#define IQ2000_DATA_MEM_SIZE (CPU2DATA(0x800000) - CPU2DATA(0x0000))
71
72#endif /* SIM_MAIN_H */