source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU.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: 2.7 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace generic {
13namespace victim {
14namespace victim_pseudo_lru {
15
16#ifdef SYSTEMC
17  Victim_Pseudo_LRU::Victim_Pseudo_LRU (sc_module_name name,
18#else
19  Victim_Pseudo_LRU::Victim_Pseudo_LRU (std::string name,
20#endif
21#ifdef STATISTICS
22                          morpheo::behavioural::Parameters_Statistics * param_statistics,
23#endif
24                          morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters param ):
25                          _name   (name)
26                          ,_param (param)
27  {
28    log_printf(FUNC,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Begin");
29
30#ifdef SYSTEMC
31    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation");
32    allocation ();
33#endif
34
35#ifdef STATISTICS
36    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation of statistics");
37   
38    // Allocation of statistics
39    statistics_declaration(param_statistics);
40#endif
41
42#ifdef VHDL
43    // generate the vhdl
44    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Generation of VHDL");
45    vhdl();
46#endif
47
48#ifdef SYSTEMC
49    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Definition of sc_method");
50    SC_METHOD (transition);
51    dont_initialize ();
52    sensitive << (*(in_CLOCK)).pos();
53
54    SC_METHOD (genMealy_access);
55    dont_initialize ();
56    sensitive << (*(in_CLOCK)).neg();
57    for (uint32_t i=0; i<_param._nb_access; i++)
58      {
59        sensitive << *(in_ACCESS_VAL     [i]);
60        if (_param._size_table>1)
61          sensitive << *(in_ACCESS_ADDRESS [i]);
62      }
63
64#ifdef SYSTEMCASS_SPECIFIC
65    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","List dependency information");
66    // List dependency information
67    for (uint32_t i=0; i<_param._nb_access; i++)
68      {
69        (*(out_ACCESS_ENTITY [i])) (*( in_ACCESS_VAL     [i]));
70        if (_param._size_table>1)
71          (*(out_ACCESS_ENTITY [i])) (*( in_ACCESS_ADDRESS [i]));
72      }
73#endif   
74
75    // Constant - ack is always at one
76    for (uint32_t i=0; i<_param._nb_access; i++)
77      PORT_WRITE (out_ACCESS_ACK [i], 1);
78    for (uint32_t i=0; i<_param._nb_update; i++)
79      PORT_WRITE (out_UPDATE_ACK [i], 1);
80
81#endif
82    log_printf(FUNC,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","End");
83  };
84 
85  Victim_Pseudo_LRU::~Victim_Pseudo_LRU (void)
86  {
87    log_printf(FUNC,Victim_Pseudo_LRU,"~Victim_Pseudo_LRU","Begin");
88#ifdef SYSTEMC
89    deallocation ();
90#endif
91
92#ifdef STATISTICS
93    delete _stat;
94#endif
95    log_printf(FUNC,Victim_Pseudo_LRU,"~Victim_Pseudo_LRU","End");
96  };
97
98}; // end namespace victim_pseudo_lru
99}; // end namespace victim
100}; // end namespace generic
101}; // end namespace behavioural
102}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.