#ifdef SYSTEMC
/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Generic/Select/Pseudo_LRU/include/Pseudo_LRU.h"

namespace morpheo {
namespace behavioural {
namespace generic {
namespace select {
namespace pseudo_lru {

  void Pseudo_LRU::genMealy_access (void)
  {
    for (uint32_t i=0; i<_param._nb_access; i++)
      {
	if (PORT_READ (in_ACCESS_VAL[i]) == 1)
	  {
	    Taddress_t address;

	    if (_param._size_table>1)
	      address = PORT_READ     (in_ACCESS_ADDRESS[i]);
	    else
	      address = 0;
	    
	    internal_ACCESS_ENTITY[i] = reg_TABLE[address]->access();
	  }
	else
	  {
	    internal_ACCESS_ENTITY[i] = 0;
	  }

	PORT_WRITE(out_ACCESS_ENTITY[i], internal_ACCESS_ENTITY[i]);
      }//end for i
  };

}; // end namespace pseudo_lru
}; // end namespace select
}; // end namespace generic
}; // end namespace behavioural
}; // end namespace morpheo              
#endif
