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

Last change on this file since 71 was 71, checked in by rosiere, 16 years ago

Modification of Statisctics
Add a new systemC component : Load_Store_Queue (tested with one benchmark and one configuration). Store don't supported the Data Buss Error (Load is supported)

File size: 1.8 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  {
28    log_printf(FUNC,Counter,"Counter","Begin");
29
30#ifdef SYSTEMC
31    allocation ();
32#endif
33
34#ifdef STATISTICS
35    // Allocation of statistics
36    statistics_declaration(param_statistics);
37#endif
38
39#ifdef VHDL
40    // generate the vhdl
41    vhdl();
42#endif
43
44#ifdef SYSTEMC
45
46#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
47    SC_METHOD (transition);
48    dont_initialize ();
49    sensitive << (*(in_CLOCK)).pos();
50#endif
51
52    SC_METHOD (genMealy);
53    dont_initialize ();
54    for (uint32_t i=0; i<_param._nb_port; i++)
55      sensitive << *(in_COUNTER_DATA   [i])
56                << *(in_COUNTER_ADDSUB [i]);
57
58#ifdef SYSTEMCASS_SPECIFIC
59    // List dependency information
60    for (uint32_t i=0; i<_param._nb_port; i++)
61      {
62        (*(out_COUNTER_DATA [i])) (*(in_COUNTER_DATA   [i]));
63        (*(out_COUNTER_DATA [i])) (*(in_COUNTER_ADDSUB [i]));
64      }
65#endif   
66
67#endif
68    log_printf(FUNC,Counter,"Counter","End");
69  };
70 
71  Counter::~Counter (void)
72  {
73    log_printf(FUNC,Counter,"~Counter","Begin");
74#ifdef SYSTEMC
75    deallocation ();
76#endif
77
78#ifdef STATISTICS
79    delete _stat;
80#endif
81    log_printf(FUNC,Counter,"~Counter","End");
82  };
83
84}; // end namespace counter
85}; // end namespace generic
86
87}; // end namespace behavioural
88}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.