Last change
on this file since 139 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
|
Rev | Line | |
---|
[10] | 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 | |
---|
[15] | 9 | #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h" |
---|
[10] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace victim { |
---|
[15] | 15 | namespace victim_pseudo_lru { |
---|
[10] | 16 | |
---|
[15] | 17 | void Victim_Pseudo_LRU::transition (void) |
---|
[10] | 18 | { |
---|
[128] | 19 | |
---|
| 20 | if (PORT_READ(in_NRESET) == 0) |
---|
[10] | 21 | { |
---|
[128] | 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 |
---|
[78] | 37 | // #ifdef STATISTICS |
---|
[128] | 38 | // _stat_nb_update ++; |
---|
[78] | 39 | // #endif |
---|
[128] | 40 | entity = PORT_READ(in_ACCESS_ENTITY[i]); |
---|
| 41 | } |
---|
| 42 | else |
---|
| 43 | { |
---|
| 44 | // Miss : need victim |
---|
[78] | 45 | // #ifdef STATISTICS |
---|
[128] | 46 | // _stat_nb_access ++; |
---|
[78] | 47 | // #endif |
---|
[128] | 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 | } |
---|
[78] | 59 | |
---|
[75] | 60 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 61 | end_cycle (); |
---|
[10] | 62 | #endif |
---|
| 63 | }; |
---|
| 64 | |
---|
[15] | 65 | }; // end namespace victim_pseudo_lru |
---|
[10] | 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.