#include "../include/Cache.h"

namespace environnement {
namespace cache {

  uint32_t Cache::range_port (cache_t  type_cache, 
			      uint32_t num_entity)
  {
    uint32_t nb_port_dedicated = 0;
    
    if (type_cache == INSTRUCTION_CACHE)
      {
	for (uint32_t i = 1; i < num_entity; i++ )
	  nb_port_dedicated += param->param_icache_dedicated [i]->nb_port;
      }
    else
      {
	std::cout << "nb_port_dedicated : " << nb_port_dedicated<< std::endl;
	nb_port_dedicated += param->nb_iport;
	std::cout << "nb_port_dedicated : " << param->nb_iport<< std::endl;
    
	for (uint32_t i = 1; i < num_entity; i++)
	  nb_port_dedicated += param->param_dcache_dedicated [i]->nb_port;
      }

    std::cout << "nb_port_dedicated : " << num_entity << std::endl;
    std::cout << "nb_port_dedicated : " << nb_port_dedicated<< std::endl;
	
    return nb_port_dedicated;
  }

};
};
