/*
 * $Id: Register_unit_Glue_deallocation.cpp 112 2009-03-18 22:36:26Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h"
#include "Behavioural/include/Allocation.h"

namespace morpheo                    {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace register_unit {
namespace register_unit_glue {


#undef  FUNCTION
#define FUNCTION "Register_unit_Glue::deallocation"
  void Register_unit_Glue::deallocation (void)
  {
    log_printf(FUNC,Register_unit_Glue,FUNCTION,"Begin");

    if (usage_is_set(_usage,USE_VHDL))
      {
//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    delete  in_CLOCK ;
//#endif
    delete  in_NRESET;
    delete out_CONST_0;
    delete out_CONST_1;

    DELETE1_SIGNAL( in_GPR_READ_VAL           ,_param->_nb_gpr_read,1  );
    DELETE1_SIGNAL(out_GPR_READ_ACK           ,_param->_nb_gpr_read,1  );
    DELETE1_SIGNAL( in_GPR_READ_OOO_ENGINE_ID ,_param->_nb_gpr_read,_param->_size_ooo_engine_id);
    DELETE1_SIGNAL(out_GPR_READ_DATA          ,_param->_nb_gpr_read,_param->_size_general_data);
    DELETE1_SIGNAL(out_GPR_READ_DATA_VAL      ,_param->_nb_gpr_read,1);
    
    DELETE2_SIGNAL(out_GPR_READ_REGISTERFILE_VAL ,_param->_nb_ooo_engine,_param->_nb_gpr_read,1  );
    DELETE2_SIGNAL( in_GPR_READ_REGISTERFILE_ACK ,_param->_nb_ooo_engine,_param->_nb_gpr_read,1  );
    DELETE2_SIGNAL( in_GPR_READ_REGISTERFILE_DATA,_param->_nb_ooo_engine,_param->_nb_gpr_read,_param->_size_general_data);

    DELETE2_SIGNAL(out_GPR_READ_STATUS_VAL     ,_param->_nb_ooo_engine,_param->_nb_gpr_read,1  );
    DELETE2_SIGNAL( in_GPR_READ_STATUS_ACK     ,_param->_nb_ooo_engine,_param->_nb_gpr_read,1  );
    DELETE2_SIGNAL( in_GPR_READ_STATUS_DATA_VAL,_param->_nb_ooo_engine,_param->_nb_gpr_read,1);

    DELETE1_SIGNAL( in_SPR_READ_VAL           ,_param->_nb_spr_read,1  );
    DELETE1_SIGNAL(out_SPR_READ_ACK           ,_param->_nb_spr_read,1  );
    DELETE1_SIGNAL( in_SPR_READ_OOO_ENGINE_ID ,_param->_nb_spr_read,_param->_size_ooo_engine_id);
    DELETE1_SIGNAL(out_SPR_READ_DATA          ,_param->_nb_spr_read,_param->_size_special_data);
    DELETE1_SIGNAL(out_SPR_READ_DATA_VAL      ,_param->_nb_spr_read,1);
    
    DELETE2_SIGNAL(out_SPR_READ_REGISTERFILE_VAL ,_param->_nb_ooo_engine,_param->_nb_spr_read,1  );
    DELETE2_SIGNAL( in_SPR_READ_REGISTERFILE_ACK ,_param->_nb_ooo_engine,_param->_nb_spr_read,1  );
    DELETE2_SIGNAL( in_SPR_READ_REGISTERFILE_DATA,_param->_nb_ooo_engine,_param->_nb_spr_read,_param->_size_special_data);
    
    DELETE2_SIGNAL(out_SPR_READ_STATUS_VAL     ,_param->_nb_ooo_engine,_param->_nb_spr_read,1  );
    DELETE2_SIGNAL( in_SPR_READ_STATUS_ACK     ,_param->_nb_ooo_engine,_param->_nb_spr_read,1  );
    DELETE2_SIGNAL( in_SPR_READ_STATUS_DATA_VAL,_param->_nb_ooo_engine,_param->_nb_spr_read,1);
    
    DELETE1_SIGNAL( in_GPR_WRITE_VAL          ,_param->_nb_gpr_write,1  );
    DELETE1_SIGNAL(out_GPR_WRITE_ACK          ,_param->_nb_gpr_write,1  );
    DELETE1_SIGNAL( in_GPR_WRITE_OOO_ENGINE_ID,_param->_nb_gpr_write,_param->_size_ooo_engine_id);

    
    DELETE2_SIGNAL(out_GPR_WRITE_REGISTERFILE_VAL,_param->_nb_ooo_engine,_param->_nb_gpr_write,1  );
    DELETE2_SIGNAL( in_GPR_WRITE_REGISTERFILE_ACK,_param->_nb_ooo_engine,_param->_nb_gpr_write,1  );

    DELETE2_SIGNAL(out_GPR_WRITE_STATUS_VAL,_param->_nb_ooo_engine,_param->_nb_gpr_write,1  );
    DELETE2_SIGNAL( in_GPR_WRITE_STATUS_ACK,_param->_nb_ooo_engine,_param->_nb_gpr_write,1  );

    DELETE1_SIGNAL( in_SPR_WRITE_VAL          ,_param->_nb_spr_write,1  );
    DELETE1_SIGNAL(out_SPR_WRITE_ACK          ,_param->_nb_spr_write,1  );
    DELETE1_SIGNAL( in_SPR_WRITE_OOO_ENGINE_ID,_param->_nb_spr_write,_param->_size_ooo_engine_id);

    DELETE2_SIGNAL(out_SPR_WRITE_REGISTERFILE_VAL,_param->_nb_ooo_engine,_param->_nb_spr_write,1  );
    DELETE2_SIGNAL( in_SPR_WRITE_REGISTERFILE_ACK,_param->_nb_ooo_engine,_param->_nb_spr_write,1  );

    DELETE2_SIGNAL(out_SPR_WRITE_STATUS_VAL,_param->_nb_ooo_engine,_param->_nb_spr_write,1  );
    DELETE2_SIGNAL( in_SPR_WRITE_STATUS_ACK,_param->_nb_ooo_engine,_param->_nb_spr_write,1  );

    DELETE2_SIGNAL( in_INSERT_ROB_VAL   ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);
    DELETE2_SIGNAL(out_INSERT_ROB_ACK   ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);
    DELETE2_SIGNAL( in_INSERT_ROB_RD_USE,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);
    DELETE2_SIGNAL( in_INSERT_ROB_RE_USE,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);

    DELETE2_SIGNAL(out_INSERT_ROB_GPR_STATUS_VAL,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);
    DELETE2_SIGNAL( in_INSERT_ROB_GPR_STATUS_ACK,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);

    DELETE2_SIGNAL(out_INSERT_ROB_SPR_STATUS_VAL,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);
    DELETE2_SIGNAL( in_INSERT_ROB_SPR_STATUS_ACK,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob [it1],1);
      }
    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    

    delete _component;

    log_printf(FUNC,Register_unit_Glue,FUNCTION,"End");
  };

}; // end namespace register_unit_glue
}; // end namespace register_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

}; // end namespace behavioural
}; // end namespace morpheo              
