Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* This file is part of the program psim. |
2 | ||
3 | Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au> | |
4 | ||
5 | This program is free software; you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
3fd725ef | 7 | the Free Software Foundation; either version 3 of the License, or |
c906108c SS |
8 | (at your option) any later version. |
9 | ||
10 | This program is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
51b318de | 16 | along with this program; if not, see <http://www.gnu.org/licenses/>. |
c906108c SS |
17 | |
18 | */ | |
19 | ||
20 | ||
21 | #ifndef _MON_H_ | |
22 | #define _MON_H_ | |
23 | ||
24 | #include "basics.h" | |
25 | #include "itable.h" | |
26 | ||
27 | /* monitor/logger: counts what the simulation is up to */ | |
28 | ||
29 | typedef unsigned long count_type; | |
30 | ||
31 | /* Interfact to model to return model specific information */ | |
32 | typedef struct _model_print model_print; | |
33 | struct _model_print { | |
34 | model_print *next; | |
35 | const char *name; | |
36 | const char *suffix_singular; | |
37 | const char *suffix_plural; | |
38 | count_type count; | |
39 | }; | |
40 | ||
41 | /* Additional events to monitor */ | |
42 | typedef enum _mon_events { | |
43 | mon_event_icache_miss, | |
44 | nr_mon_events | |
45 | } mon_events; | |
46 | ||
47 | typedef struct _mon mon; | |
48 | typedef struct _cpu_mon cpu_mon; | |
49 | ||
50 | INLINE_MON\ | |
51 | (mon *) mon_create | |
52 | (void); | |
53 | ||
54 | INLINE_MON\ | |
55 | (cpu_mon *) mon_cpu | |
56 | (mon *monitor, | |
57 | int cpu_nr); | |
58 | ||
59 | INLINE_MON\ | |
60 | (void) mon_init | |
61 | (mon *monitor, | |
62 | int nr_cpus); | |
63 | ||
64 | INLINE_MON\ | |
65 | (void) mon_issue | |
66 | (itable_index index, | |
67 | cpu *processor, | |
68 | unsigned_word cia); | |
69 | ||
70 | /* NOTE - there is no mon_iload - it is made reduntant by mon_issue() | |
71 | and besides when the cpu's have their own cache, the information is | |
72 | wrong */ | |
73 | ||
74 | INLINE_MON\ | |
75 | (void) mon_read | |
76 | (unsigned_word ea, | |
77 | unsigned_word ra, | |
78 | unsigned nr_bytes, | |
79 | cpu *processor, | |
80 | unsigned_word cia); | |
81 | ||
82 | INLINE_MON\ | |
83 | (void) mon_write | |
84 | (unsigned_word ea, | |
85 | unsigned_word ra, | |
86 | unsigned nr_bytes, | |
87 | cpu *processor, | |
88 | unsigned_word cia); | |
89 | ||
90 | INLINE_MON\ | |
91 | (void) mon_event | |
92 | (mon_events event, | |
93 | cpu *processor, | |
94 | unsigned_word cia); | |
95 | ||
96 | INLINE_MON\ | |
97 | (unsigned) mon_get_number_of_insns | |
98 | (mon *monitor, | |
99 | int cpu_nr); | |
100 | ||
101 | INLINE_MON\ | |
102 | (void) mon_print_info | |
103 | (psim *system, | |
104 | mon *monitor, | |
105 | int verbose); | |
106 | ||
107 | #endif |