source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.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: 1.7 KB
Line 
1/*
2 * $Id: Counter.cpp 82 2008-05-01 16:48:45Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Counter/include/Counter.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace generic {
13namespace counter {
14
15
16  Counter::Counter
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::counter::Parameters param,
27   Tusage_t usage):
28    _name  (name),
29    _param (param),
30    _usage (usage)
31  {
32    log_printf(FUNC,Counter,"Counter","Begin");
33
34#ifdef SYSTEMC
35    allocation ();
36#endif
37
38#ifdef STATISTICS
39    // Allocation of statistics
40    statistics_declaration(param_statistics);
41#endif
42
43#ifdef VHDL
44    // generate the vhdl
45    vhdl();
46#endif
47
48#ifdef SYSTEMC
49
50#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
51    SC_METHOD (transition);
52    dont_initialize ();
53    sensitive << (*(in_CLOCK)).pos();
54#endif
55
56    SC_METHOD (genMealy);
57    dont_initialize ();
58    for (uint32_t i=0; i<_param._nb_port; i++)
59      sensitive << *(in_COUNTER_DATA   [i])
60                << *(in_COUNTER_ADDSUB [i]);
61
62#ifdef SYSTEMCASS_SPECIFIC
63    // List dependency information
64    for (uint32_t i=0; i<_param._nb_port; i++)
65      {
66        (*(out_COUNTER_DATA [i])) (*(in_COUNTER_DATA   [i]));
67        (*(out_COUNTER_DATA [i])) (*(in_COUNTER_ADDSUB [i]));
68      }
69#endif   
70
71#endif
72    log_printf(FUNC,Counter,"Counter","End");
73  };
74 
75  Counter::~Counter (void)
76  {
77    log_printf(FUNC,Counter,"~Counter","Begin");
78#ifdef SYSTEMC
79    deallocation ();
80#endif
81
82#ifdef STATISTICS
83    delete _stat;
84#endif
85    log_printf(FUNC,Counter,"~Counter","End");
86  };
87
88}; // end namespace counter
89}; // end namespace generic
90
91}; // end namespace behavioural
92}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.