Ignore:
Timestamp:
Jul 30, 2010, 4:47:27 PM (14 years ago)
Author:
rosiere
Message:
  • Add test for all configuration
  • RAT : add rat scheme (depth_save)
File:
1 edited

Legend:

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

    r137 r139  
    413413    } while (0)
    414414
    415 #define ALLOC1_SIGNAL_IN( sig, name, type, size)                        \
     415#define ALLOC1_SIGNAL_IN_COND( sig, name, type, size, cond)             \
    416416  do                                                                    \
    417417    {                                                                   \
     
    419419      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
    420420        {                                                               \
    421           if (size > 0)                                                 \
    422             {                                                           \
    423               sig [it1] = interface[it1]->set_signal_in <type> (name, size); \
    424             }                                                           \
    425           else                                                          \
    426             {                                                           \
    427               PRINT_SIZE_NUL(_component,interface[it1],name);           \
    428             }                                                           \
    429         }                                                               \
    430     } while (0)
    431 
    432 #define ALLOC1_SIGNAL_OUT(sig, name, type, size)                        \
     421          if (cond)                                                     \
     422            {                                                           \
     423              if (size > 0)                                             \
     424                {                                                       \
     425                  sig [it1] = interface[it1]->set_signal_in <type> (name, size); \
     426                }                                                       \
     427              else                                                      \
     428                {                                                       \
     429                  PRINT_SIZE_NUL(_component,interface[it1],name);       \
     430                }                                                       \
     431            }                                                           \
     432        }                                                               \
     433    } while (0)
     434
     435#define ALLOC1_SIGNAL_OUT_COND(sig, name, type, size, cond)             \
    433436  do                                                                    \
    434437    {                                                                   \
     
    436439      for (uint32_t it1=0; it1<iterator_1; it1++)                       \
    437440        {                                                               \
    438           if (size > 0)                                                 \
    439             {                                                           \
    440               sig [it1] = interface[it1]->set_signal_out<type> (name, size); \
    441             }                                                           \
    442           else                                                          \
    443             {                                                           \
    444               PRINT_SIZE_NUL(_component,interface[it1],name);           \
    445             }                                                           \
    446         }                                                               \
    447     } while (0)
    448 
    449 #define DELETE1_SIGNAL(sig, x1, size)                                   \
    450   do                                                                    \
    451     {                                                                   \
    452       for (uint32_t it1=0; it1<x1; it1++)                               \
    453         {                                                               \
    454           if (size > 0)                                                 \
    455             {                                                           \
    456               delete sig[it1];                                          \
     441          if (cond)                                                     \
     442            {                                                           \
     443              if (size > 0)                                             \
     444                {                                                       \
     445                  sig [it1] = interface[it1]->set_signal_out<type> (name, size); \
     446                }                                                       \
     447              else                                                      \
     448                {                                                       \
     449                  PRINT_SIZE_NUL(_component,interface[it1],name);       \
     450                }                                                       \
     451            }                                                           \
     452        }                                                               \
     453    } while (0)
     454
     455#define ALLOC1_SIGNAL_IN( sig, name, type, size) ALLOC1_SIGNAL_IN_COND( sig, name, type, size,true)
     456#define ALLOC1_SIGNAL_OUT(sig, name, type, size) ALLOC1_SIGNAL_OUT_COND(sig, name, type, size,true)
     457
     458#define DELETE1_SIGNAL_COND(sig, x1, size, cond)                        \
     459  do                                                                    \
     460    {                                                                   \
     461      for (uint32_t it1=0; it1<x1; it1++)                               \
     462        {                                                               \
     463          if (cond)                                                     \
     464            {                                                           \
     465              if (size > 0)                                             \
     466                {                                                       \
     467                  delete sig[it1];                                      \
     468                }                                                       \
    457469            }                                                           \
    458470        }                                                               \
    459471      delete [] sig;                                                    \
    460472    } while (0)
     473
     474#define DELETE1_SIGNAL(sig, x1, size) DELETE1_SIGNAL_COND(sig, x1, size, true)
    461475
    462476#define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1)   \
     
    661675    } while (0)
    662676
    663 #define _ALLOC2_SIGNAL_IN( sig, name, type, size, x1, x2)               \
     677#define _ALLOC2_SIGNAL_IN_COND( sig, name, type, size, x1, x2, cond)    \
    664678  do                                                                    \
    665679    {                                                                   \
     
    670684          for (uint32_t it2=0; it2<x2; it2++)                           \
    671685            {                                                           \
    672               if (size > 0)                                             \
    673                 {                                                       \
    674                   sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \
    675                 }                                                       \
    676               else                                                      \
    677                 {                                                       \
    678                   PRINT_SIZE_NUL(_component,interface[it1][it2],name);  \
    679                 }                                                       \
    680             }                                                           \
    681         }                                                               \
    682     } while (0)
    683 
    684 #define _ALLOC2_SIGNAL_OUT( sig, name, type, size, x1, x2)              \
     686              if (cond)                                                 \
     687                {                                                       \
     688                  if (size > 0)                                         \
     689                    {                                                   \
     690                      sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \
     691                    }                                                   \
     692                  else                                                  \
     693                    {                                                   \
     694                      PRINT_SIZE_NUL(_component,interface[it1][it2],name); \
     695                    }                                                   \
     696                }                                                       \
     697            }                                                           \
     698        }                                                               \
     699    } while (0)
     700
     701#define _ALLOC2_SIGNAL_OUT_COND( sig, name, type, size, x1, x2, cond)   \
    685702  do                                                                    \
    686703    {                                                                   \
     
    691708          for (uint32_t it2=0; it2<x2; it2++)                           \
    692709            {                                                           \
    693               if (size > 0)                                             \
    694                 {                                                       \
    695                   sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \
    696                 }                                                       \
    697               else                                                      \
    698                 {                                                       \
    699                   PRINT_SIZE_NUL(_component,interface[it1][it2],name);  \
    700                 }                                                       \
    701             }                                                           \
    702         }                                                               \
    703     } while (0)
    704 
    705 #define ALLOC2_VAL_ACK_IN( sig, name, type      ) _ALLOC2_VAL_ACK_IN( sig, name, type      , iterator_1, iterator_2)
    706 #define ALLOC2_VAL_ACK_OUT(sig, name, type      ) _ALLOC2_VAL_ACK_OUT(sig, name, type      , iterator_1, iterator_2)
    707 #define ALLOC2_VALACK_IN(  sig,       type      ) _ALLOC2_VALACK_IN(  sig,       type      , iterator_1, iterator_2)
    708 #define ALLOC2_VALACK_OUT( sig,       type      ) _ALLOC2_VALACK_OUT( sig,       type      , iterator_1, iterator_2)
    709 #define ALLOC2_SIGNAL_IN(  sig, name, type, size) _ALLOC2_SIGNAL_IN(  sig, name, type, size, iterator_1, iterator_2)
    710 #define ALLOC2_SIGNAL_OUT( sig, name, type, size) _ALLOC2_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2)
    711 
    712 #define DELETE2_SIGNAL(sig, x1,x2, size)                                \
    713   do                                                                    \
    714     {                                                                   \
    715       for (uint32_t it1=0; it1<x1; it1++)                               \
    716         {                                                               \
    717           for (uint32_t it2=0; it2<x2; it2++)                           \
    718             {                                                           \
    719               if (size > 0)                                             \
    720                 {                                                       \
    721                   delete sig[it1][it2];                                 \
     710              if (cond)                                                 \
     711                {                                                       \
     712                  if (size > 0)                                         \
     713                    {                                                   \
     714                      sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \
     715                    }                                                   \
     716                  else                                                  \
     717                    {                                                   \
     718                      PRINT_SIZE_NUL(_component,interface[it1][it2],name); \
     719                    }                                                   \
     720                }                                                       \
     721            }                                                           \
     722        }                                                               \
     723    } while (0)
     724
     725#define _ALLOC2_SIGNAL_IN( sig, name, type, size, x1, x2) _ALLOC2_SIGNAL_IN_COND( sig, name, type, size, x1, x2,true)
     726#define _ALLOC2_SIGNAL_OUT(sig, name, type, size, x1, x2) _ALLOC2_SIGNAL_OUT_COND(sig, name, type, size, x1, x2,true)
     727
     728#define ALLOC2_VAL_ACK_IN( sig, name, type      )         _ALLOC2_VAL_ACK_IN( sig, name, type      , iterator_1, iterator_2)
     729#define ALLOC2_VAL_ACK_OUT(sig, name, type      )         _ALLOC2_VAL_ACK_OUT(sig, name, type      , iterator_1, iterator_2)
     730#define ALLOC2_VALACK_IN(  sig,       type      )         _ALLOC2_VALACK_IN(  sig,       type      , iterator_1, iterator_2)
     731#define ALLOC2_VALACK_OUT( sig,       type      )         _ALLOC2_VALACK_OUT( sig,       type      , iterator_1, iterator_2)
     732#define ALLOC2_SIGNAL_IN(  sig, name, type, size)         _ALLOC2_SIGNAL_IN(  sig, name, type, size, iterator_1, iterator_2)
     733#define ALLOC2_SIGNAL_OUT( sig, name, type, size)         _ALLOC2_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2)
     734
     735#define DELETE2_SIGNAL_COND(sig, x1,x2, size, cond)                     \
     736  do                                                                    \
     737    {                                                                   \
     738      for (uint32_t it1=0; it1<x1; it1++)                               \
     739        {                                                               \
     740          for (uint32_t it2=0; it2<x2; it2++)                           \
     741            {                                                           \
     742              if (cond)                                                 \
     743                {                                                       \
     744                  if (size > 0)                                         \
     745                    {                                                   \
     746                      delete sig[it1][it2];                             \
     747                    }                                                   \
    722748                }                                                       \
    723749            }                                                           \
     
    726752      delete [] sig;                                                    \
    727753    } while (0)
     754
     755#define DELETE2_SIGNAL(sig, x1,x2, size) DELETE2_SIGNAL_COND(sig, x1,x2, size,true)
    728756
    729757#define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \
Note: See TracChangeset for help on using the changeset viewer.