1178825Sdfr/* This file is part of the program psim. 2233294Sstas 3233294Sstas Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au> 4233294Sstas 5178825Sdfr This program is free software; you can redistribute it and/or modify 6233294Sstas it under the terms of the GNU General Public License as published by 7233294Sstas the Free Software Foundation; either version 3 of the License, or 8233294Sstas (at your option) any later version. 9178825Sdfr 10233294Sstas This program is distributed in the hope that it will be useful, 11233294Sstas but WITHOUT ANY WARRANTY; without even the implied warranty of 12178825Sdfr MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13233294Sstas GNU General Public License for more details. 14233294Sstas 15233294Sstas You should have received a copy of the GNU General Public License 16178825Sdfr along with this program; if not, see <http://www.gnu.org/licenses/>. 17233294Sstas 18233294Sstas */ 19233294Sstas 20178825Sdfr 21233294Sstas#ifndef _MON_H_ 22233294Sstas#define _MON_H_ 23233294Sstas 24233294Sstas#include "basics.h" 25233294Sstas#include "itable.h" 26233294Sstas 27233294Sstas/* monitor/logger: counts what the simulation is up to */ 28233294Sstas 29233294Sstastypedef unsigned long count_type; 30233294Sstas 31233294Sstas/* Interfact to model to return model specific information */ 32178825Sdfrtypedef struct _model_print model_print; 33178825Sdfrstruct _model_print { 34233294Sstas model_print *next; 35178825Sdfr const char *name; 36233294Sstas const char *suffix_singular; 37233294Sstas const char *suffix_plural; 38178825Sdfr count_type count; 39178825Sdfr}; 40178825Sdfr 41178825Sdfr/* Additional events to monitor */ 42178825Sdfrtypedef enum _mon_events { 43178825Sdfr mon_event_icache_miss, 44178825Sdfr nr_mon_events 45178825Sdfr} mon_events; 46178825Sdfr 47178825Sdfrtypedef struct _mon mon; 48178825Sdfrtypedef struct _cpu_mon cpu_mon; 49178825Sdfr 50178825SdfrINLINE_MON\ 51(mon *) mon_create 52(void); 53 54INLINE_MON\ 55(cpu_mon *) mon_cpu 56(mon *monitor, 57 int cpu_nr); 58 59INLINE_MON\ 60(void) mon_init 61(mon *monitor, 62 int nr_cpus); 63 64INLINE_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 74INLINE_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 82INLINE_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 90INLINE_MON\ 91(void) mon_event 92(mon_events event, 93 cpu *processor, 94 unsigned_word cia); 95 96INLINE_MON\ 97(unsigned) mon_get_number_of_insns 98(mon *monitor, 99 int cpu_nr); 100 101INLINE_MON\ 102(void) mon_print_info 103(psim *system, 104 mon *monitor, 105 int verbose); 106 107#endif 108