source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_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.1 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace stage_1_ifetch {
13namespace predictor {
14namespace meta_predictor {
15namespace two_level_branch_predictor {
16namespace branch_history_table {
17
18
19#ifdef SYSTEMC
20  Branch_History_Table::Branch_History_Table (sc_module_name name,
21#else
22  Branch_History_Table::Branch_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::branch_history_table::Parameters param ):
28                                               _name             (name)
29                                              ,_param            (param)
30#ifdef STATISTICS
31                                              ,_param_statistics (param_statistics)
32#endif
33  {
34
35#ifdef SYSTEMC
36    allocation ();
37#endif
38
39#ifdef STATISTICS
40    // Allocation of statistics
41    _stat = new Statistics (static_cast<string>(_name),
42                            param_statistics          ,
43                            param);
44#endif
45
46#ifdef VHDL
47    // generate the vhdl
48    vhdl();
49#endif
50
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  };
71 
72  Branch_History_Table::~Branch_History_Table (void)
73  {
74#ifdef STATISTICS
75
76    _stat->generate_file(statistics(0));
77
78    delete _stat;
79#endif
80
81#ifdef SYSTEMC
82    deallocation ();
83#endif
84  };
85
86}; // end namespace branch_history_table
87}; // end namespace two_level_branch_predictor
88}; // end namespace meta_predictor
89}; // end namespace predictor
90}; // end namespace stage_1_ifetch
91
92}; // end namespace behavioural
93}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.