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/include
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h

    r112 r113  
    101101#define PRINT_SIZE_NUL(component,interface,signal) log_printf(TRACE,Allocation,FUNCTION,_("<%s> %s.%s.%s : size is nul."),_name.c_str(),component->get_name().c_str(),interface->get_name().c_str(),signal);
    102102#define TEST_SIGNAL(name,address) PRINT_SIGNAL_ADDRESS(name,address); TEST_PTR(address)
     103#define INSTANCE_FOREIGN_PRINT(name) log_printf(TRACE,Allocation,FUNCTION,"<%s> : %s (%s, %d)",_name.c_str(),name,__FILE__,__LINE__);
    103104
    104105// ----------------------------------------------------------------------
     
    106107// ----------------------------------------------------------------------
    107108
    108 
    109 #define __ALLOC0_SIGNAL(sig, name, type)         \
     109#define __ALLOC0_SIGNAL(sig, name, type)        \
    110110  {                                             \
    111111    sig = new type (name);                      \
     
    113113
    114114#ifdef POSITION
    115 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str)            \
     115#define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str)     \
    116116  INTERFACE_PRINT(name);                                                \
    117117  morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name, direction, localisation, str);
    118118#else
    119 #define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str)            \
     119#define ALLOC0_INTERFACE_BEGIN( name, direction, localisation, str)     \
    120120  INTERFACE_PRINT(name);                                                \
    121121  morpheo::behavioural::Interface_fifo * interface = _interfaces->set_interface( name);
     
    124124#define ALLOC0_INTERFACE_END()
    125125
    126 #define ALLOC0_VAL_ACK_IN(  sig, name, type)                             \
     126#define ALLOC0_VAL_ACK_IN(  sig, name, type)                            \
    127127  {                                                                     \
    128128    sig = interface->set_signal_valack_in (name, type);                 \
    129129  }                                                                     
    130 #define ALLOC0_VAL_ACK_OUT( sig, name, type)                             \
     130#define ALLOC0_VAL_ACK_OUT( sig, name, type)                            \
    131131  {                                                                     \
    132132    sig = interface->set_signal_valack_out(name, type);                 \
    133133  }                                                                     
    134 #define ALLOC0_VALACK_IN(     sig, type)                                 \
     134#define ALLOC0_VALACK_IN(     sig, type)                                \
    135135  {                                                                     \
    136136    sig = interface->set_signal_valack_in (type);                       \
     
    160160    }
    161161
    162 #define DELETE0_SIGNAL( sig, size)                                       \
     162#define DELETE0_SIGNAL( sig, size)                                      \
    163163  if (size > 0)                                                         \
    164164    {                                                                   \
     
    166166    }
    167167
    168 #define ALLOC0_SC_SIGNAL(  sig, name, type)                              \
    169   sc_signal<type> * sig = new sc_signal<type> (name);                   \
     168#define ALLOC0_FOREIGN_SIGNAL_IN(  sig, interface, name, type, size)    \
     169  if (size > 0)                                                         \
     170    {                                                                   \
     171      std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \
     172      sig = new SC_IN    (type) (str.c_str());                          \
     173    }
     174
     175#define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size)    \
     176  if (size > 0)                                                         \
     177    {                                                                   \
     178      std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \
     179      sig = new SC_OUT   (type) (str.c_str());                          \
     180    }
     181
     182#define DELETE0_FOREIGN_SIGNAL( sig, size) \
     183  {                                        \
     184    DELETE0_SIGNAL(sig,size);              \
     185  }
     186
     187#define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size)      \
     188  if (size > 0)                                                         \
     189    {                                                                   \
     190      INSTANCE_FOREIGN_PRINT(name);                                     \
     191      _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \
     192    }
     193
     194#define ALLOC0_SC_SIGNAL(  sig, name, type)                             \
     195  sig = new sc_signal<type> (name);                                     \
    170196  PRINT_SIGNAL_ADDRESS(name,sig);
    171197
    172 #define INSTANCE0_SC_SIGNAL(component, sig)                     \
     198#define INSTANCE0_SC_SIGNAL(component, sig)                    \
    173199  {                                                            \
    174200    TEST_SIGNAL(component->sig->name(),component->sig);        \
     
    177203  }
    178204
    179 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2)                       \
     205#define _INSTANCE0_SC_SIGNAL(component, sig1,sig2)                      \
    180206  {                                                                     \
    181207    TEST_SIGNAL(component->sig1->name(),component->sig1);               \
     
    185211
    186212#define DELETE0_SC_SIGNAL( sig)                  \
    187   {                                             \
    188     delete sig;                                 \
     213  {                                              \
     214    PRINT_SIGNAL_ADDRESS("",sig);                \
     215    delete sig;                                  \
    189216  }
    190217
     
    326353  }
    327354
     355#define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1)   \
     356  {                                                                     \
     357    sig = new SC_IN (type) * [x1];                                   \
     358    for (uint32_t it1=0; it1<x1; it1++)                                 \
     359      if (size > 0)                                                     \
     360        {                                                               \
     361          std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \
     362          sig [it1] = new SC_IN (type) (str.c_str());                   \
     363        }                                                               \
     364  }
     365
     366#define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1)  \
     367  {                                                                     \
     368    sig = new SC_OUT (type) * [x1];                                     \
     369    for (uint32_t it1=0; it1<x1; it1++)                                 \
     370      if (size > 0)                                                     \
     371        {                                                               \
     372          std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \
     373          sig [it1] = new SC_OUT (type) (str.c_str());                  \
     374        }                                                               \
     375  }
     376
     377#define DELETE1_FOREIGN_SIGNAL( sig, size,x1)            \
     378  {                                                      \
     379    DELETE1_SIGNAL(sig,x1,size);                         \
     380  }
     381
    328382#define ALLOC1_SC_SIGNAL( sig, name, type, x1)                          \
    329   sc_signal<type> ** sig = new sc_signal<type> * [x1];                  \
     383  sig = new sc_signal<type> * [x1];                                     \
    330384  {                                                                     \
    331385    std::string separator="_";                                          \
     
    359413    for (uint32_t it1=0; it1<x1; it1++)                                 \
    360414      {                                                                 \
     415        PRINT_SIGNAL_ADDRESS("",sig[it1]);                         \
    361416        delete sig[it1];                                                \
    362417      }                                                                 \
     
    530585  }
    531586
     587
     588#define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \
     589  {                                                                     \
     590    sig = new SC_IN (type) ** [x1];                                     \
     591    for (uint32_t it1=0; it1<x1; it1++)                                 \
     592      {                                                                 \
     593        sig [it1] = new SC_IN (type) * [x2];                            \
     594        for (uint32_t it2=0; it2<x2; it2++)                             \
     595          if (size > 0)                                                 \
     596            {                                                           \
     597              std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \
     598              sig [it1][it2] = new SC_IN    (type) (str.c_str()); \
     599            }                                                           \
     600      }                                                                 \
     601  }
     602
     603#define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \
     604  {                                                                     \
     605    sig = new SC_OUT (type) ** [x1];                                    \
     606    for (uint32_t it1=0; it1<x1; it1++)                                 \
     607      {                                                                 \
     608        sig [it1] = new SC_OUT (type) * [x2];                           \
     609        for (uint32_t it2=0; it2<x2; it2++)                             \
     610          if (size > 0)                                                 \
     611            {                                                           \
     612              std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \
     613              sig [it1][it2] = new SC_IN    (type) (str.c_str());       \
     614            }                                                           \
     615      }                                                                 \
     616  }
     617
     618#define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2)            \
     619  {                                                         \
     620    DELETE2_SIGNAL(sig,x1,x2,size);                         \
     621  }
     622
    532623#define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2)                      \
    533   sc_signal<type> *** sig = new sc_signal<type> ** [x1];                \
     624  sig = new sc_signal<type> ** [x1];                                    \
    534625  {                                                                     \
    535626    std::string separator="_";                                          \
     
    571662        for (uint32_t it2=0; it2<x2; it2++)                             \
    572663          {                                                             \
     664            PRINT_SIGNAL_ADDRESS("",sig[it1][it2]);                     \
    573665            delete sig[it1][it2];                                       \
    574666          }                                                             \
     
    758850  }
    759851
     852#define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3)     \
     853  {                                                                     \
     854    sig = new SC_IN (type) *** [x1];                                    \
     855    for (uint32_t it1=0; it1<x1; it1++)                                 \
     856      {                                                                 \
     857        sig [it1] = new SC_IN (type) ** [x2];                           \
     858        for (uint32_t it2=0; it2<x2; it2++)                             \
     859          {                                                             \
     860            sig [it1][it2] = new SC_IN (type) * [x3];                   \
     861            for (uint32_t it3=0; it3<x3; it3++)                         \
     862              if (size > 0)                                             \
     863                {                                                       \
     864                  std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \
     865                  sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \
     866                }                                                       \
     867          }                                                             \
     868      }                                                                 \
     869  }
     870
     871#define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3)    \
     872  {                                                                     \
     873    sig = new SC_OUT (type) *** [x1];                                   \
     874    for (uint32_t it1=0; it1<x1; it1++)                                 \
     875      {                                                                 \
     876        sig [it1] = new SC_OUT (type) ** [x2];                          \
     877        for (uint32_t it2=0; it2<x2; it2++)                             \
     878          {                                                             \
     879            sig [it1][it2] = new SC_OUT (type) * [x3];                  \
     880            for (uint32_t it3=0; it3<x3; it3++)                         \
     881              if (size > 0)                                             \
     882                {                                                       \
     883                  std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \
     884                  sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \
     885                }                                                       \
     886          }                                                             \
     887      }                                                                 \
     888  }
     889
     890#define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3)            \
     891  {                                                            \
     892    DELETE3_SIGNAL(sig,x1,x2,x3,size);                         \
     893  }
     894
    760895#define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3)                  \
    761   sc_signal<type> **** sig = new sc_signal<type> *** [x1];              \
     896  sig = new sc_signal<type> *** [x1];                                   \
    762897  {                                                                     \
    763898    std::string separator="_";                                          \
     
    807942            for (uint32_t it3=0; it3<x3; it3++)                         \
    808943              {                                                         \
     944                PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]);            \
    809945                delete sig[it1][it2][it3];                              \
    810946              }                                                         \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h

    r82 r113  
    7272    public : Entity    * _entity   ;
    7373    public : Tinstance_t _instance ;
     74    public : std::string _architecture;
    7475    } Tcomponent_t;   
    7576 
     
    102103#endif
    103104                                                       ,Tinstance_t instance=INSTANCE_ALL
     105                                                       ,std::string architecture=""
    104106                                                       );
    105107
     
    116118
    117119  private   : Signal *              signal_internal   (Entity * entity_productor,
    118                                                        Signal * signal_productor);
     120                                                       Signal * signal_productor,
     121                                                       Entity * entity_consumer,
     122                                                       Signal * signal_consumer);
    119123
    120124  public    : void                  port_map          (std::string component_src ,
     
    125129  public    : bool                  test_map          (bool recursive=true);
    126130  private   : bool                  test_map          (uint32_t depth, bool recursive);
     131
     132  public    : void *                get_sc_signal     (std::string component,
     133                                                       std::string port     );
     134//   public    : void                  set_sc_signal     (std::string component,
     135//                                                     std::string port     ,
     136//                                                        void *      sc_signal);
    127137
    128138//   public    : bool                  test_equi         (bool recursive=true);
     
    141151  public    : friend std::ostream&  operator<<        (std::ostream& output_stream,
    142152                                                       morpheo::behavioural::Component & x);
     153
     154
     155#undef  FUNCTION
     156#define FUNCTION "Component::set_sc_signal"
     157  public    : template <typename T>
     158  void set_sc_signal (std::string component,
     159                      std::string port     ,
     160                      void *      sc_signal)
     161    {
     162      log_begin(Behavioural,FUNCTION);
     163     
     164      std::string name_entity = _entity->get_name();
     165     
     166      Entity * entity = find_entity(component);
     167     
     168      if (entity == NULL)
     169        throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" is unknow.\n"));
     170     
     171      Signal * signal = entity->find_signal (port);
     172     
     173      if (signal == NULL)
     174        throw (ERRORMORPHEO (FUNCTION,"In component \""+name_entity+"\", the component \""+component+"\" have not the signal \""+port+"\".\n"));
     175     
     176      signal->alloc<T>(sc_signal);
     177     
     178      log_end(Behavioural,FUNCTION);
     179    };
    143180  };
    144181
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h

    r82 r113  
    5858  public    : std::string           get_name          (void);
    5959  public    : std::string           get_type          (void);
     60  public    : Tusage_t              get_usage         (void);
    6061
    6162#ifdef POSITION
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h

    r88 r113  
    9191
    9292#ifdef SYSTEMC
     93
     94#undef  FUNCTION
     95#define FUNCTION "Interface::set_signal_clk"
    9396  public    : sc_in_clk *           set_signal_clk       (std::string     name     ,
    9497                                                          uint32_t        size     ,
    9598                                                          presence_port_t presence_port=CLOCK_VHDL_YES)
    9699    {
    97       log_printf(FUNC,Behavioural,"set_signal_clk","Begin");
     100      log_begin(Behavioural,FUNCTION);
    98101
    99102      if ((presence_port != CLOCK_VHDL_YES) and
     
    101104        throw ErrorMorpheo ("Signal \""+name+"\" is a clock, bad presence_port.");
    102105
     106      LowerCase(name);
     107
    103108      Signal    * sig  = set_signal (name, IN , size, presence_port);
    104109      sc_in_clk * port;
    105110
    106       if (_usage & USE_SYSTEMC)
     111      if (_usage & USE_SYSTEMC_INTERFACE)
    107112        {
    108113          port = new sc_in_clk (sig->_name.c_str());
     
    114119        }
    115120
    116       log_printf(FUNC,Behavioural,"set_signal_clk","End");
    117 
    118       return port;
    119     };
    120 
     121      log_end(Behavioural,FUNCTION);
     122
     123      return port;
     124    };
     125
     126#undef  FUNCTION
     127#define FUNCTION "Interface::set_signal_in"
    121128  public    : template <typename T>
    122129              sc_in <T> *           set_signal_in       (std::string     name     ,
     
    124131                                                         presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
    125132    {
    126       log_printf(FUNC,Behavioural,"set_signal_in","Begin");
     133      log_begin(Behavioural,FUNCTION);
    127134
    128135      if ((presence_port == CLOCK_VHDL_YES) or
     
    130137        throw ErrorMorpheo ("Signal \""+name+"\" is not a clock, bad presence_port.");
    131138
     139      LowerCase(name);
     140
    132141      Signal    * sig  = set_signal (name, IN , size, presence_port);
    133142      sc_in <T> * port;
    134143
    135       if (_usage & USE_SYSTEMC)
     144      if (_usage & USE_SYSTEMC_INTERFACE)
    136145        {
    137146          port = new sc_in <T> (sig->_name.c_str());
     
    143152        }
    144153
    145       log_printf(FUNC,Behavioural,"set_signal_in","End");
    146 
    147       return port;
    148     };
    149 
     154      log_end(Behavioural,FUNCTION);
     155
     156      return port;
     157    };
     158
     159#undef  FUNCTION
     160#define FUNCTION "Interface::set_signal_out"
    150161  public    : template <typename T>
    151162              sc_out <T> *          set_signal_out      (std::string     name     ,
     
    153164                                                         presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
    154165    {
    155       log_printf(FUNC,Behavioural,"set_signal_out","Begin");
     166      log_begin(Behavioural,FUNCTION);
     167
     168      LowerCase(name);
    156169
    157170      if ((presence_port == CLOCK_VHDL_YES) or
     
    162175      sc_out <T> * port;
    163176
    164       if (_usage & USE_SYSTEMC)
     177      if (_usage & USE_SYSTEMC_INTERFACE)
    165178        {
    166179          port = new sc_out <T> (sig->_name.c_str());
     
    172185        }
    173186
    174       log_printf(FUNC,Behavioural,"set_signal_out","End");
    175 
    176       return port;
    177     };
    178 
     187      log_end(Behavioural,FUNCTION);
     188
     189      return port;
     190    };
     191
     192#undef  FUNCTION
     193#define FUNCTION "Interface::set_signal_internal"
    179194  public    : template <typename T>
    180195              sc_signal <T> *       set_signal_internal (std::string   name,
    181196                                                         uint32_t size)
    182197    {
    183       log_printf(FUNC,Behavioural,"set_signal_internal","Begin");
     198      log_begin(Behavioural,FUNCTION);
     199
     200      LowerCase(name);
    184201
    185202      Signal * sig = set_signal (name, INTERNAL , size, PORT_VHDL_NO_TESTBENCH_NO);
    186203      sc_signal <T> * port;
    187204
    188       if (_usage & USE_SYSTEMC)
     205      if (_usage & USE_SYSTEMC_INTERFACE)
    189206        {
    190207          port = new sc_signal <T> (sig->_name.c_str());
     
    196213        }
    197214
    198       log_printf(FUNC,Behavioural,"set_signal_internal","End");
     215      log_end(Behavioural,FUNCTION);
    199216
    200217      return port;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Model.h

    r112 r113  
    4040  public  : model_type_t      get_type  (std::string component);
    4141  public  : debug_verbosity_t get_debug (std::string component);
     42  public  : void              print     (void);
    4243  };
    4344 
    4445}; // end namespace behavioural         
     46
     47  template<> inline std::string toString<morpheo::behavioural::model_type_t>(const morpheo::behavioural::model_type_t& x)
     48  {
     49    switch (x)
     50      {
     51      case morpheo::behavioural::MODEL_SYSTEMC : return "systemc" ; break;
     52      case morpheo::behavioural::MODEL_VHDL    : return "vhdl"    ; break;
     53      default : return ""; break;
     54      }
     55  };
    4556
    4657  template<> inline morpheo::behavioural::model_type_t fromString<morpheo::behavioural::model_type_t>(const std::string& x)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h

    r88 r113  
    3333  class Parameters
    3434  {
     35  public   :        const std::string _type;
     36
    3537    // -----[ fields ]----------------------------------------------------
    3638  public   : static const uint32_t   _size_instruction              = 32;
     
    127129    // -----[ methods ]---------------------------------------------------
    128130  public   :                            Parameters (void);
     131  public   :                            Parameters (std::string type);
    129132  public   : virtual                   ~Parameters ();
    130133       
     
    132135  public   : virtual std::string        print       (uint32_t depth) = 0;
    133136  public   : virtual Parameters_test    msg_error   (void) = 0;
     137  public   : virtual std::string        id          (void) const {return "";}
    134138
    135139    // methods to copy depends parameters
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h

    r88 r113  
    55 * $Id$
    66 *
    7  * [ Description ]
     7 * [ Description ]
    88 *
    99 */
     
    9090  public    : type_info_t       get_type_info           (void);
    9191
     92  public    : void *            get_sc_signal           (void);
     93
    9294  public    : bool              presence_vhdl           (void);
    9395  public    : bool              presence_testbench      (void);
     
    174176      else
    175177        _type_info = UNKNOW;
    176 
     178     
    177179      log_printf(TRACE,Behavioural,FUNCTION, "Allocation of %s (%s, 0x%.8x)", _name.c_str(),toString(_type_info).c_str(), static_cast<uint32_t>(reinterpret_cast<uint64_t>(_sc_signal_map)));
    178180
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Usage.h

    r88 r113  
    22#define morpheo_behavioural_Usage_h
    33
     4#include "Common/include/Environment.h"
    45#include <stdint.h>
    56
     
    78namespace behavioural {
    89
    9   typedef uint8_t Tusage_t;
     10  typedef uint16_t Tusage_t;
    1011
    11 #  define USE_SYSTEMC               0x01
    12 #  define USE_VHDL                  0x02
    13 #  define USE_VHDL_TESTBENCH        0x04
    14 #  define USE_VHDL_TESTBENCH_ASSERT 0x08
    15 #  define USE_POSITION              0x10
    16 #  define USE_STATISTICS            0x20
    17 #  define USE_INFORMATION           0x40
    18 #  define USE_HEADER                0x80
    19 //#define USE_                      0x80
     12#  define USE_SYSTEMC               0x003
     13#  define USE_SYSTEMC_INTERFACE     0x001
     14#  define USE_SYSTEMC_BODY          0x002
     15#  define USE_VHDL                  0x004
     16#  define USE_VHDL_TESTBENCH        0x008
     17#  define USE_VHDL_TESTBENCH_ASSERT 0x010
     18#  define USE_POSITION              0x020
     19#  define USE_STATISTICS            0x040
     20//#define USE_INFORMATION           0x080
     21#  define USE_HEADER                0x100
     22#  define USE_COSIMULATION          0x200
     23//#define USE_                      0x400
    2024
    2125#  define USE_NONE                  0x00
    22 //#define USE_ALL                   0xff
    2326#  define USE_ALL                   usage_all()
    2427
    25 
     28#ifdef MODELSIM_COSIMULATION
     29  Tusage_t usage_cosimulation(Tusage_t usage);
     30#endif
    2631  Tusage_t usage_set         (Tusage_t usage, Tusage_t flag);
    2732  Tusage_t usage_unset       (Tusage_t usage, Tusage_t flag);
    2833  bool     usage_is_set      (Tusage_t usage, Tusage_t flag);
    29   void    usage_environment (Tusage_t usage);
     34  Tusage_t usage_environment (Tusage_t usage);
    3035  Tusage_t usage_all         (void);
    3136
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h

    r112 r113  
    1010#define MORPHEO_MAJOR_VERSION "0"
    1111#define MORPHEO_MINOR_VERSION "2"
    12 #define MORPHEO_REVISION      "112"
     12#define MORPHEO_REVISION      "113"
    1313#define MORPHEO_CODENAME      "Castor"
    1414
    15 #define MORPHEO_DATE_DAY      "18
    16 #define MORPHEO_DATE_MONTH    "03"
     15#define MORPHEO_DATE_DAY      "14
     16#define MORPHEO_DATE_MONTH    "04"
    1717#define MORPHEO_DATE_YEAR     "2009"
    1818
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h

    r98 r113  
    77 * $Id$
    88 *
    9  * [ Description ]
     9 * [ Description ]
    1010 *
    1111 */
     
    1414#include <iostream>
    1515#include <list>
     16#include <map>
    1617#include "Common/include/Environment.h"
    1718#include "Behavioural/include/Direction.h"
     
    2324  namespace behavioural          {
    2425
     26#define VHDL_EXTENSION ".vhdl"
     27
     28    typedef enum
     29      {
     30        VHDL_SEVERITY_NOTE   ,
     31        VHDL_SEVERITY_WARNING,
     32        VHDL_SEVERITY_ERROR  ,
     33        VHDL_SEVERITY_FAILURE
     34      } vhdl_severity_t;
     35   
    2536    std::string  std_logic        (uint32_t size);
    2637    std::string  std_logic_conv   (uint32_t size, std::string   value);
     
    3748    class Vhdl
    3849    {
    39       // -----[ fields ]----------------------------------------------------
    40     private   : const std::string     _name                         ;
    41 
    42     private   : std::list<std::string>     _list_library_work            ;
    43     private   : std::list<std::string>     _list_signal                  ;
    44     private   : std::list<std::string>     _list_type                    ;
    45     private   : std::list<std::string>     _list_alias                   ;
    46     private   : std::list<std::string>     _list_port                    ;
    47     private   : std::list<std::string>     _list_body                    ;
    48 
    49       // -----[ methods ]---------------------------------------------------
    50     public    :                  Vhdl                        (std::string name);
     50      typedef struct
     51      {
     52        std::list<std::string> _list_signal;
     53        std::list<std::string> _list_type  ;
     54        std::list<std::string> _list_alias ;
     55        std::list<std::string> _list_body  ;
     56        std::list<std::string> _list_debug ;
     57      } vhdl_architecture_t;
     58
     59      // -----[ fields ]----------------------------------------------------
     60    private   : const std::string                         _name;
     61    private   : const std::string                         _id;
     62
     63    private   : std::list<std::string>                    _list_library;
     64      // Entity
     65//  private   : std::string                               _port_clock;
     66    private   : std::list<std::string>                    _list_port;
     67      // Architecture
     68    public    : const std::string                         _name_architecture_default;
     69    private   :       std::string                         _name_architecture;
     70    private   : std::map<std::string,vhdl_architecture_t> _architecture;
     71
     72      // -----[ methods ]---------------------------------------------------
     73    public    :                  Vhdl                        (std::string name,
     74                                                              std::string id="");
    5175    public    :                  ~Vhdl                       ();
    5276
     
    6488    private   : std::string      get_model                   (uint32_t    depth                 ,
    6589                                                              std::string filename              ,
    66                                                               std::string entity_name           ,
    67                                                               std::string architecture_name     );
     90                                                              std::string entity_name           );
    6891    private   : std::string      get_header                  (uint32_t    depth                 ,
    6992                                                              std::string filename              );
    7093    private   : std::string      get_entity                  (uint32_t    depth                 ,
    7194                                                              std::string name                  );
     95    private   : void             test_architecture           (void);
     96    private   : std::string      test_architecture           (std::string name                  );
     97    public    : std::string      set_architecture            (std::string name                  );
    7298    private   : std::string      get_architecture            (uint32_t    depth                 ,
    73                                                               std::string name                  ,
    7499                                                              std::string entity_name           );
     100    private   : std::string      get_configuration           (uint32_t    depth                 ,
     101                                                              std::string entity_name           ,
     102                                                              std::string configuration_name    );
    75103    private   : std::string      get_component               (uint32_t    depth                 ,
    76104                                                              std::string name                  );
     
    83111                                                              direction_t direction             ,
    84112                                                              uint32_t    size                  );
     113//  public    : void             set_port_clock              (std::string name                  );
    85114    private   : std::string      get_signal                  (uint32_t    depth                 );
    86115    public    : void             set_signal                  (std::string name                  ,
     
    136165    public    : void             set_body_component          (std::string  name_instance        ,
    137166                                                              std::string  name_component       ,
     167                                                              std::string  name_architecture    ,
     168                                                              std::string  name_package         ,
    138169                                                              std::list<std::string>   list_port_map);
    139170    public    : void             set_body_component_port_map (std::list<std::string> & list_port_map,
     
    147178                                                              std::string  text                 );
    148179
    149     private   : std::string      get_library_ieee            (uint32_t     depth                );
    150     private   : std::string      get_library_work            (uint32_t     depth                );
     180    public    : void             set_debug                   (std::string  condition            ,
     181                                                              std::string  text                 ,
     182                                                              vhdl_severity_t severity = VHDL_SEVERITY_NOTE);
     183    private   : std::string      get_debug                   (uint32_t     depth                );
     184
     185    private   : std::string      get_library                 (uint32_t     depth                );
     186    private   : std::string      get_library_default         (uint32_t     depth                );
     187    private   : void             set_library_default         (void                              );
     188    public    : void             set_library                 (std::string  library_name         ,
     189                                                              std::string  package_name         ,
     190                                                              std::string  declarative_unit="all");
    151191    public    : void             set_library_work            (std::string  package_name         );
    152192
     
    154194    };
    155195
     196    std::string vhdl_get_id (std::string model_name);
     197
    156198  }; // end namespace behavioural         
     199
     200  template<> inline std::string toString<morpheo::behavioural::vhdl_severity_t>(const morpheo::behavioural::vhdl_severity_t& x)
     201  {
     202    switch (x)
     203      {
     204      case morpheo::behavioural::VHDL_SEVERITY_NOTE    : return "note"   ; break;
     205      case morpheo::behavioural::VHDL_SEVERITY_WARNING : return "warning"; break;
     206      case morpheo::behavioural::VHDL_SEVERITY_ERROR   : return "error"  ; break;
     207      case morpheo::behavioural::VHDL_SEVERITY_FAILURE : return "failure"; break;
     208      default : return ""; break;
     209      }
     210  };
     211
    157212}; // end namespace morpheo             
    158213
Note: See TracChangeset for help on using the changeset viewer.