source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/src/Branch_Target_Buffer.cpp

Last change on this file was 138, checked in by rosiere, 14 years ago

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1/*
2 * $Id: Branch_Target_Buffer.cpp 138 2010-05-12 17:34:01Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/include/Branch_Target_Buffer.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace prediction_unit {
16namespace branch_target_buffer {
17
18
19#undef  FUNCTION
20#define FUNCTION "Branch_Target_Buffer::Branch_Target_Buffer"
21  Branch_Target_Buffer::Branch_Target_Buffer
22  (
23#ifdef SYSTEMC
24   sc_module_name name,
25#else
26   string name,
27#endif
28#ifdef STATISTICS
29   morpheo::behavioural::Parameters_Statistics * param_statistics,
30#endif
31   morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"Begin");
39
40    log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Allocation");
41
42// #if DEBUG_Branch_Target_Buffer == true
43//     log_printf(INFO,Branch_Target_Buffer,FUNCTION,_("<%s> Parameters"),_name.c_str());
44
45//     std::cout << *param << std::endl;
46// #endif   
47
48    allocation (
49#ifdef STATISTICS
50                param_statistics
51#endif
52                );
53
54#ifdef STATISTICS
55    if (usage_is_set(_usage,USE_STATISTICS))
56      { 
57        log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Allocation of statistics");
58
59        statistics_allocation(param_statistics);
60      }
61#endif
62
63#ifdef VHDL
64    if (usage_is_set(_usage,USE_VHDL))
65      {
66        // generate the vhdl
67        log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Generate the vhdl");
68       
69        vhdl();
70      }
71#endif
72
73#if defined(SYSTEMC) and (defined(STATISTICS) or defined(VHDL_TESTBENCH))
74    if (usage_is_set(_usage,USE_SYSTEMC))
75      {
76        log_printf(INFO,Branch_Target_Buffer,FUNCTION,_("Method - transition"));
77
78        SC_METHOD (transition);
79        dont_initialize ();
80        sensitive << (*(in_CLOCK)).pos();
81       
82# ifdef SYSTEMCASS_SPECIFIC
83        // List dependency information
84# endif   
85      }
86#endif
87    log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"End");
88  };
89   
90#undef  FUNCTION
91#define FUNCTION "Branch_Target_Buffer::~Branch_Target_Buffer"
92  Branch_Target_Buffer::~Branch_Target_Buffer (void)
93  {
94    log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"Begin");
95
96#ifdef STATISTICS
97    if (usage_is_set(_usage,USE_STATISTICS))
98      {
99        statistics_deallocation();
100      }
101#endif
102
103    log_printf(INFO,Branch_Target_Buffer,FUNCTION,"Deallocation");
104    deallocation ();
105
106    log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"End");
107  };
108
109}; // end namespace branch_target_buffer
110}; // end namespace prediction_unit
111}; // end namespace front_end
112}; // end namespace multi_front_end
113}; // end namespace core
114
115}; // end namespace behavioural
116}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.