source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Sort/src/Sort.cpp @ 78

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

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 2.8 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Sort/include/Sort.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace generic {
13namespace sort {
14
15
16#undef  FUNCTION
17#define FUNCTION "Sort::Sort"
18  Sort::Sort
19  (
20#ifdef SYSTEMC
21   sc_module_name name,
22#else
23   string name,
24#endif
25#ifdef STATISTICS
26   morpheo::behavioural::Parameters_Statistics * param_statistics,
27#endif
28   morpheo::behavioural::generic::sort::Parameters * param,
29   morpheo::behavioural::Tusage_t usage
30   ):
31    _name              (name)
32    ,_param            (param)
33    ,_usage            (usage)
34  {
35    log_printf(FUNC,Sort,FUNCTION,"Begin");
36
37    log_printf(INFO,Sort,FUNCTION,"Allocation");
38
39    allocation (
40#ifdef STATISTICS
41                param_statistics
42#endif
43                );
44
45#ifdef STATISTICS
46    if (_usage & USE_STATISTICS)
47      { 
48        log_printf(INFO,Sort,FUNCTION,"Allocation of statistics");
49
50        statistics_allocation(param_statistics);
51      }
52#endif
53
54#ifdef VHDL
55    if (_usage & USE_VHDL)
56      {
57        // generate the vhdl
58        log_printf(INFO,Sort,FUNCTION,"Generate the vhdl");
59       
60        vhdl();
61      }
62#endif
63
64#ifdef SYSTEMC
65    if (_usage & USE_SYSTEMC)
66      {
67        log_printf(INFO,Sort,FUNCTION,"Method - transition");
68
69        SC_METHOD (transition);
70        dont_initialize ();
71        sensitive << (*(in_CLOCK)).pos();
72       
73# ifdef SYSTEMCASS_SPECIFIC
74        // List dependency information
75# endif   
76
77        log_printf(INFO,Sort,FUNCTION,"Method - genMealy");
78
79        SC_METHOD (genMealy);
80        dont_initialize ();
81//      sensitive << (*(in_CLOCK)).neg(); // don't use internal register
82        for (uint32_t i=0; i<_param->_nb_input; i++)
83          sensitive << (*(in_INPUT_VAL  [i]))
84                    << (*(in_INPUT_DATA [i]));
85
86# ifdef SYSTEMCASS_SPECIFIC
87        // List dependency information
88        for (uint32_t i=0; i<_param->_nb_output; i++)
89          for (uint32_t j=0; j<_param->_nb_input; j++)
90            {
91              (*(out_OUTPUT_VAL   [i])) (*(in_INPUT_VAL  [j]));
92              (*(out_OUTPUT_VAL   [i])) (*(in_INPUT_DATA [j]));
93             
94              if (_param->_have_port_index_out)
95                {
96              (*(out_OUTPUT_INDEX [i])) (*(in_INPUT_VAL  [j]));
97              (*(out_OUTPUT_INDEX [i])) (*(in_INPUT_DATA [j]));
98                }
99              if (_param->_have_port_data_out)
100                {
101              (*(out_OUTPUT_DATA  [i])) (*(in_INPUT_VAL  [j]));
102              (*(out_OUTPUT_DATA  [i])) (*(in_INPUT_DATA [j]));
103                }
104            }
105# endif   
106       
107#endif
108      }
109    log_printf(FUNC,Sort,FUNCTION,"End");
110  };
111   
112#undef  FUNCTION
113#define FUNCTION "Sort::~Sort"
114  Sort::~Sort (void)
115  {
116    log_printf(FUNC,Sort,FUNCTION,"Begin");
117
118#ifdef STATISTICS
119    if (_usage & USE_STATISTICS)
120      {
121        statistics_deallocation();
122      }
123#endif
124
125    log_printf(INFO,Sort,FUNCTION,"Deallocation");
126    deallocation ();
127
128    log_printf(FUNC,Sort,FUNCTION,"End");
129  };
130
131}; // end namespace sort
132}; // end namespace generic
133
134}; // end namespace behavioural
135}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.