source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Sort/src/Sort_genMealy.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: 1.2 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Sort/include/Sort.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace sort {
15
16
17#undef  FUNCTION
18#define FUNCTION "Sort::genMealy"
19  void Sort::genMealy (void)
20  {
21    log_printf(FUNC,Sort,FUNCTION,"Begin");
22
23    sort_t array [_param->_nb_input];
24
25    // Push input in a array
26    for (uint32_t i=0; i<_param->_nb_input; i++)
27      {
28        array[i].index = i;
29        array[i].val   = PORT_READ ( in_INPUT_VAL  [i]);
30        array[i].data  = PORT_READ ( in_INPUT_DATA [i]);
31      }
32
33    // Sort array
34    //if (_param->_ascending == true)
35    std::stable_sort(array, array+_param->_nb_input);
36
37    // Write output
38    for (uint32_t i=0; i<_param->_nb_output; i++)
39      {
40        PORT_WRITE (out_OUTPUT_VAL   [i],array[i].val  );
41        if (_param->_have_port_index_out)
42        PORT_WRITE (out_OUTPUT_INDEX [i],array[i].index);
43        if (_param->_have_port_data_out)
44        PORT_WRITE (out_OUTPUT_DATA  [i],array[i].data );
45      }
46
47    log_printf(FUNC,Sort,FUNCTION,"End");
48  };
49
50}; // end namespace sort
51}; // end namespace generic
52
53}; // end namespace behavioural
54}; // end namespace morpheo             
55#endif
Note: See TracBrowser for help on using the repository browser.