source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Pseudo_LRU/src/Pseudo_LRU_transition.cpp @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 1.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Select/Pseudo_LRU/include/Pseudo_LRU.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace generic {
14namespace select {
15namespace pseudo_lru {
16
17  void 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#ifdef STATISTICS
64    _stat->add(_stat_nb_access,
65               _stat_nb_update);
66#endif   
67   
68#ifdef VHDL_TESTBENCH
69    vhdl_testbench_transition (*_vhdl_testbench);
70#endif
71  };
72
73}; // end namespace pseudo_lru
74}; // end namespace select
75}; // end namespace generic
76
77}; // end namespace behavioural
78}; // end namespace morpheo             
79#endif
Note: See TracBrowser for help on using the repository browser.