source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter.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: 2.7 KB
RevLine 
[2]1/*
2 * $Id: Shifter.cpp 82 2008-05-01 16:48:45Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Shifter/include/Shifter.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace generic {
13namespace shifter {
14
15
[82]16  Shifter::Shifter (
[2]17#ifdef SYSTEMC
[82]18                    sc_module_name name
[2]19#else
[82]20                    std::string name
[2]21#endif
22#ifdef STATISTICS
[75]23                    ,morpheo::behavioural::Parameters_Statistics * param_statistics
[2]24#endif
[82]25                    ,morpheo::behavioural::generic::shifter::Parameters *param
26                    ,morpheo::behavioural::Tusage_t                usage ):
27    _name   (name)
28    ,_param (param)
29    ,_usage (usage)
[2]30  {
[42]31#ifdef SYSTEMC
32    allocation ();
33#endif
34
[2]35#ifdef STATISTICS
36    // Allocation of statistics
[75]37    statistics_declaration(param_statistics);
[2]38#endif
39
40#ifdef VHDL
41    // generate the vhdl
42    vhdl();
43#endif
44
45#ifdef SYSTEMC
46#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
47    SC_METHOD (transition);
48    dont_initialize ();
[66]49    sensitive << (*(in_CLOCK)).pos();
[2]50#endif
51
52    SC_METHOD (genMealy_shift);
53    dont_initialize ();
[66]54    sensitive << (*(in_CLOCK)).neg();
[82]55    for (uint32_t i=0; i<param->_nb_port; i++)
[2]56      {
57        sensitive << (*(in_SHIFTER_DATA      [i]));
[82]58        if (param->_shift_value == 0)
[2]59        sensitive << (*(in_SHIFTER_SHIFT     [i]));
[82]60        if (param->_direction   == external_direction)
[2]61        sensitive << (*(in_SHIFTER_DIRECTION [i]));
[82]62        if (_param->_rotate     == external_rotate)
[2]63        sensitive << (*(in_SHIFTER_TYPE      [i]));
[82]64        if (param->_carry       == external_carry)
[2]65        sensitive << (*(in_SHIFTER_CARRY     [i]));
[82]66        if (param->_carry       == external_completion)
67          if (_param->_type_completion_bool == true)
[2]68            sensitive << (*(in_SHIFTER_CARRY_IN  [i]));
69          else
70            sensitive << (*(in_SHIFTER_COMPLETION[i]));
71      }
72
73#ifdef SYSTEMCASS_SPECIFIC
74    // List dependency information
[82]75    for (uint32_t i=0; i<param->_nb_port; i++)
[2]76      {
77        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_DATA      [i]));
[82]78        if (param->_shift_value == 0)
[2]79        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_SHIFT     [i]));
[82]80        if (param->_direction   == external_direction)
[2]81        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_DIRECTION [i]));
[82]82        if (_param->_rotate     == external_rotate)
[2]83        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_TYPE      [i]));
[82]84        if (param->_carry       == external_carry)
[2]85        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_CARRY     [i]));
[82]86        if (param->_carry       == external_completion)
87        if (_param->_type_completion_bool == true)
[2]88        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_CARRY_IN  [i]));
89        else
90        (*(out_SHIFTER_DATA [i])) (*(in_SHIFTER_COMPLETION[i]));
91      }
92#endif   
93
94#endif
95  };
96 
97  Shifter::~Shifter (void)
98  {
99#ifdef SYSTEMC
100    deallocation ();
101#endif
102
103#ifdef STATISTICS
104    delete _stat;
105#endif
106  };
107
108}; // end namespace shifter
109}; // end namespace generic
110
111}; // end namespace behavioural
112}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.