source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp @ 42

Last change on this file since 42 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.9 KB
Line 
1/*
2 * $Id$
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#ifdef SYSTEMC
17  Counter::Counter (sc_module_name name,
18#else
19  Counter::Counter (string name,
20#endif
21#ifdef STATISTICS
22                              morpheo::behavioural::Parameters_Statistics             param_statistics,
23#endif
24                              morpheo::behavioural::generic::counter::Parameters param ):
25                              _name              (name)
26                              ,_param            (param)
27// #ifdef STATISTICS
28//                            ,_param_statistics (param_statistics)
29// #endif
30  {
31    log_printf(FUNC,Counter,"Counter","Begin");
32
33#ifdef SYSTEMC
34    allocation ();
35#endif
36
37#ifdef STATISTICS
38    // Allocation of statistics
39    _stat = new Statistics (static_cast<string>(_name),
40                            param_statistics          ,
41                            param);
42#endif
43
44#ifdef VHDL
45    // generate the vhdl
46    vhdl();
47#endif
48
49#ifdef SYSTEMC
50    SC_METHOD (transition);
51    dont_initialize ();
52    sensitive_pos << *(in_CLOCK);
53
54    SC_METHOD (genMealy);
55    dont_initialize ();
56    for (uint32_t i=0; i<_param._nb_port; i++)
57      sensitive << *(in_COUNTER_DATA   [i])
58                << *(in_COUNTER_ADDSUB [i]);
59
60#ifdef SYSTEMCASS_SPECIFIC
61    // List dependency information
62    for (uint32_t i=0; i<_param._nb_port; i++)
63      {
64        (*(out_COUNTER_DATA [i])) (*(in_COUNTER_DATA   [i]));
65        (*(out_COUNTER_DATA [i])) (*(in_COUNTER_ADDSUB [i]));
66      }
67#endif   
68
69#endif
70    log_printf(FUNC,Counter,"Counter","End");
71  };
72 
73  Counter::~Counter (void)
74  {
75    log_printf(FUNC,Counter,"~Counter","Begin");
76#ifdef SYSTEMC
77    deallocation ();
78#endif
79
80#ifdef STATISTICS
81    _stat->generate_file(statistics(0));
82   
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.