Ignore:
Timestamp:
Dec 19, 2008, 4:34:00 PM (16 years ago)
Author:
rosiere
Message:

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

File:
1 edited

Legend:

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

    r88 r97  
    1616  [0][19] - SPR_CID
    1717*/
     18
     19#include "Common/include/ToString.h"
    1820
    1921namespace morpheo {
     
    3335
    3436  //=========================================================[ Type ]=====
    35 #  define TYPE_ALU                                 0x0        // 00000 - unit multiple
    36 #  define TYPE_SHIFT                               0x1        // 00000 - unit multiple
    37 #  define TYPE_MOVE                                0x2        // 00000 - unit multiple
    38 #  define TYPE_TEST                                0x3        // 00000 - unit multiple
    39 #  define TYPE_MUL                                 0x4        // 00000 - unit multiple
    40 #  define TYPE_DIV                                 0x5        // 00000 - unit multiple, type optionnal
    41 #  define TYPE_EXTEND                              0x6        // 00000 - unit multiple, type optionnal
    42 #  define TYPE_FIND                                0x7        // 00000 - unit multiple, type optionnal
    43 #  define TYPE_SPECIAL                             0x8        // 00000 - unit uniq
    44 #  define TYPE_CUSTOM                              0x9        // 00000 - unit uniq    , type optionnal
    45 #  define TYPE_BRANCH                              0xa        // 00000 - unit multiple
    46 #  define TYPE_MEMORY                              0xb        // 00000 - unit uniq
     37typedef enum
     38  {
     39    TYPE_ALU                               = 0x0,       // 00000 - unit multiple
     40    TYPE_SHIFT                             = 0x1,       // 00000 - unit multiple
     41    TYPE_MOVE                              = 0x2,       // 00000 - unit multiple
     42    TYPE_TEST                              = 0x3,       // 00000 - unit multiple
     43    TYPE_MUL                               = 0x4,       // 00000 - unit multiple
     44    TYPE_DIV                               = 0x5,       // 00000 - unit multiple, type optionnal
     45    TYPE_EXTEND                            = 0x6,       // 00000 - unit multiple, type optionnal
     46    TYPE_FIND                              = 0x7,       // 00000 - unit multiple, type optionnal
     47    TYPE_SPECIAL                           = 0x8,       // 00000 - unit uniq
     48    TYPE_CUSTOM                            = 0x9,       // 00000 - unit uniq    , type optionnal
     49    TYPE_BRANCH                            = 0xa,       // 00000 - unit multiple
     50    TYPE_MEMORY                            = 0xb        // 00000 - unit uniq
     51  } type_t;
    4752
    4853//#define NB_TYPE                                  11
     
    610615
    611616#  define SIZE_BRANCH_CONDITION                    4
    612 
    613 #  define BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          0x0        // None condition (jump)
    614 #  define BRANCH_CONDITION_NONE_WITH_WRITE_STACK             0x8        // None condition (jump)
    615 #  define BRANCH_CONDITION_FLAG_UNSET                        0x2        // Branch if Flag is clear
    616 #  define BRANCH_CONDITION_FLAG_SET                          0x3        // Branch if Flag is set
    617 #  define BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK 0x4        // Branch if a register is read
    618 #  define BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    0xc        // Branch if a register is read
    619 #  define BRANCH_CONDITION_READ_STACK                        0xf        // Branch with pop  in stack pointer
    620 
     617#  define MAX_BRANCH_CONDITION                     (1<<SIZE_BRANCH_CONDITION)
     618  typedef enum
     619    {
     620      BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          = 0x0,        // None condition (jump)
     621      BRANCH_CONDITION_NONE_WITH_WRITE_STACK             = 0x8,        // None condition (jump)
     622      BRANCH_CONDITION_FLAG_UNSET                        = 0x2,        // Branch if Flag is clear
     623      BRANCH_CONDITION_FLAG_SET                          = 0x3,        // Branch if Flag is set
     624      BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK = 0x4,        // Branch if a register is read
     625      BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    = 0xc,        // Branch if a register is read
     626      BRANCH_CONDITION_READ_STACK                        = 0xf         // Branch with pop  in stack pointer
     627    } branch_condition_t;
     628
     629#  define is_branch_condition_valid(x)                           \
     630  (( x == BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK         ) or \
     631   ( x == BRANCH_CONDITION_NONE_WITH_WRITE_STACK            ) or \
     632   ( x == BRANCH_CONDITION_FLAG_UNSET                       ) or \
     633   ( x == BRANCH_CONDITION_FLAG_SET                         ) or \
     634   ( x == BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK) or \
     635   ( x == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK   ) or \
     636   ( x == BRANCH_CONDITION_READ_STACK                       ))
     637
     638
     639  /*
     640enum
     641  {
     642    BRANCH_TYPE_SEQUENTIAL,
     643    BRANCH_TYPE_JUMP,
     644    BRANCH_TYPE_CONDITIONNAL,
     645    BRANCH_TYPE_REGISTER,
     646    BRANCH_TYPE_CALL,
     647    BRANCH_TYPE_RETURN,
     648    NB_BRANCH_TYPE
     649  };
     650
     651#  define branch_condition_to_type(x)                                   \
     652  (x == BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK         )?BRANCH_TYPE_JUMP: \
     653  ((x == BRANCH_CONDITION_NONE_WITH_WRITE_STACK            )?BRANCH_TYPE_CALL: \
     654   ((x == BRANCH_CONDITION_FLAG_UNSET                       )?BRANCH_TYPE_CONDITIONNAL: \
     655    ((x == BRANCH_CONDITION_FLAG_SET                         )?BRANCH_TYPE_CONDITIONNAL: \
     656     ((x == BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK)?BRANCH_TYPE_REGISTER: \
     657      ((x == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK   )?BRANCH_TYPE_CALL: \
     658       ((x == BRANCH_CONDITION_READ_STACK                       )?BRANCH_TYPE_RETURN:BRANCH_TYPE_SEQUENTIAL))))));
     659  */
     660 
    621661  //--------------------------------------------------[ instruction ]-----
    622662#  define NB_INSTRUCTION                           213        // 92 ORBIS, 30 ORFPX (15 simple, 15 double), 91 ORVDX (38 on byte, 41 on half, 12 independant format)
     
    9911031
    9921032}; // end namespace behavioural
     1033
     1034  template<> inline std::string toString<morpheo::behavioural::type_t>(const morpheo::behavioural::type_t& x)
     1035  {
     1036    switch (x)
     1037      {
     1038      case morpheo::behavioural::TYPE_ALU     : return "ALU"        ;
     1039      case morpheo::behavioural::TYPE_SHIFT   : return "SHIFT"      ;
     1040      case morpheo::behavioural::TYPE_MOVE    : return "MOVE"       ;
     1041      case morpheo::behavioural::TYPE_TEST    : return "TEST"       ;
     1042      case morpheo::behavioural::TYPE_MUL     : return "MUL"        ;
     1043      case morpheo::behavioural::TYPE_DIV     : return "DIV"        ;
     1044      case morpheo::behavioural::TYPE_EXTEND  : return "EXTEND"     ;
     1045      case morpheo::behavioural::TYPE_FIND    : return "FIND"       ;
     1046      case morpheo::behavioural::TYPE_SPECIAL : return "SPECIAL"    ;
     1047      case morpheo::behavioural::TYPE_CUSTOM  : return "CUSTOM"     ;
     1048      case morpheo::behavioural::TYPE_BRANCH  : return "BRANCH"     ;
     1049      case morpheo::behavioural::TYPE_MEMORY  : return "MEMORY"     ;
     1050      default : return "";
     1051      }
     1052  };
     1053
     1054  template<> inline std::string toString<morpheo::behavioural::branch_condition_t>(const morpheo::behavioural::branch_condition_t& x)
     1055  {
     1056    switch (x)
     1057      {
     1058      case morpheo::behavioural::BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK          : return "none_without_write_stack"         ;
     1059      case morpheo::behavioural::BRANCH_CONDITION_NONE_WITH_WRITE_STACK             : return "none_with_write_stack"            ;
     1060      case morpheo::behavioural::BRANCH_CONDITION_FLAG_UNSET                        : return "flag_unset"                       ;
     1061      case morpheo::behavioural::BRANCH_CONDITION_FLAG_SET                          : return "flag_set"                         ;
     1062      case morpheo::behavioural::BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK : return "read_register_without_write_stack";
     1063      case morpheo::behavioural::BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK    : return "read_register_with_write_stack"   ;
     1064      case morpheo::behavioural::BRANCH_CONDITION_READ_STACK                        : return "read_stack"                       ;
     1065      default : return "";
     1066      }
     1067  };
     1068
    9931069}; // end namespace morpheo             
    9941070
Note: See TracChangeset for help on using the changeset viewer.