mon.h 2.2 KB

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