source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp @ 42

Last change on this file since 42 was 42, checked in by rosiere, 17 years ago

Modification des classes d'encapsulation des interfaces :

  • gère les signaux à écrire dans le vhdl
  • les traces pour le testbench
  • la génération des vhdl structurelles

-> test sur la Pattern History Table

File size: 2.4 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace stage_1_ifetch {
13namespace predictor {
14namespace meta_predictor {
15namespace two_level_branch_predictor {
16namespace pattern_history_table {
17
18
19#ifdef SYSTEMC
20  Pattern_History_Table::Pattern_History_Table (sc_module_name name,
21#else
22  Pattern_History_Table::Pattern_History_Table (string name,
23#endif
24#ifdef STATISTICS
25                              morpheo::behavioural::Parameters_Statistics             param_statistics,
26#endif
27                              morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters param ):
28                              _name              (name)
29                              ,_param            (param)
30#ifdef STATISTICS
31                              ,_param_statistics (param_statistics)
32#endif
33  {
34    log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","Begin");
35   
36#ifdef SYSTEMC
37    allocation ();
38#endif
39 
40#ifdef STATISTICS
41    // Allocation of statistics
42    _stat = new Statistics (static_cast<string>(_name),
43                            param_statistics          ,
44                            param);
45#endif
46
47#ifdef VHDL
48    // generate the vhdl
49    vhdl();
50#endif
51
52#ifdef SYSTEMC
53//     // Constant
54//     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
55//       PORT_WRITE(out_PREDICT_ACK         [i],1);
56//     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
57//       PORT_WRITE(out_BRANCH_COMPLETE_ACK [i],1);
58
59#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
60    SC_METHOD (transition);
61    dont_initialize ();
62    sensitive_pos << *(in_CLOCK);
63#endif
64
65#ifdef SYSTEMCASS_SPECIFIC
66    // List dependency information
67#endif   
68
69#endif
70    log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","End");
71  };
72 
73  Pattern_History_Table::~Pattern_History_Table (void)
74  {
75    log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","Begin");
76
77#ifdef STATISTICS
78    _stat->generate_file(statistics(0));
79   
80    delete _stat;
81#endif
82
83#ifdef SYSTEMC
84    deallocation ();
85#endif
86
87    log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","End");
88  };
89
90}; // end namespace pattern_history_table
91}; // end namespace two_level_branch_predictor
92}; // end namespace meta_predictor
93}; // end namespace predictor
94}; // end namespace stage_1_ifetch
95
96}; // end namespace behavioural
97}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.