Last change
on this file since 144 was
128,
checked in by rosiere, 15 years ago
|
1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script
|
-
Property svn:keywords set to
Id
|
File size:
1.8 KB
|
Line | |
---|
1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Victim_Pseudo_LRU_transition.cpp 128 2009-06-26 08:43:23Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace victim { |
---|
15 | namespace victim_pseudo_lru { |
---|
16 | |
---|
17 | void Victim_Pseudo_LRU::transition (void) |
---|
18 | { |
---|
19 | |
---|
20 | if (PORT_READ(in_NRESET) == 0) |
---|
21 | { |
---|
22 | for (uint32_t i=0; i<_param->_size_table; ++i) |
---|
23 | reg_TABLE[i]->reset(); |
---|
24 | } |
---|
25 | else |
---|
26 | { |
---|
27 | for (uint32_t i=0; i<_param->_nb_access; i++) |
---|
28 | { |
---|
29 | if (PORT_READ (in_ACCESS_VAL[i]) and internal_ACCESS_ACK) |
---|
30 | { |
---|
31 | Taddress_t address = (_param->_size_table>1)?PORT_READ(in_ACCESS_ADDRESS[i]):0; |
---|
32 | Tentity_t entity = 0; |
---|
33 | |
---|
34 | if (PORT_READ(in_ACCESS_HIT [i])) |
---|
35 | { |
---|
36 | // Hit : don't need a victim |
---|
37 | // #ifdef STATISTICS |
---|
38 | // _stat_nb_update ++; |
---|
39 | // #endif |
---|
40 | entity = PORT_READ(in_ACCESS_ENTITY[i]); |
---|
41 | } |
---|
42 | else |
---|
43 | { |
---|
44 | // Miss : need victim |
---|
45 | // #ifdef STATISTICS |
---|
46 | // _stat_nb_access ++; |
---|
47 | // #endif |
---|
48 | entity = internal_ACCESS_VICTIM[i]; |
---|
49 | } |
---|
50 | |
---|
51 | #ifdef DEBUG_TEST |
---|
52 | if (address >= _param->_size_table) |
---|
53 | throw ERRORMORPHEO(FUNCTION,toString(_("Address (%d) is invalid (size : %d).\n"),address, _param->_size_table)); |
---|
54 | #endif |
---|
55 | reg_TABLE[address]->update(entity); |
---|
56 | } |
---|
57 | }//end for i |
---|
58 | } |
---|
59 | |
---|
60 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
61 | end_cycle (); |
---|
62 | #endif |
---|
63 | }; |
---|
64 | |
---|
65 | }; // end namespace victim_pseudo_lru |
---|
66 | }; // end namespace victim |
---|
67 | }; // end namespace generic |
---|
68 | |
---|
69 | }; // end namespace behavioural |
---|
70 | }; // end namespace morpheo |
---|
71 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.