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/Types.h

    r138 r139  
    120120    } Tmanage_event_t;
    121121
     122  typedef enum
     123    {
     124      RAT_NO_SAVE     , // Rat without save
     125      RAT_ONE_SAVE    , // Rat with one save
     126      RAT_DEPTH_SAVE    // RAT with multiple save (depth)
     127    } Trat_scheme_t;
     128
    122129  //--------------------------------------------------[ instruction ]-----
    123130  class instruction_t
     
    307314  };
    308315
     316  template<> inline std::string toString<morpheo::behavioural::Trat_scheme_t>(const morpheo::behavioural::Trat_scheme_t& x)
     317  {
     318    switch (x)
     319      {
     320      case morpheo::behavioural::RAT_NO_SAVE    : return "rat_no_save"   ; break;
     321      case morpheo::behavioural::RAT_ONE_SAVE   : return "rat_one_save"  ; break;
     322      case morpheo::behavioural::RAT_DEPTH_SAVE : return "rat_depth_save"; break;
     323      default    : return ""      ; break;
     324      }
     325  };
     326
     327  template<> inline morpheo::behavioural::Trat_scheme_t fromString<morpheo::behavioural::Trat_scheme_t>(const std::string& x)
     328  {
     329    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::RAT_NO_SAVE   ))) == 0) or
     330        (x.compare(toString(                      morpheo::behavioural::RAT_NO_SAVE    )) == 0))
     331      return morpheo::behavioural::RAT_NO_SAVE;
     332
     333    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::RAT_ONE_SAVE  ))) == 0) or
     334        (x.compare(toString(                      morpheo::behavioural::RAT_ONE_SAVE   )) == 0))
     335      return morpheo::behavioural::RAT_ONE_SAVE;
     336
     337    if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::RAT_DEPTH_SAVE))) == 0) or
     338        (x.compare(toString(                      morpheo::behavioural::RAT_DEPTH_SAVE )) == 0))
     339      return morpheo::behavioural::RAT_DEPTH_SAVE;
     340
     341    throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\""));
     342  };
     343
    309344}; // end namespace morpheo             
    310345#endif
Note: See TracChangeset for help on using the changeset viewer.