/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h"
#include "Common/include/BitManipulation.h"

namespace morpheo                    {
namespace behavioural {
namespace generic {
namespace registerfile {
namespace registerfile_multi_banked {


  Taddress_t RegisterFile_Multi_Banked::address_bank (Taddress_t address)
  {
    log_printf(FUNC,RegisterFile_Multi_Banked,"address_bank","Begin");
    
    Taddress_t _return = _param->_bank_mask & (address >> _param->_bank_shift);

    log_printf(FUNC,RegisterFile_Multi_Banked,"address_bank","End");

    return _return;
  };

  Taddress_t RegisterFile_Multi_Banked::address_num_reg (Taddress_t address)
  {
    log_printf(FUNC,RegisterFile_Multi_Banked,"address_num_reg","Begin");

    Taddress_t _return = _param->_num_reg_mask & (address >> _param->_num_reg_shift);
    
    log_printf(FUNC,RegisterFile_Multi_Banked,"address_num_reg","End");

    return _return;
  };



}; // end namespace registerfile_multi_banked
}; // end namespace registerfile
}; // end namespace generic

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