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

Last change on this file since 128 was 128, checked in by rosiere, 15 years ago

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1/*
2 * $Id: Branch_Target_Buffer_deallocation.cpp 128 2009-06-26 08:43:23Z 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#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace branch_target_buffer {
18
19
20#undef  FUNCTION
21#define FUNCTION "Branch_Target_Buffer::deallocation"
22  void Branch_Target_Buffer::deallocation (void)
23  {
24    log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"Begin");
25
26    if (usage_is_set(_usage,USE_SYSTEMC))
27      {
28        delete    in_CLOCK ;
29        delete    in_NRESET;
30
31        DELETE1_SIGNAL( in_PREDICT_VAL           ,_param->_nb_inst_predict,1);
32        DELETE1_SIGNAL(out_PREDICT_ACK           ,_param->_nb_inst_predict,1);
33        DELETE1_SIGNAL( in_PREDICT_CONTEXT_ID    ,_param->_nb_inst_predict,_param->_size_context_id);
34        DELETE1_SIGNAL( in_PREDICT_ADDRESS       ,_param->_nb_inst_predict,_param->_size_instruction_address);
35        DELETE1_SIGNAL(out_PREDICT_HIT           ,_param->_nb_inst_predict,1);
36        DELETE1_SIGNAL(out_PREDICT_ADDRESS_SRC   ,_param->_nb_inst_predict,_param->_size_instruction_address);
37        DELETE1_SIGNAL(out_PREDICT_ADDRESS_DEST  ,_param->_nb_inst_predict,_param->_size_instruction_address);
38        DELETE1_SIGNAL(out_PREDICT_CONDITION     ,_param->_nb_inst_predict,_param->_size_branch_condition);
39        DELETE1_SIGNAL(out_PREDICT_LAST_TAKE     ,_param->_nb_inst_predict,1);
40        DELETE1_SIGNAL(out_PREDICT_IS_ACCURATE   ,_param->_nb_inst_predict,1);
41
42        DELETE1_SIGNAL( in_DECOD_VAL             ,_param->_nb_inst_decod,1);
43        DELETE1_SIGNAL(out_DECOD_ACK             ,_param->_nb_inst_decod,1);
44        DELETE1_SIGNAL( in_DECOD_CONTEXT_ID      ,_param->_nb_inst_decod,_param->_size_context_id);
45        DELETE1_SIGNAL( in_DECOD_ADDRESS_SRC     ,_param->_nb_inst_decod,_param->_size_instruction_address);
46        DELETE1_SIGNAL( in_DECOD_ADDRESS_DEST    ,_param->_nb_inst_decod,_param->_size_instruction_address);
47        DELETE1_SIGNAL( in_DECOD_CONDITION       ,_param->_nb_inst_decod,_param->_size_branch_condition);
48        DELETE1_SIGNAL( in_DECOD_LAST_TAKE       ,_param->_nb_inst_decod,1);
49        DELETE1_SIGNAL( in_DECOD_MISS_PREDICTION ,_param->_nb_inst_decod,1);
50        DELETE1_SIGNAL( in_DECOD_IS_ACCURATE     ,_param->_nb_inst_decod,1);
51
52        DELETE1_SIGNAL( in_UPDATE_VAL            ,_param->_nb_inst_update,1);
53        DELETE1_SIGNAL(out_UPDATE_ACK            ,_param->_nb_inst_update,1);
54        DELETE1_SIGNAL( in_UPDATE_CONTEXT_ID     ,_param->_nb_inst_update,_param->_size_context_id);
55        DELETE1_SIGNAL( in_UPDATE_ADDRESS_SRC    ,_param->_nb_inst_update,_param->_size_instruction_address);
56        DELETE1_SIGNAL( in_UPDATE_ADDRESS_DEST   ,_param->_nb_inst_update,_param->_size_instruction_address);
57        DELETE1_SIGNAL( in_UPDATE_CONDITION      ,_param->_nb_inst_update,_param->_size_branch_condition);
58        DELETE1_SIGNAL( in_UPDATE_LAST_TAKE      ,_param->_nb_inst_update,1);
59        DELETE1_SIGNAL( in_UPDATE_MISS_PREDICTION,_param->_nb_inst_update,1);
60      }
61    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
62
63    if (_param->_have_component_victim)
64      {
65        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
66        delete    _component_sort [i];
67        delete [] _component_sort;
68        delete    _component_victim;
69      }
70    delete _component_branch_target_buffer_glue;
71    delete _component_branch_target_buffer_register;
72   
73    delete _component;
74
75    log_printf(FUNC,Branch_Target_Buffer,FUNCTION,"End");
76  };
77
78}; // end namespace branch_target_buffer
79}; // end namespace prediction_unit
80}; // end namespace front_end
81}; // end namespace multi_front_end
82}; // end namespace core
83
84}; // end namespace behavioural
85}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.