1 /* This file defines the interface between the d10v simulator and gdb.
3 Copyright 1999, 2002, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #if !defined (SIM_D10V_H)
27 /* GDB interprets addresses as:
29 0x00xxxxxx: Physical unified memory segment (Unified memory)
30 0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
31 0x02xxxxxx: Physical data memory segment (On-chip data memory)
32 0x10xxxxxx: Logical data address segment (DMAP translated memory)
33 0x11xxxxxx: Logical instruction address segment (IMAP translated memory)
35 The remote d10v board interprets addresses as:
37 0x00xxxxxx: Physical unified memory segment (Unified memory)
38 0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
39 0x02xxxxxx: Physical data memory segment (On-chip data memory)
41 The following translate a virtual DMAP/IMAP offset into a physical
42 memory segment assigning the translated address to PHYS. Since a
43 memory access may cross a page boundrary the number of bytes for
44 which the translation is applicable (or 0 for an invalid virtual
45 offset) is returned. */
49 SIM_D10V_MEMORY_UNIFIED
= 0x00000000,
50 SIM_D10V_MEMORY_INSN
= 0x01000000,
51 SIM_D10V_MEMORY_DATA
= 0x02000000,
52 SIM_D10V_MEMORY_DMAP
= 0x10000000,
53 SIM_D10V_MEMORY_IMAP
= 0x11000000
56 extern unsigned long sim_d10v_translate_dmap_addr
57 (unsigned long offset
,
61 unsigned long (*dmap_register
) (void *regcache
, int reg_nr
));
63 extern unsigned long sim_d10v_translate_imap_addr
64 (unsigned long offset
,
68 unsigned long (*imap_register
) (void *regcache
, int reg_nr
));
70 extern unsigned long sim_d10v_translate_addr
75 unsigned long (*dmap_register
) (void *regcache
, int reg_nr
),
76 unsigned long (*imap_register
) (void *regcache
, int reg_nr
));
79 /* The simulator makes use of the following register information. */
109 SIM_D10V_CR10_REGNUM
,
110 SIM_D10V_CR11_REGNUM
,
111 SIM_D10V_CR12_REGNUM
,
112 SIM_D10V_CR13_REGNUM
,
113 SIM_D10V_CR14_REGNUM
,
114 SIM_D10V_CR15_REGNUM
,
119 SIM_D10V_IMAP0_REGNUM
,
120 SIM_D10V_IMAP1_REGNUM
,
121 SIM_D10V_DMAP0_REGNUM
,
122 SIM_D10V_DMAP1_REGNUM
,
123 SIM_D10V_DMAP2_REGNUM
,
124 SIM_D10V_DMAP3_REGNUM
,
125 SIM_D10V_TS2_DMAP_REGNUM
130 SIM_D10V_NR_R_REGS
= 16,
131 SIM_D10V_NR_A_REGS
= 2,
132 SIM_D10V_NR_IMAP_REGS
= 2,
133 SIM_D10V_NR_DMAP_REGS
= 4,
134 SIM_D10V_NR_CR_REGS
= 16