Ignore:
Timestamp:
Apr 14, 2009, 8:39:12 PM (15 years ago)
Author:
rosiere
Message:

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe
Files:
6 added
10 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/Makefile.defs

    r82 r113  
    77#
    88
     9ENTITY                          = @COMPONENT
     10
    911#-----[ Directory ]----------------------------------------
    1012DIR_COMPONENT_MORPHEO           = @DIR_MORPHEO
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/include/top.h

    r111 r113  
    44 * [ Description ]
    55 *
    6  * Test "RegisterFile"
     6 * Test "@COMPONENT"
    77 */
    88
     
    2424using namespace morpheo::behavioural::@NAMESPACE_USE;
    2525
    26 void test    (string name,
    27               morpheo::behavioural::@NAMESPACE_USE::Parameters * param);
     26SC_MODULE(top)
     27{
     28#ifdef SYSTEMC
     29 private: sc_clock               *  in_CLOCK ;
     30 private: sc_signal<Tcontrol_t>  *  in_NRESET;
     31#endif
     32
     33 private: std::string name;
     34 private: Tusage_t _usage;
     35 private: morpheo::behavioural::@NAMESPACE_USE::Parameters * _param;
     36#ifdef STATISTICS
     37 private: morpheo::behavioural::Parameters_Statistics * _param_stat;
     38#endif
     39 private: @COMPONENT * component;
     40
     41 private: void usage
     42    (
     43#ifdef MTI_SYSTEMC
     44     int argc, const char * const * argv
     45#else
     46     int argc, char * argv[]
     47#endif
     48     );
     49 private: void allocation   (void);
     50 private: void deallocation (void);
     51 public : void test         (void);
     52
     53#ifdef MTI_SYSTEMC
     54  SC_CTOR(top::top);
     55#else
     56 public : top (sc_module_name module_name,int argc, char * argv[]);
     57#endif
     58 public : ~top(void);
     59};
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/main.cpp

    r88 r113  
    66 */
    77
    8 #include "Behavioural/@DIRECTORY/SelfTest/include/test.h"
     8#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
    99
    10 #define NB_PARAMS 0
     10#ifndef MTI_SYSTEMC
     11# ifndef SYSTEMC
     12int main    (int argc, char * argv[])
     13# else
     14int sc_main (int argc, char * argv[])
     15# endif
     16{
     17  int _return = EXIT_SUCCESS;
    1118
    12 void usage (int argc, char * argv[])
    13 {
    14   err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    15   err (_("list_params is :\n"));
    16   err (_(" *  ()\n"));
    17 
    18   exit (1);
    19 }
    20 
    21 #ifndef SYSTEMC
    22 int main    (int argc, char * argv[])
    23 #else
    24 int sc_main (int argc, char * argv[])
    25 #endif
    26 {
    27   if (argc != static_cast<int>(2+NB_PARAMS))
    28     usage (argc, argv);
    29 
    30   uint32_t x = 1;
    31 
    32   string name = argv[x++];
    33 
    34   int _return = EXIT_SUCCESS;
    3519  try
    3620    {
    37       morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters
    38         (
    39          true //is_toplevel
    40         );
    41      
    42       msg(_("%s"),param->print(0).c_str());
    43      
    44       test (name,param);
     21      top * my_top = new top ("my_top",argc,argv);
     22
     23      my_top->test();
     24
     25      delete my_top;
    4526    }
    4627  catch (morpheo::ErrorMorpheo & error)
    4728    {
    48       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
     29      msgError(_("%s\n"),error.what ());
    4930      _return = EXIT_FAILURE;
    5031    }
     
    5940  catch (morpheo::ErrorMorpheo & error)
    6041    {
    61 //       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
     42//    msgError(_("<%s> :\n%s"),name.c_str(), error.what ());
    6243      _return = EXIT_FAILURE;
    6344    }
    6445
    65   return (_return);
     46  return _return;
    6647}
     48#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_test.cpp

    r111 r113  
    77 */
    88
    9 #include "Behavioural/@DIRECTORY/SelfTest/include/test.h"
     9#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
    1010#include "Behavioural/include/Allocation.h"
    1111
    12 void test (string name,
    13            morpheo::behavioural::@NAMESPACE_USE::Parameters * _param)
     12void top::test (void)
    1413{
    15   msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
    16 
    17   if (setlocale (LC_ALL, "") == NULL)
    18     msg(_("setlocale ko.\n"));
    19 
    20 #ifdef STATISTICS
    21   morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);
    22 #endif
    23 
    24   Tusage_t _usage = USE_ALL;
    25 
    26 //   _usage = usage_unset(_usage,USE_SYSTEMC              );
    27 //   _usage = usage_unset(_usage,USE_VHDL                 );
    28 //   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
    29 //   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
    30 //   _usage = usage_unset(_usage,USE_POSITION             );
    31 //   _usage = usage_unset(_usage,USE_STATISTICS           );
    32 //   _usage = usage_unset(_usage,USE_INFORMATION          );
    33 
    34   @COMPONENT * _@COMPONENT = new @COMPONENT
    35     (name.c_str(),
    36 #ifdef STATISTICS
    37      _parameters_statistics,
    38 #endif
    39      _param,
    40      _usage);
    41  
    4214#ifdef SYSTEMC
    4315  if (usage_is_set(_usage,USE_SYSTEMC))
    4416    {
    45   /*********************************************************************
    46    * Déclarations des signaux
    47    *********************************************************************/
    48   string rename;
    49 
    50   sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);         
    51   sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
    52  
    53   /********************************************************
    54    * Instanciation
    55    ********************************************************/
    56  
    57   msg(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str());
    58 
    59   (*(_@COMPONENT->in_CLOCK))        (*(in_CLOCK));
    60   (*(_@COMPONENT->in_NRESET))       (*(in_NRESET));
    61 
    62 
    63   msg(_("<%s> : Start Simulation ............\n"),name.c_str());
    64    
    65   Time * _time = new Time();
    66 
    67   /********************************************************
    68    * Simulation - Begin
    69    ********************************************************/
    70 
    71   // Initialisation
    72 
    73   const uint32_t seed = 0;
    74 //const uint32_t seed = static_cast<uint32_t>(time(NULL));
    75 
    76   srand(seed);
    77 
    78   SC_START(0);
    79   LABEL("Initialisation");
    80 
    81   LABEL("Reset");
    82   in_NRESET->write(0);
    83   SC_START(5);
    84   in_NRESET->write(1); 
    85 
    86   LABEL("Loop of Test");
    87 
    88   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
    89     {
    90       LABEL("Iteration %d",iteration);
    91 
    92       SC_START(1);
    93     }
    94 
    95   /********************************************************
    96    * Simulation - End
    97    ********************************************************/
    98 
    99   TEST_OK ("End of Simulation");
    100   delete _time;
    101 
    102   msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
    103 
    104   delete in_CLOCK;
    105   delete in_NRESET;
     17      msgInformation(_("<%s> : Start Simulation ............\n"),name.c_str());
     18     
     19      Time * _time = new Time();
     20     
     21      /********************************************************
     22       * Simulation - Begin
     23       ********************************************************/
     24     
     25      // Initialisation
     26     
     27      const uint32_t seed = 0;
     28    //const uint32_t seed = static_cast<uint32_t>(time(NULL));
     29     
     30      srand(seed);
     31     
     32      SC_CYCLE(0);
     33      LABEL("Initialisation");
     34     
     35      LABEL("Reset");
     36      in_NRESET->write(0);
     37      SC_CYCLE(5);
     38      in_NRESET->write(1); 
     39     
     40      LABEL("Loop of Test");
     41     
     42      for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     43        {
     44          LABEL("Iteration %d",iteration);
     45         
     46          SC_CYCLE(1);
     47        }
     48     
     49      /********************************************************
     50       * Simulation - End
     51       ********************************************************/
     52     
     53      TEST_OK ("");
     54     
     55      sc_stop();
     56      delete _time;
     57     
     58      msgInformation(_("<%s> : ............ Stop Simulation\n"),name.c_str());
    10659    }
    10760#endif
    108 
    109   delete _@COMPONENT;
    110 #ifdef STATISTICS
    111   delete _parameters_statistics;
    112 #endif
    11361}
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/include/New_Component.h

    r82 r113  
    1313#endif
    1414
    15 
     15#include "Behavioural/@DIRECTORY/include/Wrapper_@COMPONENT.h"
    1616#include "Behavioural/@DIRECTORY/include/Parameters.h"
    1717#include "Behavioural/@DIRECTORY/include/Types.h"
     
    2424#endif
    2525#include "Behavioural/include/Usage.h"
     26#include "Behavioural/include/Simulation.h"
    2627
    2728#include "Common/include/ToString.h"
     
    4445  protected : const std::string  _name;
    4546  protected : const Parameters * _param;
    46   private   : const Tusage_t     _usage;
     47  public    :      Tusage_t     _usage;
    4748
    4849#ifdef STATISTICS
     
    5960  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
    6061
    61     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     62    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6263
    63     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     64    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6465
    6566    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     67#endif
     68
     69#ifdef MODELSIM_COSIMULATION
     70    // ~~~~~[ Wrapper ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     71  private : Wrapper_@COMPONENT * _wrapper;
    6672#endif
    6773
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/include/Parameters.h

    r88 r113  
    2929  public :        Parameters_test msg_error  (void);
    3030
     31  public :        std::string     id         (void);
     32
    3133  public :        std::string     print      (uint32_t depth);
    3234  public : friend std::ostream&   operator<< (std::ostream& output_stream,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component.cpp

    r88 r113  
    2929    _name              (name)
    3030    ,_param            (param)
    31     ,_usage            (usage)
    3231  {
    3332    log_begin(@COMPONENT,FUNCTION);
    3433
    35     usage_environment(_usage);
     34    _usage = usage_environment(usage);
     35
     36#ifdef MODELSIM_COSIMULATION
     37    if (_model.get_type(_param->_type) == MODEL_VHDL)
     38      {
     39        _usage = usage_cosimulation(_usage);
     40      }
     41#endif
    3642
    3743    log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation"),_name.c_str());
     
    6369
    6470#ifdef SYSTEMC
    65     if (usage_is_set(_usage,USE_SYSTEMC))
     71    if (usage_is_set(_usage,USE_SYSTEMC_BODY))
    6672      {
    6773        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
     
    8591// # endif   
    8692       
     93      }
    8794#endif
    88       }
     95
    8996    log_end(@COMPONENT,FUNCTION);
    9097  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component_allocation.cpp

    r82 r113  
    1010#include "Common/include/Max.h"
    1111
    12 namespace morpheo                    {
     12namespace morpheo {
    1313namespace behavioural {
    1414@NAMESPACE_BEGIN
     
    3030
    3131    Entity * entity = _component->set_entity (_name       
    32                                               ,"@COMPONENT"
     32                                              ,_param->_type
    3333#ifdef POSITION
    3434                                              ,COMBINATORY
     
    5858#endif
    5959
     60#ifdef MODELSIM_COSIMULATION
     61    if (usage_is_set(_usage,USE_COSIMULATION))
     62      {
     63        log_printf(INFO,Execute_queue,FUNCTION,_("<%s> : Create Wrapper"),_name.c_str());
     64
     65        _wrapper = new Wrapper_@COMPONENT (_name.c_str(),"morpheo_behavioural","work");
     66      }
     67#endif
     68
    6069    log_end(@COMPONENT,FUNCTION);
    6170  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component_deallocation.cpp

    r82 r113  
    1919    log_begin(@COMPONENT,FUNCTION);
    2020
    21     if (usage_is_set(_usage,USE_SYSTEMC))
    22       {
    23         delete    in_CLOCK ;
    24         delete    in_NRESET;
     21//    if (usage_is_set(_usage,USE_SYSTEMC_INTERFACE))
     22      { 
     23        DELETE0_SIGNAL( in_CLOCK ,1);
     24        DELETE0_SIGNAL( in_NRESET,1);
    2525      }
    2626    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    2727
    2828    delete _component;
     29
     30#ifdef MODELSIM_COSIMULATION
     31    if (usage_is_set(_usage,USE_COSIMULATION))
     32      {
     33        delete _wrapper;
     34      }
     35#endif
    2936
    3037    log_end(@COMPONENT,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component_statistics_allocation.cpp

    r82 r113  
    2020
    2121    _stat = new Stat (static_cast<std::string>(_name),
    22                       "@COMPONENT",
     22                      _param->_type,
    2323                      param_statistics);
    2424   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/Parameters.cpp

    r88 r113  
    1414#undef  FUNCTION
    1515#define FUNCTION "@COMPONENT::Parameters"
    16   Parameters::Parameters (bool is_toplevel)
     16  Parameters::Parameters (bool is_toplevel):
     17    behavioural::Parameters ("@COMPONENT")
    1718  {
    1819    log_begin(@COMPONENT,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/Parameters_msg_error.cpp

    r82 r113  
    2020    log_begin(@COMPONENT,FUNCTION);
    2121
    22     Parameters_test test ("@COMPONENT");
     22    Parameters_test test (_type);
    2323
    2424    log_end(@COMPONENT,FUNCTION);
Note: See TracChangeset for help on using the changeset viewer.