OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [cpu/] [common/] [stats.h] - Blame information for rev 275

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 jeremybenn
/* stats.h -- Header file for stats.c
2
 
3
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
4
   Copyright (C) 2008 Embecosm Limited
5
 
6
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7
 
8
   This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
9
 
10
   This program is free software; you can redistribute it and/or modify it
11
   under the terms of the GNU General Public License as published by the Free
12
   Software Foundation; either version 3 of the License, or (at your option)
13
   any later version.
14
 
15
   This program is distributed in the hope that it will be useful, but WITHOUT
16
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
   more details.
19
 
20
   You should have received a copy of the GNU General Public License along
21
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
22
 
23
/* This program is commented throughout in a fashion suitable for processing
24
   with Doxygen. */
25
 
26
 
27
#ifndef STATS__H
28
#define STATS__H
29
 
30
/* Package includes */
31
#include "opcode/or32.h"
32
 
33
#define RAW_RANGE  1000
34
 
35
struct bpbstat
36
{
37
  int hit;
38
  int miss;
39
  int correct;
40
  int incorrect;
41
};
42
 
43
struct bticstat
44
{
45
  int hit;
46
  int miss;
47
};
48
 
49
struct mstats_entry
50
{
51
  int byteadd;
52
  int bf[2][2];                 /* [taken][fwd/bwd] */
53
  int bnf[2][2];                /* [taken][fwd/bwd] */
54
  struct bpbstat bpb;
55
  struct bticstat btic;
56
};                              /*!< misc units stats */
57
 
58
struct cachestats_entry
59
{
60
  int readhit;
61
  int readmiss;
62
  int writehit;
63
  int writemiss;
64
};                              /*!< cache stats */
65
 
66
struct immustats_entry
67
{
68
  int fetch_tlbhit;
69
  int fetch_tlbmiss;
70
  int fetch_pagefaults;
71
};                              /*!< IMMU stats */
72
 
73
struct dmmustats_entry
74
{
75
  int loads_tlbhit;
76
  int loads_tlbmiss;
77
  int loads_pagefaults;
78
  int stores_tlbhit;
79
  int stores_tlbmiss;
80
  int stores_pagefaults;
81
};                              /*!< DMMU stats */
82
 
83
struct raw_stats
84
{
85
  int reg[64];
86
  int range[RAW_RANGE];
87
};                              /*!< RAW hazard stats */
88
 
89
/* Globally visible data structures */
90
extern struct mstats_entry      or1k_mstats;
91
extern struct cachestats_entry  ic_stats;
92
extern struct cachestats_entry  dc_stats;
93
extern struct immustats_entry   immu_stats;
94
extern struct dmmustats_entry   dmmu_stats;
95
extern struct raw_stats         raw_stats;
96
 
97
/* Function prototypes for external use */
98
extern void addsstats (int item, int cnt_dynamic);
99
extern void adddstats (int item1, int item2, int cnt_dynamic, int depend);
100
extern void addfstats (enum insn_type item1, enum insn_type item2,
101
                       int cnt_dynamic, int depend);
102
extern void initstats ();
103
extern void printstats ();
104
 
105
#endif  /*  STATS__H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.