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

File:
1 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              }                                                         \
Note: See TracChangeset for help on using the changeset viewer.