TIc80 simulator checkpoint - runs 3 instructions - trap, addu, br.a.
[deliverable/binutils-gdb.git] / sim / tic80 / sim-main.h
1 /* This file is part of the program psim.
2
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
4 Copyright (C) 1997, Free Software Foundation
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 */
21
22
23 #ifndef _SIM_MAIN_H_
24 #define _SIM_MAIN_H_
25
26 #include "sim-basics.h"
27 #include "sim-inline.h"
28 #include "sim-types.h"
29 #include "sim-bits.h"
30 #include "sim-endian.h"
31
32 /* These are generated files. */
33 #include "itable.h"
34 #include "idecode.h"
35 #include "idecode.h"
36
37 #include "cpu.h"
38 #include "alu.h"
39
40 #include "sim-core.h"
41 #include "sim-events.h"
42 #include "sim-io.h"
43
44
45 struct sim_state {
46
47 /* real time */
48 sim_events events;
49
50 /* memory and IO */
51 sim_core core;
52
53 /* escape route for inner functions */
54 int halt_ok;
55 jmp_buf path_to_halt;
56 int restart_ok;
57 jmp_buf path_to_restart;
58
59 /* status from last halt */
60 enum sim_stop reason;
61 int siggnal;
62
63 /* the processors proper */
64 sim_cpu cpu;
65 #define STATE_CPU(sd, n) (&(sd)->cpu)
66
67 /* The base class. */
68 sim_state_base base;
69
70 };
71
72 /* (re) initialize the simulator */
73
74 extern void engine_init
75 (SIM_DESC sd);
76
77
78 /* Mechanisms for stopping/restarting the simulation */
79
80 extern void engine_error
81 (SIM_DESC sd,
82 instruction_address cia,
83 const char *fmt,
84 ...);
85
86 extern void engine_halt
87 (SIM_DESC sd,
88 instruction_address cia,
89 enum sim_stop reason,
90 int siggnal);
91
92 extern void engine_restart
93 (SIM_DESC sd,
94 instruction_address cia);
95
96
97
98
99 /* SIMULATE INSTRUCTIONS, various different ways of achieving the same
100 thing (others later) */
101
102 extern void engine_run_until_stop
103 (SIM_DESC sd,
104 volatile int *keep_running);
105
106
107 #endif
This page took 0.049732 seconds and 5 git commands to generate.