Changeset 63 for trunk/IPs/systemC/processor/Morpheo/Common/include
- Timestamp:
- Dec 4, 2007, 2:33:31 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Common/include
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h
r2 r63 15 15 namespace morpheo { 16 16 17 // gen_mask ..................................... 18 17 // gen_mask .................................................................. 18 19 19 template <typename T> 20 20 T gen_mask (uint32_t size) … … 29 29 }; 30 30 31 // shift_left_logic, shift_right_logic .......... 31 // mask, mask_not ............................................................ 32 template <typename T> 33 T mask (uint32_t data, uint32_t index_max, uint32_t index_min) 34 { 35 return (gen_mask<T>(index_max-index_min+1)<<index_min) & data; 36 } 37 38 template <typename T> 39 T mask_not (uint32_t data, uint32_t index_max, uint32_t index_min) 40 { 41 return (~(gen_mask<T>(index_max-index_min+1)<<index_min)) & data; 42 } 43 44 // shift_left_logic, shift_right_logic ....................................... 32 45 template <typename T> 33 46 T shift_logic_left (uint32_t size, uint32_t data, uint32_t value) … … 46 59 } 47 60 48 // shift_logic .................................. 61 // shift_logic ............................................................... 49 62 template <typename T> 50 63 T shift_logic (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left) … … 56 69 } 57 70 58 // shift_left_arithmetic, shift_right_arithmetic 71 // shift_left_arithmetic, shift_right_arithmetic ............................. 59 72 template <typename T> 60 73 T shift_arithmetic_left (uint32_t size, uint32_t data, uint32_t value) … … 92 105 } 93 106 94 // shift_arithmetic ............................. 107 // shift_arithmetic .......................................................... 95 108 template <typename T> 96 109 T shift_arithmetic (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left) … … 102 115 } 103 116 104 // shift ........................................ 117 // shift ..................................................................... 105 118 template <typename T> 106 119 T shift (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left, bool is_shift_arithmetic) … … 112 125 } 113 126 114 // rotate_left, rotate_right .................... 127 // rotate_left, rotate_right ................................................. 115 128 116 129 template <typename T> … … 132 145 } 133 146 134 // rotate ....................................... 147 // rotate .................................................................... 135 148 template <typename T> 136 149 T rotate (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left) … … 142 155 } 143 156 144 // range ........................................ 157 // range ..................................................................... 145 158 template <typename T> 146 T range (uint32_t size, uint32_tdata, uint32_t index_max, uint32_t index_min)159 T range (uint32_t data, uint32_t index_max, uint32_t index_min) 147 160 { 148 return gen_mask<T>(index_max-index_min+1) & shift_logic_left<T> (size, data,index_min);161 return gen_mask<T>(index_max-index_min+1) & (data << index_min); 149 162 } 150 163 151 164 template <typename T> 152 T range (uint32_t size, uint32_tdata, uint32_t nb_bits)165 T range (uint32_t data, uint32_t nb_bits) 153 166 { 154 167 return gen_mask<T>(nb_bits) & data; 155 168 } 156 157 158 169 }; // end namespace morpheo 159 170 -
trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h
r43 r63 16 16 namespace morpheo { 17 17 18 void UpperCase(string& S)18 inline void UpperCase(string& S) 19 19 { 20 20 uint32_t n = S.size(); … … 27 27 } 28 28 29 void LowerCase(string& S)29 inline void LowerCase(string& S) 30 30 { 31 31 uint32_t n = S.size(); -
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
r44 r63 28 28 #ifdef DEBUG 29 29 //Debug 30 31 30 # define log_printf(level, component, func, str... ) \ 32 31 do \ 33 32 { \ 34 if ( (DEBUG == DEBUG_ALL) or \ 33 if ( (DEBUG == DEBUG_ALL ) or \ 34 (DEBUG_ ## level == DEBUG_NONE) or \ 35 35 (( DEBUG_ ## level <= DEBUG) and \ 36 36 ( DEBUG_ ## component == true )) ) \
Note: See TracChangeset
for help on using the changeset viewer.