#include "../include/Cache_MultiLevel.h"
#include <sstream>

namespace environment {
namespace cache {
namespace cache_multilevel {

  uint32_t Cache_MultiLevel::update_access (Access cur_access)
  {
//     if (cur_access.last_nb_level > 0)
      {
	uint32_t latence = cur_access.latence;

	_cout(CACHE,"Cache_MultiLevel::update_access [%d] : latence : %d, last_nb_level : %d (nb_level : %d)\n",cur_access.num_port,latence,cur_access.last_nb_level,param->nb_level);
	
	for (uint32_t it = 0; it < cur_access.last_nb_level; it ++)
	  {
	    latence = hierarchy_cache [it]->update_latence (cur_access.num_port,latence);
	  }
// 	if (latence != 0)
// 	  {
// 	    _cout(CACHE,"after all update, latence must be null.\n");
// 	    exit(1);
// 	  }
      }

    return cur_access.latence;
  }

};
};
};
