Home | History | Annotate | Line # | Download | only in lm32
      1   1.1  christos /* Lattice Mico32 simulator support code
      2   1.1  christos    Contributed by Jon Beniston <jon (at) beniston.com>
      3   1.1  christos 
      4  1.11  christos    Copyright (C) 2009-2024 Free Software Foundation, Inc.
      5   1.1  christos 
      6   1.1  christos    This file is part of GDB.
      7   1.1  christos 
      8   1.1  christos    This program is free software; you can redistribute it and/or modify
      9   1.1  christos    it under the terms of the GNU General Public License as published by
     10   1.1  christos    the Free Software Foundation; either version 3 of the License, or
     11   1.1  christos    (at your option) any later version.
     12   1.1  christos 
     13   1.1  christos    This program is distributed in the hope that it will be useful,
     14   1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     15   1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16   1.1  christos    GNU General Public License for more details.
     17   1.1  christos 
     18   1.1  christos    You should have received a copy of the GNU General Public License
     19   1.1  christos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     20   1.1  christos 
     21   1.1  christos /* Main header for the LM32 simulator.  */
     22   1.1  christos 
     23   1.1  christos #ifndef SIM_MAIN_H
     24   1.1  christos #define SIM_MAIN_H
     25   1.1  christos 
     26   1.6  christos #define WITH_SCACHE_PBB 1
     27   1.6  christos 
     28   1.1  christos #include "sim-basics.h"
     29  1.11  christos #include "opcodes/lm32-desc.h"
     30  1.11  christos #include "opcodes/lm32-opc.h"
     31   1.1  christos #include "arch.h"
     32   1.1  christos #include "sim-base.h"
     33   1.1  christos #include "cgen-sim.h"
     34   1.1  christos #include "lm32-sim.h"
     35   1.1  christos 
     36  1.11  christos struct lm32_sim_cpu
     38   1.1  christos {
     39   1.1  christos   /* CPU specific parts go here.
     40   1.1  christos      Note that in files that don't need to access these pieces WANT_CPU_FOO
     41   1.1  christos      won't be defined and thus these parts won't appear.  This is ok in the
     42   1.1  christos      sense that things work.  It is a source of bugs though.
     43   1.1  christos      One has to of course be careful to not take the size of this
     44   1.1  christos      struct and no structure members accessed in non-cpu specific files can
     45   1.1  christos      go after here.  Oh for a better language.  */
     46   1.1  christos #if defined (WANT_CPU_LM32BF)
     47   1.1  christos   LM32BF_CPU_DATA cpu_data;
     48   1.1  christos #endif
     49  1.11  christos };
     50   1.1  christos #define LM32_SIM_CPU(cpu) ((struct lm32_sim_cpu *) CPU_ARCH_DATA (cpu))
     51   1.1  christos 
     52   1.1  christos /* Misc.  */
     54  1.11  christos 
     55   1.1  christos /* Catch address exceptions.  */
     56   1.1  christos extern SIM_CORE_SIGNAL_FN lm32_core_signal ATTRIBUTE_NORETURN;
     57   1.1  christos #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
     58   1.1  christos lm32_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
     59  1.11  christos 		  (TRANSFER), (ERROR))
     60  1.11  christos 
     61  1.11  christos /* From traps.c.  */
     62  1.11  christos extern USI lm32bf_b_insn (SIM_CPU * current_cpu, USI r0, USI f_r0);
     63  1.11  christos extern USI lm32bf_divu_insn (SIM_CPU * current_cpu, IADDR pc, USI r0, USI r1, USI r2);
     64  1.11  christos extern USI lm32bf_modu_insn (SIM_CPU * current_cpu, IADDR pc, USI r0, USI r1, USI r2);
     65  1.11  christos extern void lm32bf_wcsr_insn (SIM_CPU * current_cpu, USI f_csr, USI r1);
     66  1.11  christos extern USI lm32bf_break_insn (SIM_CPU * current_cpu, IADDR pc);
     67  1.11  christos extern USI lm32bf_scall_insn (SIM_CPU * current_cpu, IADDR pc);
     68  1.11  christos 
     69  1.11  christos /* From user.c.  */
     70   1.1  christos extern UINT lm32bf_user_insn (SIM_CPU * current_cpu, INT r0, INT r1, UINT imm);
     71                 
     72                 #endif /* SIM_MAIN_H */
     73