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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [common/] [stats.h] - Blame information for rev 34

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

Line No. Rev Author Line
1 2 cvs
/* stats.h -- Header file for stats.c
2
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
3
 
4
This file is part of OpenRISC 1000 Architectural Simulator.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20
#define DSTATS_LEN      3000
21
#define SSTATS_LEN      300
22
#define FSTATS_LEN      200
23 6 lampret
#define RAW_RANGE       13
24 2 cvs
 
25 30 lampret
/* Used by safe division - increment divisor by one if it is zero */
26
#define SD(X) (X != 0 ? X : 1)
27
 
28 2 cvs
struct dstats_entry {
29
        char insn1[OPERANDNAME_LEN];
30
        char insn2[OPERANDNAME_LEN];
31
        int  cnt_dynamic;
32
        int  depend;
33
};
34
 
35
struct sstats_entry {
36
        char insn[OPERANDNAME_LEN];
37
        int  cnt_static;
38
        int  cnt_dynamic;
39
};      /* single stats */
40
 
41
struct fstats_entry {
42
        enum insn_type insn1;
43
        enum insn_type insn2;
44
        int  cnt_dynamic;
45
        int  depend;
46
};      /* functional units stats */
47
 
48
struct branchstat {
49
        int taken;
50
        int nottaken;
51 24 lampret
        int forward;
52
        int backward;
53 2 cvs
};
54
 
55 24 lampret
struct staticbp_stat {
56
        int correct;
57
        int all;
58
};
59
 
60 2 cvs
struct bpbstat {
61
        int hit;
62
        int miss;
63
        int correct;
64
        int incorrect;
65
};
66
 
67
struct bticstat {
68
        int hit;
69
        int miss;
70
};
71
 
72
struct mstats_entry {
73
        int  byteadd;
74
        struct branchstat beqz;
75
        struct branchstat bnez;
76 24 lampret
        struct staticbp_stat sbp_bf;
77
        struct staticbp_stat sbp_bnf;
78 2 cvs
        struct bpbstat bpb;
79
        struct bticstat btic;
80
};      /* misc units stats */
81
 
82 6 lampret
struct cachestats_entry {
83
        int readhit;
84
        int readmiss;
85
        int writehit;
86
        int writemiss;
87
};      /* cache stats */
88
 
89
struct raw_stats {
90
        int reg[64];
91
        int range[RAW_RANGE];
92
};      /* RAW hazard stats */
93
 
94 34 lampret
#define SLP_MEMREAD 0
95
#define SLP_MEMWRITE 1
96
struct slp_stats {
97
        int maxdepth;
98
        int curdepth;
99
        int calls;
100
        int supercalls;
101
        int supercnt;
102
        struct memaccess {
103
                struct memaccess *next;
104
                unsigned long addr;
105
                char type;      /* bit 0: read; bit 1: write */
106
        };
107
};      /* SLP */
108
 
109 2 cvs
extern struct mstats_entry mstats;
110
extern struct sstats_entry sstats[SSTATS_LEN];
111
extern struct dstats_entry dstats[DSTATS_LEN];
112
extern struct fstats_entry fstats[FSTATS_LEN];
113 6 lampret
extern struct cachestats_entry ic_stats;
114
extern struct cachestats_entry dc_stats;
115
extern struct raw_stats raw_stats;
116 34 lampret
extern struct slp_stats slp_stats;
117 2 cvs
 
118
extern int check_depend();
119
extern void addsstats(char *item, int cnt_dynamic, int cnt_static);
120
extern void adddstats(char *item1, char *item2, int cnt_dynamic, int depend);
121
extern void addfstats(enum insn_type item1, enum insn_type item2, int cnt_dynamic, int depend);
122
extern void initstats();
123
extern void printstats();

powered by: WebSVN 2.1.0

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