source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU.cpp @ 82

Last change on this file since 82 was 82, checked in by rosiere, 16 years ago
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/*
2 * $Id: Victim_Pseudo_LRU.cpp 82 2008-05-01 16:48:45Z rosiere $
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  Victim_Pseudo_LRU::Victim_Pseudo_LRU
17  (
18#ifdef SYSTEMC
19   sc_module_name name,
20#else
21   std::string name,
22#endif
23#ifdef STATISTICS
24   morpheo::behavioural::Parameters_Statistics * param_statistics,
25#endif
26   morpheo::behavioural::generic::victim::victim_pseudo_lru::Parameters * param ,
27   morpheo::behavioural::Tusage_t usage):
28    _name   (name)
29    ,_param (param)
30    ,_usage (usage)
31  {
32    log_printf(FUNC,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Begin");
33
34#ifdef SYSTEMC
35    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation");
36    allocation ();
37#endif
38
39#ifdef STATISTICS
40    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation of statistics");
41   
42    // Allocation of statistics
43    statistics_declaration(param_statistics);
44#endif
45
46#ifdef VHDL
47    // generate the vhdl
48    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Generation of VHDL");
49    vhdl();
50#endif
51
52#ifdef SYSTEMC
53    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Definition of sc_method");
54    SC_METHOD (transition);
55    dont_initialize ();
56    sensitive << (*(in_CLOCK)).pos();
57
58    SC_METHOD (genMoore);
59    dont_initialize ();
60    sensitive << (*(in_CLOCK)).neg();
61
62#ifdef SYSTEMCASS_SPECIFIC
63#endif   
64
65    // Constant - ack is always at one
66    for (uint32_t i=0; i<_param->_nb_access; i++)
67      {
68        internal_ACCESS_ACK [i] = 1;
69        PORT_WRITE (out_ACCESS_ACK [i], internal_ACCESS_ACK [i]);
70      }
71
72#endif
73    log_printf(FUNC,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","End");
74  };
75 
76  Victim_Pseudo_LRU::~Victim_Pseudo_LRU (void)
77  {
78    log_printf(FUNC,Victim_Pseudo_LRU,"~Victim_Pseudo_LRU","Begin");
79#ifdef SYSTEMC
80    deallocation ();
81#endif
82
83#ifdef STATISTICS
84    delete _stat;
85#endif
86    log_printf(FUNC,Victim_Pseudo_LRU,"~Victim_Pseudo_LRU","End");
87  };
88
89}; // end namespace victim_pseudo_lru
90}; // end namespace victim
91}; // end namespace generic
92}; // end namespace behavioural
93}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.