source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_transition.cpp @ 75

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 1.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace generic {
14namespace victim {
15namespace victim_pseudo_lru {
16
17  void Victim_Pseudo_LRU::transition (void)
18  {
19#ifdef STATISTICS
20    uint32_t _stat_nb_access = 0;
21    uint32_t _stat_nb_update = 0;
22#endif
23
24    for (uint32_t i=0; i<_param._nb_access; i++)
25      {
26        // Access ... (ack is always at 1)
27        if (PORT_READ (in_ACCESS_VAL[i]) == 1)
28          {
29#ifdef STATISTICS
30            _stat_nb_access ++;
31#endif
32            Taddress_t address;
33
34            if (_param._size_table>1)
35              address = PORT_READ     (in_ACCESS_ADDRESS[i]);
36            else
37              address = 0;
38           
39            reg_TABLE[address]->update(internal_ACCESS_ENTITY[i]);
40          }
41      }//end for i
42   
43    for (uint32_t i=0; i<_param._nb_update; i++)
44      {
45        // Update ... (ack is always at 1)
46        if (PORT_READ (in_UPDATE_VAL[i]) == 1)
47          {
48#ifdef STATISTICS
49            _stat_nb_update ++;
50#endif
51           
52            Taddress_t address;
53           
54            if (_param._size_table>1)
55              address = PORT_READ     (in_UPDATE_ADDRESS[i]);
56            else
57              address = 0;
58           
59            reg_TABLE[address]->update(PORT_READ(in_UPDATE_ENTITY[i]));
60          }
61      }//end for i
62
63#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
64    end_cycle ();
65#endif
66  };
67
68}; // end namespace victim_pseudo_lru
69}; // end namespace victim
70}; // end namespace generic
71
72}; // end namespace behavioural
73}; // end namespace morpheo             
74#endif
Note: See TracBrowser for help on using the repository browser.