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_vst
Files:
4 added
5 edited
2 moved

Legend:

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

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

    r111 r113  
    44 * [ Description ]
    55 *
    6  * Test "RegisterFile"
     6 * Test "@COMPONENT"
    77 */
    88
     
    1818#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
    1919
    20 #include <string>
    21 #include <iostream>
    22 #include <sys/time.h>
    23 
    2420using namespace std;
    2521using namespace morpheo;
     
    2824using namespace morpheo::behavioural::@NAMESPACE_USE;
    2925
    30 void test    (string name,
    31               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_vst/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    }
    51 
     32 
    5233  try
    5334    {
     
    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_vst/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_vst/src/New_Component_allocation.cpp

    r83 r113  
    3030
    3131    Entity * entity = _component->set_entity (_name       
    32                                               ,"@COMPONENT"
     32                                              ,_param->_type
    3333#ifdef POSITION
    3434                                              ,COMBINATORY
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/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_vst/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);
Note: See TracChangeset for help on using the changeset viewer.