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

Subversion Repositories igor

[/] [igor/] [trunk/] [simulator/] [profiler.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 atypic
#ifndef _PROFILER_H_
2
#define _PROFILER_H_
3
#include "instructions.h"
4
 
5
 
6
#define PREDICT_TAKEN_1 0
7
#define PREDICT_TAKEN_2 1
8
#define PREDICT_NOT_TAKEN_1 2
9
#define PREDICT_NOT_TAKEN_2 3
10
 
11
//Yes, yes-- it IS in libc... just expose it already. 
12
char* strdup(const char* lol);
13
 
14
 
15
typedef struct {
16
        char* type;
17
        unsigned int* storage;
18
        unsigned int size;
19
        unsigned int hits;
20
        unsigned int misses;
21
} cache_t;
22
 
23
 
24
typedef struct {
25
        int initialized;
26
 
27
        char* name;
28
        unsigned long long* instruction_execs;
29
 
30
        unsigned int mp_size;
31
        unsigned long long total_execs;
32
        unsigned long long num_per_type[NUM_INSTRUCTIONS];
33
        unsigned int* instruction_cost;
34
 
35
        unsigned int memory_size;
36
        unsigned long long* memory_access;
37
 
38
        unsigned long long br_predict;
39
        unsigned long long br_mispredict;
40
 
41
        unsigned int branch_buffer_size;
42
        unsigned short* branch_buffer;
43
        char* branch_pred_scheme;
44
 
45
        cache_t* cache;
46
 
47
        int profile;
48
        int* reuse;
49
        int* reuse_sum;
50
} profile_t;
51
 
52
 
53
void profiler_init(int microcode_size, int cache_size);
54
void profiler_add_execution(unsigned int addr, instr_t instr, int flags);
55
void profiler_dump_program(char* filename);
56
void profiler_new();
57
 
58
/* Simulation framework */
59
void sim_init(char* name, int microprogram_size, int cache_size, unsigned int mem_size, unsigned int branch_buffer_size, char * branch_pred_scheme);
60
void sim_write_file(profile_t* p, const char* filename);
61
void sim_write_cache_info(profile_t* p, FILE* f);
62
void sim_write_reuse_info(profile_t* p, FILE* f);
63
void sim_write_mc_info(profile_t* p, FILE* f);
64
void sim_write_instr_counts(profile_t* p, FILE* f);
65
void sim_write_global_info(profile_t* p, FILE* f);
66
void sim_write_mem_count(profile_t* p, FILE* f);
67
void sim_write_branch_counts(profile_t * p, FILE * f);
68
 
69
void cache_load(cache_t* c, unsigned int addr);
70
void cache_init(cache_t* c,  int size);
71
void reuse_update(profile_t* p, unsigned int addr);
72
#endif

powered by: WebSVN 2.1.0

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