Last change
on this file since 50 was
42,
checked in by rosiere, 17 years ago
|
Modification des classes d'encapsulation des interfaces :
- gère les signaux à écrire dans le vhdl
- les traces pour le testbench
- la génération des vhdl structurelles
-> test sur la Pattern History Table
|
File size:
1.6 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 | |
---|
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 | #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 (); |
---|
70 | #endif |
---|
71 | }; |
---|
72 | |
---|
73 | }; // end namespace victim_pseudo_lru |
---|
74 | }; // end namespace victim |
---|
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.