Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/Makefile

    r81 r88  
    2323library_clean                   : Shifter_library_clean
    2424
     25local_clean                     :
     26
    2527include                         ../Makefile.deps
    2628include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/SelfTest/src/test.cpp

    r82 r88  
    3838  morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics(5,50);
    3939#endif
     40
     41  Tusage_t _usage = USE_ALL;
     42
     43//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     44//   _usage = usage_unset(_usage,USE_VHDL                 );
     45//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     46//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     47//   _usage = usage_unset(_usage,USE_POSITION             );
     48   _usage = usage_unset(_usage,USE_STATISTICS           );
     49//   _usage = usage_unset(_usage,USE_INFORMATION          );
     50
    4051  Shifter * _Shifter = new Shifter (name.c_str(),
    4152#ifdef STATISTICS
     
    4354#endif
    4455                                    &param,
    45                                     USE_ALL);
     56                                    _usage);
    4657 
    4758#ifdef SYSTEMC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Parameters.h

    r82 r88  
    5656                        carry_t     carry               ,
    5757                        bool        type_completion_bool = false);
    58   public : Parameters  (Parameters & param) ;
     58//   public : Parameters  (Parameters & param) ;
    5959  public : ~Parameters () ;
    6060
     61  public :        void            copy       (void);
     62
    6163  public :        Parameters_test msg_error  (void);
     64
    6265  public :        std::string     print      (uint32_t depth);
    6366  public : friend std::ostream&   operator<< (std::ostream& output_stream,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Shifter.h

    r82 r88  
    55 * $Id$
    66 *
    7  * [ Description ]
     7 * [ Description ]
    88 *
    99 */
     
    3838#endif
    3939  {
    40     // -----[ fields ]----------------------------------------------------
     40    // -----[ fields ]----------------------------------------------------
    4141    // Parameters
    4242  protected : const std::string  _name;
     
    5252
    5353#ifdef SYSTEMC
    54     // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     54    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5555  public    : SC_CLOCK                      *  in_CLOCK             ;
    5656  public    : SC_IN (Tcontrol_t)            *  in_NRESET            ;
     
    6666  public    : SC_OUT(Tdata_t)              ** out_SHIFTER_DATA      ;
    6767   
    68     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     68    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    6969
    70     // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     70    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    7171#endif
    7272
    73     // -----[ methods ]---------------------------------------------------
     73    // -----[ methods ]---------------------------------------------------
    7474
    7575#ifdef SYSTEMC
     
    9393  public  :          ~Shifter             (void);
    9494                                               
    95 #ifdef SYSTEMC                                 
    9695  private : void     allocation                (void);
    9796  private : void     deallocation              (void);
    9897                                               
     98#ifdef SYSTEMC                                 
    9999#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
    100100  public  : void     transition                (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters.cpp

    r81 r88  
    8080  };
    8181 
    82   Parameters::Parameters (Parameters & param):
    83     _size_data                   (param._size_data                   ),
    84     _nb_port                     (param._nb_port                     ),
    85     _shift_value                 (param._shift_value                 ),
    86     _rotate                      (param._rotate                      ),
    87     _direction                   (param._direction                   ),
    88     _carry                       (param._carry                       ),
    89     _size_data_completion        (param._size_data_completion        ),
    90     _type_completion_bool        (param._type_completion_bool        ),
     82//   Parameters::Parameters (Parameters & param):
     83//     _size_data                   (param._size_data                   ),
     84//     _nb_port                     (param._nb_port                     ),
     85//     _shift_value                 (param._shift_value                 ),
     86//     _rotate                      (param._rotate                      ),
     87//     _direction                   (param._direction                   ),
     88//     _carry                       (param._carry                       ),
     89//     _size_data_completion        (param._size_data_completion        ),
     90//     _type_completion_bool        (param._type_completion_bool        ),
    9191
    92     _internal_direction          (param._internal_direction          ),
    93     _internal_type               (param._internal_type               ),
    94     _internal_carry              (param._internal_carry              ),
     92//     _internal_direction          (param._internal_direction          ),
     93//     _internal_type               (param._internal_type               ),
     94//     _internal_carry              (param._internal_carry              ),
    9595   
    96     _have_shift_logic_left       (param._have_shift_logic_left       ),
    97     _have_shift_logic_right      (param._have_shift_logic_right      ),
    98     _have_shift_logic            (param._have_shift_logic            ),
    99     _have_shift_arithmetic_left  (param._have_shift_arithmetic_left  ),
    100     _have_shift_arithmetic_right (param._have_shift_arithmetic_right ),
    101     _have_shift_arithmetic       (param._have_shift_arithmetic       ),
    102     _have_shift                  (param._have_shift                  ),
    103     _have_rotate_left            (param._have_rotate_left            ),
    104     _have_rotate_right           (param._have_rotate_right           ),
    105     _have_rotate                 (param._have_rotate                 ),
     96//     _have_shift_logic_left       (param._have_shift_logic_left       ),
     97//     _have_shift_logic_right      (param._have_shift_logic_right      ),
     98//     _have_shift_logic            (param._have_shift_logic            ),
     99//     _have_shift_arithmetic_left  (param._have_shift_arithmetic_left  ),
     100//     _have_shift_arithmetic_right (param._have_shift_arithmetic_right ),
     101//     _have_shift_arithmetic       (param._have_shift_arithmetic       ),
     102//     _have_shift                  (param._have_shift                  ),
     103//     _have_rotate_left            (param._have_rotate_left            ),
     104//     _have_rotate_right           (param._have_rotate_right           ),
     105//     _have_rotate                 (param._have_rotate                 ),
    106106
    107     _have_direction_left         (param._have_direction_left         ),
    108     _have_direction_right        (param._have_direction_right        )
     107//     _have_direction_left         (param._have_direction_left         ),
     108//     _have_direction_right        (param._have_direction_right        )
    109109
     110//   {
     111//     test();
     112//   };
     113
     114  Parameters::~Parameters ()
    110115  {
    111     test();
    112116  };
    113117
    114   Parameters::~Parameters ()
    115   { };
     118  void Parameters::copy (void)
     119  {
     120  };
    116121
    117122}; // end namespace shifter
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter.cpp

    r82 r88  
    1414
    1515
     16#undef  FUNCTION
     17#define FUNCTION "Shifter::Shifter"
    1618  Shifter::Shifter (
    1719#ifdef SYSTEMC
     
    2931    ,_usage (usage)
    3032  {
    31 #ifdef SYSTEMC
     33
     34#if DEBUG_Shifter == true
     35    log_printf(INFO,Shifter,FUNCTION,_("<%s> Parameters"),_name.c_str());
     36
     37    std::cout << *param << std::endl;
     38#endif   
     39
    3240    allocation ();
    33 #endif
    3441
    3542#ifdef STATISTICS
    36     // Allocation of statistics
    37     statistics_declaration(param_statistics);
     43    if (usage_is_set(_usage,USE_STATISTICS))
     44      {
     45        // Allocation of statistics
     46        statistics_declaration(param_statistics);
     47      }
    3848#endif
    3949
    4050#ifdef VHDL
    41     // generate the vhdl
    42     vhdl();
     51    if (usage_is_set(_usage,USE_VHDL))
     52      {
     53        // generate the vhdl
     54        vhdl();
     55      }
    4356#endif
    4457
    4558#ifdef SYSTEMC
     59    if (usage_is_set(_usage,USE_SYSTEMC))
     60      {
    4661#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
    4762    SC_METHOD (transition);
     
    91106      }
    92107#endif   
    93 
     108      }
    94109#endif
    95110  };
    96111 
     112#undef  FUNCTION
     113#define FUNCTION "Shifter::~Shifter"
    97114  Shifter::~Shifter (void)
    98115  {
    99 #ifdef SYSTEMC
    100     deallocation ();
     116#ifdef STATISTICS
     117    if (usage_is_set(_usage,USE_STATISTICS))
     118      delete _stat;
    101119#endif
    102120
    103 #ifdef STATISTICS
    104     delete _stat;
    105 #endif
     121    deallocation ();
    106122  };
    107123
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_allocation.cpp

    r82 r88  
    1 #ifdef SYSTEMC
    21/*
    32 * $Id$
     
    8685           in_SHIFTER_COMPLETION [i] = interface->set_signal_in  <Tdata_t     > ("completion",_param->_size_data_completion);
    8786          out_SHIFTER_DATA       [i] = interface->set_signal_out <Tdata_t     > ("data"      ,_param->_size_data);
    88         }                                                                                                                       
     87        }
    8988    }
    9089
    9190#ifdef POSITION
    92     _component->generate_file();
     91    if (usage_is_set(_usage,USE_POSITION))
     92      _component->generate_file();
    9393#endif
    9494
     
    9999}; // end namespace behavioural
    100100}; // end namespace morpheo             
    101 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_deallocation.cpp

    r82 r88  
    1 #ifdef SYSTEMC
    21/*
    32 * $Id$
     
    1716  void Shifter::deallocation (void)
    1817  {
     18    if (usage_is_set(_usage,USE_SYSTEMC))
     19      {
    1920#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
    2021    delete     in_CLOCK;
     
    3637    delete []  in_SHIFTER_COMPLETION;
    3738    delete [] out_SHIFTER_DATA      ;
     39      }
    3840
    3941    delete _component;
     
    4648}; // end namespace behavioural
    4749}; // end namespace morpheo             
    48 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Shifter_end_cycle.cpp

    r81 r88  
    2121
    2222#ifdef STATISTICS
    23     _stat->end_cycle();
     23    if (usage_is_set(_usage,USE_STATISTICS))
     24      _stat->end_cycle();
    2425#endif   
    2526
     
    2728    // Evaluation before read the ouput signal
    2829//  sc_start(0);
    29     _interfaces->testbench();
     30    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     31      _interfaces->testbench();
    3032#endif
    3133
Note: See TracChangeset for help on using the changeset viewer.