Changeset 145 for trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Timestamp:
- Oct 13, 2010, 8:15:51 PM (14 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
r139 r145 14 14 // =====[ ALLOCATION / DELETE of ARRAY ]================================= 15 15 // ====================================================================== 16 #define ALLOC0 (var,type)\16 #define ALLOC0_COND(var,type,cond) \ 17 17 do \ 18 18 { \ 19 var = new type; \ 20 } while (0) 21 22 #define ALLOC1(var,type,s1) \ 19 if (cond) \ 20 var = new type; \ 21 } while (0) 22 23 24 #define ALLOC1_COND(var,type,s1,cond) \ 23 25 do \ 24 26 { \ 25 var = new type [s1]; \ 26 } while (0) 27 28 #define ALLOC2(var,type,s1,s2) \ 27 if (cond) \ 28 var = new type [s1]; \ 29 } while (0) 30 31 32 #define ALLOC2_COND(var,type,s1,s2,cond) \ 29 33 do \ 30 34 { \ … … 32 36 for (uint32_t it1=0; it1<s1; ++it1) \ 33 37 { \ 34 var [it1] = new type [s2]; \ 38 if (cond) \ 39 var [it1] = new type [s2]; \ 35 40 } \ 36 41 } while (0) 37 42 38 #define ALLOC3 (var,type,s1,s2,s3)\43 #define ALLOC3_COND(var,type,s1,s2,s3,cond) \ 39 44 do \ 40 45 { \ … … 45 50 for (uint32_t it2=0; it2<s2; ++it2) \ 46 51 { \ 47 var [it1][it2] = new type [s3]; \ 52 if (cond) \ 53 var [it1][it2] = new type [s3]; \ 48 54 } \ 49 55 } \ 50 56 } while (0) 51 57 52 #define ALLOC4(var,type,s1,s2,s3,s4) \ 53 do \ 54 { \ 55 var = new type *** [s1]; \ 56 for (uint32_t it1=0; it1<s1; ++it1) \ 57 { \ 58 var [it1] = new type ** [s2]; \ 59 for (uint32_t it2=0; it2<s2; ++it2) \ 60 { \ 61 var [it1][it2] = new type * [s3]; \ 62 for (uint32_t it3=0; it3<s3; ++it3) \ 63 { \ 64 var [it1][it2][it3] = new type [s4]; \ 65 } \ 66 } \ 67 } \ 68 } while (0) 69 70 #define DELETE0(var) \ 58 #define ALLOC4_COND(var,type,s1,s2,s3,s4,cond) \ 59 do \ 60 { \ 61 var = new type *** [s1]; \ 62 for (uint32_t it1=0; it1<s1; ++it1) \ 63 { \ 64 var [it1] = new type ** [s2]; \ 65 for (uint32_t it2=0; it2<s2; ++it2) \ 66 { \ 67 var [it1][it2] = new type * [s3]; \ 68 for (uint32_t it3=0; it3<s3; ++it3) \ 69 { \ 70 if (cond) \ 71 var [it1][it2][it3] = new type [s4]; \ 72 } \ 73 } \ 74 } \ 75 } while (0) 76 77 #define ALLOC0(var,type) ALLOC0_COND(var,type,true) 78 #define ALLOC1(var,type,s1) ALLOC1_COND(var,type,s1,true) 79 #define ALLOC2(var,type,s1,s2) ALLOC2_COND(var,type,s1,s2,true) 80 #define ALLOC3(var,type,s1,s2,s3) ALLOC3_COND(var,type,s1,s2,s3,true) 81 #define ALLOC4(var,type,s1,s2,s3,s4) ALLOC4_COND(var,type,s1,s2,s3,s4,true) 82 83 84 #define DELETE0_COND(var,cond) \ 71 85 do \ 72 86 { \ 73 delete var; \ 74 } while (0) 75 76 #define DELETE1(var,s1) \ 87 if (cond) \ 88 delete var; \ 89 } while (0) 90 91 #define DELETE1_COND(var,s1,cond) \ 77 92 do \ 78 93 { \ 79 delete [] var; \ 80 } while (0) 81 82 #define DELETE2(var,s1,s2) \ 94 if (cond) \ 95 delete [] var; \ 96 } while (0) 97 98 #define DELETE2_COND(var,s1,s2,cond) \ 83 99 do \ 84 100 { \ 85 101 for (uint32_t it1=0; it1<s1; ++it1) \ 86 102 { \ 87 delete [] var [it1]; \ 103 if (cond) \ 104 delete [] var [it1]; \ 88 105 } \ 89 106 delete [] var; \ 90 107 } while (0) 91 108 92 #define DELETE3 (var,s1,s2,s3)\109 #define DELETE3_COND(var,s1,s2,s3,cond) \ 93 110 do \ 94 111 { \ … … 97 114 for (uint32_t it2=0; it2<s2; ++it2) \ 98 115 { \ 99 delete [] var [it1][it2]; \ 116 if (cond) \ 117 delete [] var [it1][it2]; \ 100 118 } \ 101 119 delete [] var [it1]; \ … … 104 122 } while (0) 105 123 106 #define DELETE4 (var,s1,s2,s3,s4)\124 #define DELETE4_COND(var,s1,s2,s3,s4,cond) \ 107 125 do \ 108 126 { \ … … 113 131 for (uint32_t it3=0; it3<s3; ++it3) \ 114 132 { \ 115 delete [] var [it1][it2][it3]; \ 133 if (cond) \ 134 delete [] var [it1][it2][it3]; \ 116 135 } \ 117 136 delete [] var [it1][it2]; \ … … 121 140 delete [] var; \ 122 141 } while (0) 142 143 #define DELETE0(var) DELETE1_COND(var,true) 144 #define DELETE1(var,s1) DELETE1_COND(var,s1,true) 145 #define DELETE2(var,s1,s2) DELETE2_COND(var,s1,s2,true) 146 #define DELETE3(var,s1,s2,s3) DELETE3_COND(var,s1,s2,s3,true) 147 #define DELETE4(var,s1,s2,s3,s4) DELETE4_COND(var,s1,s2,s3,s4,true) 123 148 124 149 // ====================================================================== -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
r118 r145 19 19 # define DEBUG_Queue_Control true 20 20 # define DEBUG_RegisterFile true 21 # define DEBUG_RegisterFile_Internal_Banked true 21 22 # define DEBUG_RegisterFile_Monolithic true 22 23 # define DEBUG_RegisterFile_Multi_Banked true … … 119 120 # define NAME_Queue_Control "Queue_Control" 120 121 # define NAME_RegisterFile "RegisterFile" 122 # define NAME_RegisterFile_Internal_Banked "RegisterFile_Internal_Banked" 121 123 # define NAME_RegisterFile_Monolithic "RegisterFile_Monolithic" 122 124 # define NAME_RegisterFile_Multi_Banked "RegisterFile_Multi_Banked" -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
r142 r145 158 158 159 159 if (test<T>(_size) == false) 160 160 throw (ErrorMorpheo (toString(_("Signal \"%s\" : size is too small (%d bits) to the associate type (%d bits).\n"),_name.c_str(),_size,8*sizeof(T)))); 161 161 162 162 _is_allocate = true;
Note: See TracChangeset
for help on using the changeset viewer.