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/Common
Files:
1 added
9 edited

Legend:

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

    r81 r113  
    55#
    66
     7ENTITY                          = Common
     8
    79#-----[ Directory ]----------------------------------------
    810DIR_COMPONENT_MORPHEO           = ..
  • trunk/IPs/systemC/processor/Morpheo/Common/Makefile.deps

    r81 r113  
    1616#-----[ Library ]------------------------------------------
    1717
     18Common_SOURCES          =       $(Common_DIR)/src/*.cpp
     19
    1820Common_LIBRARY          =       -lCommon
    1921
  • trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h

    r88 r113  
    4242  };
    4343
     44  template <typename T>
     45  T gen_mask_not   (uint32_t size)
     46  {
     47    return gen_mask_not<T>(size-1,0);
     48  };
     49
    4450  //............................................................................
    4551  // mask, mask_not ............................................................
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h

    r112 r113  
    2424 */
    2525
     26#include "Common/include/Systemc.h"
    2627#include "Common/include/Message.h"
    2728#include "Common/include/FromString.h"
     
    6465#define debug_test_simulation_time                                      \
    6566  (not debug_cycle_test or                                              \
    66    ( (sc_simulation_time() >= debug_cycle_start) and                    \
    67     ((sc_simulation_time() <= debug_cycle_stop) or                      \
     67   ( (simulation_cycle() >= debug_cycle_start) and                    \
     68    ((simulation_cycle() <= debug_cycle_stop) or                      \
    6869      (debug_cycle_stop == -1))))
    6970#else
     
    149150  do                                                                    \
    150151    {                                                                   \
    151       log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(sc_simulation_time()),name,func); \
     152      log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(simulation_cycle()),name,func); \
    152153    } while(0)
    153154
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Environment.h

    r88 r113  
    1414
    1515#if (defined(STATISTICS) and not defined(SYSTEMC))
    16 #  error "To have the statistics, you must set flags SYSTEMC"
     16# error "To have the statistics, you must set flags SYSTEMC"
    1717#endif
    1818
    1919#if (defined(INFORMATION) and not defined(STATISTICS))
    20 #  error "To have the information, you must set flags STATISTICS"
     20# error "To have the information, you must set flags STATISTICS"
    2121#endif
    2222
    2323#if (defined(VHDL_TESTBENCH) and not defined(SYSTEMC))
    24 #  error "To have the vhdl's test bench, you must set flags SYSTEMC"
     24# error "To have the vhdl's test bench, you must set flags SYSTEMC"
    2525#endif
    2626
    2727#if (defined(VHDL_TESTBENCH) and not defined(VHDL))
    28 #  error "To have the vhdl's test bench, you must set flags VHDL"
     28# error "To have the vhdl's test bench, you must set flags VHDL"
    2929#endif
    3030
    3131#if (defined(VHDL_TESTBENCH_ASSERT) and not defined(VHDL_TESTBENCH))
    32 #  error "To have an assert in vhdl's test bench, you must set flags VHDL_TESTBENCH"
     32# error "To have an assert in vhdl's test bench, you must set flags VHDL_TESTBENCH"
    3333#endif
    3434
    3535#if (defined(VHDL_TESTBENCH) and defined(SYSTEMC))
    36 #  define SYSTEMC_VHDL_COMPATIBILITY
     36# define SYSTEMC_VHDL_COMPATIBILITY
    3737#endif
    3838
    3939#if (defined(DEBUG))
    40 #  define DEBUG_TEST
     40# define DEBUG_TEST
     41#endif
     42
     43#if defined(MTI_SYSTEMC) and defined(SYSTEMC) and defined(VHDL)
     44# define MODELSIM_COSIMULATION
    4145#endif
    4246
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h

    r97 r113  
    3333#  define MSG_INFORMATION   _("[1;32m[INFORMATION][0m")
    3434#  define MSG_BREAKPOINT    _("[1;38m[   BREAK   ][0m")
     35#  define MSG_VHDL          _("[1;34m[   VHDL    ][0m")
    3536#else
    3637#  define MSG_DEBUG         _("[   DEBUG   ]")
     
    3940#  define MSG_INFORMATION   _("[INFORMATION]")
    4041#  define MSG_BREAKPOINT    _("[   BREAK   ]")
     42#  define MSG_VHDL          _("[   VHDL    ]")
    4143#endif
    4244
     
    8486
    8587#define msg(arg...)             fmsg(stdout,arg)
     88#define err(arg...)             fmsgError(stderr,arg)
     89
    8690#define msgDebug(arg...)        fmsgDebug(stdout,arg)
    8791#define msgError(arg...)        fmsgError(stdout,arg)
    8892#define msgWarning(arg...)      fmsgWarning(stdout,arg)
    8993#define msgInformation(arg...)  fmsgInformation(stdout,arg)
    90 #define err(arg...)             fmsgError(stderr,arg)
    9194
    9295}; // end namespace morpheo
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h

    r88 r113  
    1616#include "Common/include/ErrorMorpheo.h"
    1717#include "Common/include/ToString.h"
    18 
     18#include "Common/include/Systemc.h"
    1919namespace morpheo {
    2020
     
    2626inline void test_ko_error (void)
    2727{
    28   std::string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\"";
     28  std::string msg = morpheo::toString(_("Test ko : error in test \"%d\""),num_test);
    2929  throw (morpheo::ErrorMorpheo (msg));
    3030}
     
    3333inline void test_ko (char * file, uint32_t line, T exp1, T exp2)
    3434{
    35   fflush (stdout);
    36   fflush (stderr);
    37 
    38   std::cerr << "[" << num_test << "] : " << STR_KO
    39        << "\tline " << line                      << std::endl
    40        << " * Localisation"                      << std::endl
    41        << "   - File : " << file                 << std::endl
    42        << "   - Line : " << line                 << std::endl
    43        << " * Expression is different"           << std::endl
    44        << "   - exp1 : "+morpheo::toString(exp1) << std::endl
    45        << "   - exp2 : "+morpheo::toString(exp2) << std::endl;
     35  msgError(_("[%d] : %s\n"),num_test,STR_KO);
     36  msgError(_(" * Localisation\n"));
     37  msgError(_("   - File  : %s\n"),file);
     38  msgError(_("   - Line  : %d\n"),line);
     39  msgError(_(" * Expression is different\n"));
     40  msgError(_("   - exp1  : %s\n"),morpheo::toString(exp1).c_str());
     41  msgError(_("   - exp2  : %s\n"),morpheo::toString(exp2).c_str());
    4642
    4743  test_ko_error ();
     
    5046inline void test_ko (char * file, uint32_t line)
    5147{
    52   fflush (stdout);
    53   fflush (stderr);
    54 
    55   std::cerr << "[" << num_test << "] : " << STR_KO
    56        << "\tline " << line                           << std::endl
    57        << " * Localisation"                           << std::endl
    58        << "   - File : " << file                      << std::endl
    59        << "   - Line : " << line                      << std::endl;
     48  msgError(_("[%d] : %s\n"),num_test,STR_KO);
     49  msgError(_(" * Localisation\n"));
     50  msgError(_("   - File  : %s\n"),file);
     51  msgError(_("   - Line  : %d\n"),line);
    6052 
    6153  test_ko_error ();
     
    6456inline void test_ok ()
    6557{
    66   fflush (stdout);
    67   fflush (stderr);
    68 
    69   msg (_("[%d] : %s\n"), num_test,STR_OK);
     58  msgInformation (_("[%d] : %s\n"), num_test,STR_OK);
    7059
    7160  num_test ++;
     
    7463inline void test_ok (char * file, uint32_t line)
    7564{
    76   fflush (stdout);
    77   fflush (stderr);
    78 
    79   msg (_("[%d] : %s\n"), num_test,STR_OK);
    80   msg (_("\tline %d\n"), line);
     65  msgInformation (_("[%d] : %s (line %d)\n"), num_test,STR_OK,line);
     66  msgInformation (_("   - Line  : %d\n"), line);
    8167
    8268  num_test ++;
     
    8672inline void test_ok (char * file, uint32_t line, T exp)
    8773{
    88   fflush (stdout);
    89   fflush (stderr);
    90 
    91   msg (_("[%d] : %s\n"), num_test, STR_OK);
    92   msg (_("\tline %d\n"), line);
    93   msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str());
     74  msgInformation (_("[%d] : %s\n"), num_test, STR_OK);
     75  msgInformation (_("   - Line  : %d\n"), line);
     76  msgInformation (_("   - Value : %s\n"), (morpheo::toString(exp)).c_str());
    9477
    9578  num_test ++;
     
    11295#define LABEL(str...)                                                   \
    11396  {                                                                     \
    114     msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time()));       \
    115     msg (str);                                                          \
    116     msg (_("\n"));                                                      \
    117     fflush (stdout);                                                    \
     97    msgInformation (_("{%.0f} "),simulation_cycle());                \
     98    msg            (str);                                               \
     99    msg            (_("\n"));                                           \
    118100  } while(0)
    119101
     
    122104#endif
    123105
    124 #define SC_START(cycle_offset)                                          \
     106#define SC_CYCLE(cycle_offset)                                          \
    125107  do                                                                    \
    126108    {                                                                   \
    127       /*cout << "SC_START (begin)" << endl;*/                           \
     109      /*cout << "SC_CYCLE (begin)" << endl;*/                           \
    128110                                                                        \
    129       uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \
     111      double cycle_current = simulation_cycle();                        \
    130112      if (cycle_offset != 0)                                            \
    131113        {                                                               \
    132           cout << "##########[ cycle "<< cycle_current+cycle_offset << " ] (" << __LINE__ << ")" << endl; \
     114          msgInformation(_("##########[ cycle %.0f ] (%d)\n"),cycle_current+cycle_offset,__LINE__); \
    133115        }                                                               \
    134116                                                                        \
     
    138120        }                                                               \
    139121                                                                        \
    140       sc_start(cycle_offset);                                           \
     122      simulation_run(cycle_offset);                                     \
    141123                                                                        \
    142       /*cout << "SC_START (end  )" << endl;*/                           \
     124      /*cout << "SC_CYCLE (end  )" << endl;*/                           \
    143125    } while(0)
    144126
    145 
     127// old support
     128#ifndef MTI_SYSTEMC
     129# define SC_START(x) SC_CYCLE(x)
     130#endif
    146131
    147132};
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h

    r97 r113  
    99#include <iostream>
    1010#include <sys/time.h>
     11#include "Common/include/Systemc.h"
    1112
    1213namespace morpheo {
     
    2829  {
    2930#ifdef SYSTEMC
    30     nb_cycles_begin = sc_simulation_time();
     31    nb_cycles_begin = simulation_cycle();
    3132#endif
    3233    gettimeofday(&time_begin,NULL);
     
    4849    if (x.systemc)
    4950      {
    50         double nb_cycles_end = sc_simulation_time();
     51        double nb_cycles_end = simulation_cycle();
    5152        double average       = static_cast<double>(nb_cycles_end-x.nb_cycles_begin+1) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec+1);
    5253       
  • trunk/IPs/systemC/processor/Morpheo/Common/src/MemCheck.cpp

    r112 r113  
    1010// Global flags set by macros in MemCheck.h
    1111bool traceFlag  = false;
    12 bool activeFlag = true;
     12bool activeFlag = false;
    1313
    1414namespace {
Note: See TracChangeset for help on using the changeset viewer.