Changeset 128 for trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Timestamp:
- Jun 26, 2009, 10:43:23 AM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
r122 r128 15 15 // ====================================================================== 16 16 #define ALLOC0(var,type) \ 17 var = new type 18 19 #define ALLOC1(var,type,s1) \ 20 var = new type [s1] 21 17 do \ 18 { \ 19 var = new type; \ 20 } while (0) 21 22 #define ALLOC1(var,type,s1) \ 23 do \ 24 { \ 25 var = new type [s1]; \ 26 } while (0) 27 22 28 #define ALLOC2(var,type,s1,s2) \ 23 var = new type * [s1]; \ 24 for (uint32_t it1=0; it1<s1; ++it1) \ 29 do \ 25 30 { \ 26 var [it1] = new type [s2]; \ 27 } 31 var = new type * [s1]; \ 32 for (uint32_t it1=0; it1<s1; ++it1) \ 33 { \ 34 var [it1] = new type [s2]; \ 35 } \ 36 } while (0) 28 37 29 38 #define ALLOC3(var,type,s1,s2,s3) \ 30 var = new type ** [s1]; \ 31 for (uint32_t it1=0; it1<s1; ++it1) \ 39 do \ 32 40 { \ 33 var [it1] = new type * [s2];\34 for (uint32_t it 2=0; it2<s2; ++it2) \41 var = new type ** [s1]; \ 42 for (uint32_t it1=0; it1<s1; ++it1) \ 35 43 { \ 36 var [it1][it2] = new type [s3]; \ 44 var [it1] = new type * [s2]; \ 45 for (uint32_t it2=0; it2<s2; ++it2) \ 46 { \ 47 var [it1][it2] = new type [s3]; \ 48 } \ 37 49 } \ 38 } 39 50 } while (0) 51 40 52 #define ALLOC4(var,type,s1,s2,s3,s4) \ 41 var = new type *** [s1]; \ 42 for (uint32_t it1=0; it1<s1; ++it1) \ 53 do \ 43 54 { \ 44 var [it1] = new type ** [s2];\45 for (uint32_t it 2=0; it2<s2; ++it2) \55 var = new type *** [s1]; \ 56 for (uint32_t it1=0; it1<s1; ++it1) \ 46 57 { \ 47 var [it1] [it2] = new type * [s3];\48 for (uint32_t it 3=0; it3<s3; ++it3) \58 var [it1] = new type ** [s2]; \ 59 for (uint32_t it2=0; it2<s2; ++it2) \ 49 60 { \ 50 var [it1][it2][it3] = new type [s4]; \ 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 } \ 51 66 } \ 52 67 } \ 53 } 68 } while (0) 54 69 55 70 #define DELETE0(var) \ 56 delete var; 57 58 #define DELETE1(var,s1) \ 59 delete [] var; 60 61 #define DELETE2(var,s1,s2) \ 62 for (uint32_t it1=0; it1<s1; ++it1) \ 71 do \ 72 { \ 73 delete var; \ 74 } while (0) 75 76 #define DELETE1(var,s1) \ 77 do \ 78 { \ 79 delete [] var; \ 80 } while (0) 81 82 #define DELETE2(var,s1,s2) \ 83 do \ 63 84 { \ 64 delete [] var [it1]; \ 65 } \ 66 delete [] var; 67 85 for (uint32_t it1=0; it1<s1; ++it1) \ 86 { \ 87 delete [] var [it1]; \ 88 } \ 89 delete [] var; \ 90 } while (0) 91 68 92 #define DELETE3(var,s1,s2,s3) \ 69 for (uint32_t it1=0; it1<s1; ++it1)\93 do \ 70 94 { \ 71 for (uint32_t it 2=0; it2<s2; ++it2) \95 for (uint32_t it1=0; it1<s1; ++it1) \ 72 96 { \ 73 delete [] var [it1][it2]; \ 97 for (uint32_t it2=0; it2<s2; ++it2) \ 98 { \ 99 delete [] var [it1][it2]; \ 100 } \ 101 delete [] var [it1]; \ 74 102 } \ 75 delete [] var [it1]; \ 76 } \ 77 delete [] var; 78 79 #define DELETE4(var,s1,s2,s3,s4) \ 80 for (uint32_t it1=0; it1<s1; ++it1) \ 81 { \ 82 for (uint32_t it2=0; it2<s2; ++it2) \ 83 { \ 84 for (uint32_t it3=0; it3<s3; ++it3) \ 85 { \ 86 delete [] var [it1][it2][it3]; \ 87 } \ 88 delete [] var [it1][it2]; \ 89 } \ 90 delete [] var [it1]; \ 91 } \ 92 delete [] var; 103 delete [] var; \ 104 } while (0) 105 106 #define DELETE4(var,s1,s2,s3,s4) \ 107 do \ 108 { \ 109 for (uint32_t it1=0; it1<s1; ++it1) \ 110 { \ 111 for (uint32_t it2=0; it2<s2; ++it2) \ 112 { \ 113 for (uint32_t it3=0; it3<s3; ++it3) \ 114 { \ 115 delete [] var [it1][it2][it3]; \ 116 } \ 117 delete [] var [it1][it2]; \ 118 } \ 119 delete [] var [it1]; \ 120 } \ 121 delete [] var; \ 122 } while (0) 93 123 94 124 // ====================================================================== … … 108 138 109 139 #define __ALLOC0_SIGNAL(sig, name, type) \ 110 { \ 111 sig = new type (name); \ 112 } 140 do \ 141 { \ 142 sig = new type (name); \ 143 } while (0) 113 144 114 145 #ifdef POSITION … … 125 156 126 157 #define ALLOC0_VAL_ACK_IN( sig, name, type) \ 127 { \ 128 sig = interface->set_signal_valack_in (name, type); \ 129 } 158 do \ 159 { \ 160 sig = interface->set_signal_valack_in (name, type); \ 161 } while (0) 162 130 163 #define ALLOC0_VAL_ACK_OUT( sig, name, type) \ 131 { \ 132 sig = interface->set_signal_valack_out(name, type); \ 133 } 164 do \ 165 { \ 166 sig = interface->set_signal_valack_out(name, type); \ 167 } while (0) 168 134 169 #define ALLOC0_VALACK_IN( sig, type) \ 135 { \ 136 sig = interface->set_signal_valack_in (type); \ 137 } 138 #define ALLOC0_VALACK_OUT( sig, type) \ 139 { \ 140 sig = interface->set_signal_valack_out(type); \ 141 } 142 #define ALLOC0_SIGNAL_IN( sig, name, type, size) \ 143 if (size > 0) \ 144 { \ 145 sig = interface->set_signal_in <type> (name, size); \ 146 } \ 147 else \ 148 { \ 149 PRINT_SIZE_NUL(_component,interface,name); \ 150 } 151 152 #define ALLOC0_SIGNAL_OUT( sig, name, type, size) \ 153 if (size > 0) \ 154 { \ 155 sig = interface->set_signal_out<type> (name, size); \ 156 } \ 157 else \ 158 { \ 159 PRINT_SIZE_NUL(_component,interface,name); \ 160 } 170 do \ 171 { \ 172 sig = interface->set_signal_valack_in (type); \ 173 } while (0) 174 175 #define ALLOC0_VALACK_OUT( sig, type) \ 176 do \ 177 { \ 178 sig = interface->set_signal_valack_out(type); \ 179 } while (0) 180 181 #define ALLOC0_SIGNAL_IN( sig, name, type, size) \ 182 do \ 183 { \ 184 if (size > 0) \ 185 { \ 186 sig = interface->set_signal_in <type> (name, size); \ 187 } \ 188 else \ 189 { \ 190 PRINT_SIZE_NUL(_component,interface,name); \ 191 } \ 192 } while (0) 193 194 #define ALLOC0_SIGNAL_OUT( sig, name, type, size) \ 195 do \ 196 { \ 197 if (size > 0) \ 198 { \ 199 sig = interface->set_signal_out<type> (name, size); \ 200 } \ 201 else \ 202 { \ 203 PRINT_SIZE_NUL(_component,interface,name); \ 204 } \ 205 } while (0) 161 206 162 207 #define DELETE0_SIGNAL( sig, size) \ 163 if (size > 0) \ 164 { \ 208 do \ 209 { \ 210 if (size > 0) \ 211 { \ 212 delete sig; \ 213 } \ 214 } while (0) 215 216 #define ALLOC0_FOREIGN_SIGNAL_IN( sig, interface, name, type, size) \ 217 do \ 218 { \ 219 if (size > 0) \ 220 { \ 221 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 222 sig = new SC_IN (type) (str.c_str()); \ 223 } \ 224 } while (0) 225 226 #define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size) \ 227 do \ 228 { \ 229 if (size > 0) \ 230 { \ 231 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 232 sig = new SC_OUT (type) (str.c_str()); \ 233 } \ 234 } while (0) 235 236 #define DELETE0_FOREIGN_SIGNAL( sig, size) \ 237 do \ 238 { \ 239 DELETE0_SIGNAL(sig,size); \ 240 } while (0) 241 242 #define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size) \ 243 do \ 244 { \ 245 if (size > 0) \ 246 { \ 247 INSTANCE_FOREIGN_PRINT(name); \ 248 _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \ 249 } \ 250 } while (0) 251 252 #define ALLOC0_SC_SIGNAL( sig, name, type) \ 253 do \ 254 { \ 255 sig = new sc_signal<type> (name); \ 256 PRINT_SIGNAL_ADDRESS(name,sig); \ 257 } while (0) 258 259 #define INSTANCE0_SC_SIGNAL(component, sig) \ 260 do \ 261 { \ 262 TEST_SIGNAL(component->sig->name(),component->sig); \ 263 TEST_SIGNAL(sig ->name(),sig); \ 264 (*(component->sig)) (*(sig)); \ 265 } while (0) 266 267 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2) \ 268 do \ 269 { \ 270 TEST_SIGNAL(component->sig1->name(),component->sig1); \ 271 TEST_SIGNAL(sig2 ->name(),sig2); \ 272 (*(component->sig1)) (*(sig2)); \ 273 } while (0) 274 275 #define DELETE0_SC_SIGNAL( sig) \ 276 do \ 277 { \ 278 PRINT_SIGNAL_ADDRESS("",sig); \ 165 279 delete sig; \ 166 } 167 168 #define ALLOC0_FOREIGN_SIGNAL_IN( sig, interface, name, type, size) \ 169 if (size > 0) \ 170 { \ 171 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 172 sig = new SC_IN (type) (str.c_str()); \ 173 } 174 175 #define ALLOC0_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size) \ 176 if (size > 0) \ 177 { \ 178 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(name)); \ 179 sig = new SC_OUT (type) (str.c_str()); \ 180 } 181 182 #define DELETE0_FOREIGN_SIGNAL( sig, size) \ 183 { \ 184 DELETE0_SIGNAL(sig,size); \ 185 } 186 187 #define INSTANCE0_FOREIGN_SIGNAL(component, sig, type, name, size) \ 188 if (size > 0) \ 189 { \ 190 INSTANCE_FOREIGN_PRINT(name); \ 191 _component->set_sc_signal<type>(_name,name,static_cast<void*>(component->sig)); \ 192 } 193 194 #define ALLOC0_SC_SIGNAL( sig, name, type) \ 195 sig = new sc_signal<type> (name); \ 196 PRINT_SIGNAL_ADDRESS(name,sig); 197 198 #define INSTANCE0_SC_SIGNAL(component, sig) \ 199 { \ 200 TEST_SIGNAL(component->sig->name(),component->sig); \ 201 TEST_SIGNAL(sig ->name(),sig); \ 202 (*(component->sig)) (*(sig)); \ 203 } 204 205 #define _INSTANCE0_SC_SIGNAL(component, sig1,sig2) \ 206 { \ 207 TEST_SIGNAL(component->sig1->name(),component->sig1); \ 208 TEST_SIGNAL(sig2 ->name(),sig2); \ 209 (*(component->sig1)) (*(sig2)); \ 210 } 211 212 #define DELETE0_SC_SIGNAL( sig) \ 213 { \ 214 PRINT_SIGNAL_ADDRESS("",sig); \ 215 delete sig; \ 216 } 280 } while (0) 217 281 218 282 // ---------------------------------------------------------------------- … … 220 284 // ---------------------------------------------------------------------- 221 285 222 #define __ALLOC1_INTERFACE_BEGIN(name, x1) 286 #define __ALLOC1_INTERFACE_BEGIN(name, x1) \ 223 287 INTERFACE_PRINT(name); \ 224 288 const std::string interface_name = name; \ … … 228 292 229 293 #define __ALLOC1_SIGNAL_IN( sig, name, type) \ 230 { \ 231 sig = new SC_IN(type) * [iterator_1]; \ 232 std::string separator="_"; \ 233 for (uint32_t it1=0; it1<iterator_1; it1++) \ 234 { \ 235 std::string str = "in_"+interface_name+separator+toString(it1)+separator+name; \ 236 sig [it1] = new SC_IN(type) (str.c_str()); \ 237 } \ 238 } 294 do \ 295 { \ 296 sig = new SC_IN(type) * [iterator_1]; \ 297 std::string separator="_"; \ 298 for (uint32_t it1=0; it1<iterator_1; it1++) \ 299 { \ 300 std::string str = "in_"+interface_name+separator+toString(it1)+separator+name; \ 301 sig [it1] = new SC_IN(type) (str.c_str()); \ 302 } \ 303 } while (0) 304 239 305 240 306 #define __ALLOC1_SIGNAL_OUT( sig, name, type) \ 241 { \ 242 sig = new SC_OUT(type) * [iterator_1]; \ 243 std::string separator="_"; \ 244 for (uint32_t it1=0; it1<iterator_1; it1++) \ 245 { \ 246 std::string str = "out_"+interface_name+separator+toString(it1)+separator+name; \ 247 sig [it1] = new SC_OUT(type) (str.c_str()); \ 248 } \ 249 } 307 do \ 308 { \ 309 sig = new SC_OUT(type) * [iterator_1]; \ 310 std::string separator="_"; \ 311 for (uint32_t it1=0; it1<iterator_1; it1++) \ 312 { \ 313 std::string str = "out_"+interface_name+separator+toString(it1)+separator+name; \ 314 sig [it1] = new SC_OUT(type) (str.c_str()); \ 315 } \ 316 } while (0) 250 317 251 318 #ifdef POSITION … … 264 331 } 265 332 #else 266 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) 333 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) \ 267 334 INTERFACE_PRINT(name); \ 268 335 uint32_t iterator_1 = 0; \ … … 279 346 #endif 280 347 281 #define ALLOC1_INTERFACE_END(x1) \ 282 delete [] interface; 348 #define ALLOC1_INTERFACE_END(x1) \ 349 do \ 350 { \ 351 delete [] interface; \ 352 } while (0) 283 353 284 354 #define ALLOC1_VAL_ACK_IN( sig, name, type) \ 285 { \ 286 sig = new SC_IN (Tcontrol_t) * [iterator_1]; \ 287 for (uint32_t it1=0; it1<iterator_1; it1++) \ 288 { \ 289 sig [it1] = interface[it1]->set_signal_valack_in (name, type); \ 290 } \ 291 } 355 do \ 356 { \ 357 sig = new SC_IN (Tcontrol_t) * [iterator_1]; \ 358 for (uint32_t it1=0; it1<iterator_1; it1++) \ 359 { \ 360 sig [it1] = interface[it1]->set_signal_valack_in (name, type); \ 361 } \ 362 } while (0) 363 292 364 #define ALLOC1_VAL_ACK_OUT(sig, name, type) \ 293 { \ 294 sig = new SC_OUT(Tcontrol_t) * [iterator_1]; \ 295 for (uint32_t it1=0; it1<iterator_1; it1++) \ 296 { \ 297 sig [it1] = interface[it1]->set_signal_valack_out(name, type); \ 298 } \ 299 } 365 do \ 366 { \ 367 sig = new SC_OUT(Tcontrol_t) * [iterator_1]; \ 368 for (uint32_t it1=0; it1<iterator_1; it1++) \ 369 { \ 370 sig [it1] = interface[it1]->set_signal_valack_out(name, type); \ 371 } \ 372 } while (0) 373 300 374 #define ALLOC1_VALACK_IN( sig, type) \ 301 { \ 302 sig = new SC_IN (Tcontrol_t) * [iterator_1]; \ 303 for (uint32_t it1=0; it1<iterator_1; it1++) \ 304 { \ 305 sig [it1] = interface[it1]->set_signal_valack_in (type); \ 306 } \ 307 } 375 do \ 376 { \ 377 sig = new SC_IN (Tcontrol_t) * [iterator_1]; \ 378 for (uint32_t it1=0; it1<iterator_1; it1++) \ 379 { \ 380 sig [it1] = interface[it1]->set_signal_valack_in (type); \ 381 } \ 382 } while (0) 383 308 384 #define ALLOC1_VALACK_OUT( sig, type) \ 309 { \ 310 sig = new SC_OUT(Tcontrol_t) * [iterator_1]; \ 311 for (uint32_t it1=0; it1<iterator_1; it1++) \ 312 { \ 313 sig [it1] = interface[it1]->set_signal_valack_out(type); \ 314 } \ 315 } 385 do \ 386 { \ 387 sig = new SC_OUT(Tcontrol_t) * [iterator_1]; \ 388 for (uint32_t it1=0; it1<iterator_1; it1++) \ 389 { \ 390 sig [it1] = interface[it1]->set_signal_valack_out(type); \ 391 } \ 392 } while (0) 393 316 394 #define ALLOC1_SIGNAL_IN( sig, name, type, size) \ 317 { \ 318 sig = new SC_IN (type) * [iterator_1]; \ 319 for (uint32_t it1=0; it1<iterator_1; it1++) \ 320 { \ 395 do \ 396 { \ 397 sig = new SC_IN (type) * [iterator_1]; \ 398 for (uint32_t it1=0; it1<iterator_1; it1++) \ 399 { \ 400 if (size > 0) \ 401 { \ 402 sig [it1] = interface[it1]->set_signal_in <type> (name, size); \ 403 } \ 404 else \ 405 { \ 406 PRINT_SIZE_NUL(_component,interface[it1],name); \ 407 } \ 408 } \ 409 } while (0) 410 411 #define ALLOC1_SIGNAL_OUT(sig, name, type, size) \ 412 do \ 413 { \ 414 sig = new SC_OUT(type) * [iterator_1]; \ 415 for (uint32_t it1=0; it1<iterator_1; it1++) \ 416 { \ 417 if (size > 0) \ 418 { \ 419 sig [it1] = interface[it1]->set_signal_out<type> (name, size); \ 420 } \ 421 else \ 422 { \ 423 PRINT_SIZE_NUL(_component,interface[it1],name); \ 424 } \ 425 } \ 426 } while (0) 427 428 #define DELETE1_SIGNAL(sig, x1, size) \ 429 do \ 430 { \ 431 for (uint32_t it1=0; it1<x1; it1++) \ 432 { \ 433 if (size > 0) \ 434 { \ 435 delete sig[it1]; \ 436 } \ 437 } \ 438 delete [] sig; \ 439 } while (0) 440 441 #define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1) \ 442 do \ 443 { \ 444 sig = new SC_IN (type) * [x1]; \ 445 for (uint32_t it1=0; it1<x1; it1++) \ 321 446 if (size > 0) \ 322 447 { \ 323 sig [it1] = interface[it1]->set_signal_in <type> (name, size); \ 448 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 449 sig [it1] = new SC_IN (type) (str.c_str()); \ 324 450 } \ 325 else \ 451 } while (0) 452 453 #define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1) \ 454 do \ 455 { \ 456 sig = new SC_OUT (type) * [x1]; \ 457 for (uint32_t it1=0; it1<x1; it1++) \ 458 if (size > 0) \ 326 459 { \ 327 PRINT_SIZE_NUL(_component,interface[it1],name); \ 460 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 461 sig [it1] = new SC_OUT (type) (str.c_str()); \ 462 } \ 463 } while (0) 464 465 #define DELETE1_FOREIGN_SIGNAL( sig, size,x1) \ 466 do \ 467 { \ 468 DELETE1_SIGNAL(sig,x1,size); \ 469 } while (0) 470 471 #define ALLOC1_SC_SIGNAL( sig, name, type, x1) \ 472 do \ 473 { \ 474 sig = new sc_signal<type> * [x1]; \ 475 { \ 476 std::string separator="_"; \ 477 std::string str; \ 478 for (uint32_t it1=0; it1<x1; it1++) \ 479 { \ 480 str = name+separator+toString(it1); \ 481 sig [it1] = new sc_signal<type> (str.c_str()); \ 482 PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1]); \ 328 483 } \ 329 484 } \ 330 } 331 332 #define ALLOC1_SIGNAL_OUT(sig, name, type, size) \ 333 { \ 334 sig = new SC_OUT(type) * [iterator_1]; \ 335 for (uint32_t it1=0; it1<iterator_1; it1++) \ 336 { \ 337 if (size > 0) \ 338 { \ 339 sig [it1] = interface[it1]->set_signal_out<type> (name, size); \ 340 } \ 341 else \ 342 { \ 343 PRINT_SIZE_NUL(_component,interface[it1],name); \ 344 } \ 345 } \ 346 } 347 348 #define DELETE1_SIGNAL(sig, x1, size) \ 349 { \ 350 for (uint32_t it1=0; it1<x1; it1++) \ 351 { \ 352 if (size > 0) \ 353 { \ 354 delete sig[it1]; \ 355 } \ 356 } \ 357 delete [] sig; \ 358 } 359 360 #define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1) \ 361 { \ 362 sig = new SC_IN (type) * [x1]; \ 363 for (uint32_t it1=0; it1<x1; it1++) \ 364 if (size > 0) \ 365 { \ 366 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 367 sig [it1] = new SC_IN (type) (str.c_str()); \ 368 } \ 369 } 370 371 #define ALLOC1_FOREIGN_SIGNAL_OUT(sig, interface, name, type, size,x1) \ 372 { \ 373 sig = new SC_OUT (type) * [x1]; \ 374 for (uint32_t it1=0; it1<x1; it1++) \ 375 if (size > 0) \ 376 { \ 377 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(name)); \ 378 sig [it1] = new SC_OUT (type) (str.c_str()); \ 379 } \ 380 } 381 382 #define DELETE1_FOREIGN_SIGNAL( sig, size,x1) \ 383 { \ 384 DELETE1_SIGNAL(sig,x1,size); \ 385 } 386 387 #define ALLOC1_SC_SIGNAL( sig, name, type, x1) \ 388 sig = new sc_signal<type> * [x1]; \ 389 { \ 390 std::string separator="_"; \ 391 std::string str; \ 392 for (uint32_t it1=0; it1<x1; it1++) \ 393 { \ 394 str = name+separator+toString(it1); \ 395 sig [it1] = new sc_signal<type> (str.c_str()); \ 396 PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1]); \ 397 } \ 398 } 399 400 #define INSTANCE1_SC_SIGNAL(component, sig, x1) \ 401 for (uint32_t it1=0; it1<x1; it1++) \ 402 { \ 403 TEST_SIGNAL(component->sig [it1]->name(),component->sig [it1]); \ 404 TEST_SIGNAL(sig [it1]->name(),sig [it1]); \ 405 (*(component->sig[it1])) (*(sig[it1])); \ 406 } 407 408 #define _INSTANCE1_SC_SIGNAL(component, sig1, sig2, x1) \ 409 for (uint32_t it1=0; it1<x1; it1++) \ 410 { \ 411 TEST_SIGNAL(component->sig1 [it1]->name(),component->sig1 [it1]); \ 412 TEST_SIGNAL(sig2 [it1]->name(),sig2 [it1]); \ 413 (*(component->sig1[it1])) (*(sig2[it1])); \ 414 } 485 } while (0) 486 487 #define INSTANCE1_SC_SIGNAL(component, sig, x1) \ 488 do \ 489 { \ 490 for (uint32_t it1=0; it1<x1; it1++) \ 491 { \ 492 TEST_SIGNAL(component->sig [it1]->name(),component->sig [it1]); \ 493 TEST_SIGNAL(sig [it1]->name(),sig [it1]); \ 494 (*(component->sig[it1])) (*(sig[it1])); \ 495 } \ 496 } while (0) 497 498 #define _INSTANCE1_SC_SIGNAL(component, sig1, sig2, x1) \ 499 do \ 500 { \ 501 for (uint32_t it1=0; it1<x1; it1++) \ 502 { \ 503 TEST_SIGNAL(component->sig1 [it1]->name(),component->sig1 [it1]); \ 504 TEST_SIGNAL(sig2 [it1]->name(),sig2 [it1]); \ 505 (*(component->sig1[it1])) (*(sig2[it1])); \ 506 } \ 507 } while (0) 415 508 416 509 #define DELETE1_SC_SIGNAL(sig, x1) \ 417 { \ 418 for (uint32_t it1=0; it1<x1; it1++) \ 419 { \ 420 PRINT_SIGNAL_ADDRESS("",sig[it1]); \ 421 delete sig[it1]; \ 422 } \ 423 delete [] sig; \ 424 } 510 do \ 511 { \ 512 for (uint32_t it1=0; it1<x1; it1++) \ 513 { \ 514 PRINT_SIGNAL_ADDRESS("",sig[it1]); \ 515 delete sig[it1]; \ 516 } \ 517 delete [] sig; \ 518 } while (0) 425 519 426 520 // ---------------------------------------------------------------------- … … 429 523 430 524 #ifdef POSITION 431 #define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2) 525 #define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2) \ 432 526 INTERFACE_PRINT(name); \ 433 527 uint32_t iterator_1 = 0; \ … … 449 543 } 450 544 #else 451 #define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2) 545 #define ALLOC2_INTERFACE_BEGIN( name, direction, localisation, str, x1, x2) \ 452 546 INTERFACE_PRINT(name); \ 453 547 uint32_t iterator_1 = 0; \ … … 471 565 472 566 #define ALLOC2_INTERFACE_END(x1, x2) \ 473 for (uint32_t it1=0; it1<x1; it1++) \ 474 delete [] interface [it1]; \ 475 delete [] interface; 567 do \ 568 { \ 569 for (uint32_t it1=0; it1<x1; it1++) \ 570 delete [] interface [it1]; \ 571 delete [] interface; \ 572 } while (0) 476 573 477 574 #define _ALLOC2_VAL_ACK_IN( sig, name, type, x1, x2) \ 478 { \ 479 sig = new SC_IN (Tcontrol_t) ** [x1]; \ 480 for (uint32_t it1=0; it1<x1; it1++) \ 481 { \ 482 sig [it1] = new SC_IN (Tcontrol_t) * [x2]; \ 483 for (uint32_t it2=0; it2<x2; it2++) \ 484 { \ 485 sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (name, type); \ 486 } \ 487 } \ 488 } 575 do \ 576 { \ 577 sig = new SC_IN (Tcontrol_t) ** [x1]; \ 578 for (uint32_t it1=0; it1<x1; it1++) \ 579 { \ 580 sig [it1] = new SC_IN (Tcontrol_t) * [x2]; \ 581 for (uint32_t it2=0; it2<x2; it2++) \ 582 { \ 583 sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (name, type); \ 584 } \ 585 } \ 586 } while (0) 489 587 490 588 #define _ALLOC2_VAL_ACK_OUT( sig, name, type, x1, x2) \ 491 { \ 492 sig = new SC_OUT (Tcontrol_t) ** [x1]; \ 493 for (uint32_t it1=0; it1<x1; it1++) \ 494 { \ 495 sig [it1] = new SC_OUT (Tcontrol_t) * [x2]; \ 496 for (uint32_t it2=0; it2<x2; it2++) \ 497 { \ 498 sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (name, type); \ 499 } \ 500 } \ 501 } 589 do \ 590 { \ 591 sig = new SC_OUT (Tcontrol_t) ** [x1]; \ 592 for (uint32_t it1=0; it1<x1; it1++) \ 593 { \ 594 sig [it1] = new SC_OUT (Tcontrol_t) * [x2]; \ 595 for (uint32_t it2=0; it2<x2; it2++) \ 596 { \ 597 sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (name, type); \ 598 } \ 599 } \ 600 } while (0) 502 601 503 602 #define _ALLOC2_VALACK_IN( sig,type, x1, x2) \ 504 { \ 505 sig = new SC_IN (Tcontrol_t) ** [x1]; \ 506 for (uint32_t it1=0; it1<x1; it1++) \ 507 { \ 508 sig [it1] = new SC_IN (Tcontrol_t) * [x2]; \ 509 for (uint32_t it2=0; it2<x2; it2++) \ 510 { \ 511 sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (type); \ 512 } \ 513 } \ 514 } 603 do \ 604 { \ 605 sig = new SC_IN (Tcontrol_t) ** [x1]; \ 606 for (uint32_t it1=0; it1<x1; it1++) \ 607 { \ 608 sig [it1] = new SC_IN (Tcontrol_t) * [x2]; \ 609 for (uint32_t it2=0; it2<x2; it2++) \ 610 { \ 611 sig [it1][it2] = interface[it1][it2]->set_signal_valack_in (type); \ 612 } \ 613 } \ 614 } while (0) 515 615 516 616 #define _ALLOC2_VALACK_OUT( sig,type, x1, x2) \ 517 { \ 518 sig = new SC_OUT (Tcontrol_t) ** [x1]; \ 519 for (uint32_t it1=0; it1<x1; it1++) \ 520 { \ 521 sig [it1] = new SC_OUT (Tcontrol_t) * [x2]; \ 522 for (uint32_t it2=0; it2<x2; it2++) \ 523 { \ 524 sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (type); \ 525 } \ 526 } \ 527 } 617 do \ 618 { \ 619 sig = new SC_OUT (Tcontrol_t) ** [x1]; \ 620 for (uint32_t it1=0; it1<x1; it1++) \ 621 { \ 622 sig [it1] = new SC_OUT (Tcontrol_t) * [x2]; \ 623 for (uint32_t it2=0; it2<x2; it2++) \ 624 { \ 625 sig [it1][it2] = interface[it1][it2]->set_signal_valack_out (type); \ 626 } \ 627 } \ 628 } while (0) 528 629 529 630 #define _ALLOC2_SIGNAL_IN( sig, name, type, size, x1, x2) \ 530 { \ 531 sig = new SC_IN (type) ** [x1]; \ 532 for (uint32_t it1=0; it1<x1; it1++) \ 533 { \ 534 sig [it1] = new SC_IN (type) * [x2]; \ 535 for (uint32_t it2=0; it2<x2; it2++) \ 536 { \ 537 if (size > 0) \ 538 { \ 539 sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \ 540 } \ 541 else \ 542 { \ 543 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 544 } \ 545 } \ 546 } \ 547 } 631 do \ 632 { \ 633 sig = new SC_IN (type) ** [x1]; \ 634 for (uint32_t it1=0; it1<x1; it1++) \ 635 { \ 636 sig [it1] = new SC_IN (type) * [x2]; \ 637 for (uint32_t it2=0; it2<x2; it2++) \ 638 { \ 639 if (size > 0) \ 640 { \ 641 sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \ 642 } \ 643 else \ 644 { \ 645 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 646 } \ 647 } \ 648 } \ 649 } while (0) 548 650 549 651 #define _ALLOC2_SIGNAL_OUT( sig, name, type, size, x1, x2) \ 550 { \ 551 sig = new SC_OUT (type) ** [x1]; \ 552 for (uint32_t it1=0; it1<x1; it1++) \ 553 { \ 554 sig [it1] = new SC_OUT (type) * [x2]; \ 555 for (uint32_t it2=0; it2<x2; it2++) \ 556 { \ 557 if (size > 0) \ 558 { \ 559 sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \ 560 } \ 561 else \ 562 { \ 563 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 564 } \ 565 } \ 566 } \ 567 } 652 do \ 653 { \ 654 sig = new SC_OUT (type) ** [x1]; \ 655 for (uint32_t it1=0; it1<x1; it1++) \ 656 { \ 657 sig [it1] = new SC_OUT (type) * [x2]; \ 658 for (uint32_t it2=0; it2<x2; it2++) \ 659 { \ 660 if (size > 0) \ 661 { \ 662 sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \ 663 } \ 664 else \ 665 { \ 666 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 667 } \ 668 } \ 669 } \ 670 } while (0) 568 671 569 672 #define ALLOC2_VAL_ACK_IN( sig, name, type ) _ALLOC2_VAL_ACK_IN( sig, name, type , iterator_1, iterator_2) … … 575 678 576 679 #define DELETE2_SIGNAL(sig, x1,x2, size) \ 577 { \ 578 for (uint32_t it1=0; it1<x1; it1++) \ 680 do \ 681 { \ 682 for (uint32_t it1=0; it1<x1; it1++) \ 683 { \ 684 for (uint32_t it2=0; it2<x2; it2++) \ 685 { \ 686 if (size > 0) \ 687 { \ 688 delete sig[it1][it2]; \ 689 } \ 690 } \ 691 delete [] sig[it1]; \ 692 } \ 693 delete [] sig; \ 694 } while (0) 695 696 #define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \ 697 do \ 698 { \ 699 sig = new SC_IN (type) ** [x1]; \ 700 for (uint32_t it1=0; it1<x1; it1++) \ 701 { \ 702 sig [it1] = new SC_IN (type) * [x2]; \ 703 for (uint32_t it2=0; it2<x2; it2++) \ 704 if (size > 0) \ 705 { \ 706 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 707 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 708 } \ 709 } \ 710 } while (0) 711 712 #define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \ 713 do \ 714 { \ 715 sig = new SC_OUT (type) ** [x1]; \ 716 for (uint32_t it1=0; it1<x1; it1++) \ 717 { \ 718 sig [it1] = new SC_OUT (type) * [x2]; \ 719 for (uint32_t it2=0; it2<x2; it2++) \ 720 if (size > 0) \ 721 { \ 722 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 723 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 724 } \ 725 } \ 726 } while (0) 727 728 #define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2) \ 729 do \ 730 { \ 731 DELETE2_SIGNAL(sig,x1,x2,size); \ 732 } while (0) 733 734 #define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2) \ 735 do \ 736 { \ 737 sig = new sc_signal<type> ** [x1]; \ 579 738 { \ 739 std::string separator="_"; \ 740 std::string str; \ 741 for (uint32_t it1=0; it1<x1; it1++) \ 742 { \ 743 sig [it1] = new sc_signal<type> * [x2]; \ 744 for (uint32_t it2=0; it2<x2; it2++) \ 745 { \ 746 str = name+separator+toString(it1)+separator+toString(it2); \ 747 sig [it1][it2] = new sc_signal<type> (str.c_str()); \ 748 PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2]); \ 749 } \ 750 } \ 751 } \ 752 } while (0) 753 754 #define INSTANCE2_SC_SIGNAL(component, sig, x1, x2) \ 755 do \ 756 { \ 757 for (uint32_t it1=0; it1<x1; it1++) \ 580 758 for (uint32_t it2=0; it2<x2; it2++) \ 581 759 { \ 582 if (size > 0) \ 583 { \ 584 delete sig[it1][it2]; \ 585 } \ 760 TEST_SIGNAL(component->sig [it1][it2]->name(),component->sig [it1][it2]); \ 761 TEST_SIGNAL(sig [it1][it2]->name(),sig [it1][it2]); \ 762 (*(component->sig[it1][it2])) (*(sig[it1][it2])); \ 586 763 } \ 587 delete [] sig[it1]; \ 588 } \ 589 delete [] sig; \ 590 } 591 592 593 #define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \ 594 { \ 595 sig = new SC_IN (type) ** [x1]; \ 596 for (uint32_t it1=0; it1<x1; it1++) \ 597 { \ 598 sig [it1] = new SC_IN (type) * [x2]; \ 599 for (uint32_t it2=0; it2<x2; it2++) \ 600 if (size > 0) \ 601 { \ 602 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 603 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 604 } \ 605 } \ 606 } 607 608 #define ALLOC2_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2) \ 609 { \ 610 sig = new SC_OUT (type) ** [x1]; \ 611 for (uint32_t it1=0; it1<x1; it1++) \ 612 { \ 613 sig [it1] = new SC_OUT (type) * [x2]; \ 614 for (uint32_t it2=0; it2<x2; it2++) \ 615 if (size > 0) \ 616 { \ 617 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(name)); \ 618 sig [it1][it2] = new SC_IN (type) (str.c_str()); \ 619 } \ 620 } \ 621 } 622 623 #define DELETE2_FOREIGN_SIGNAL( sig, size,x1,x2) \ 624 { \ 625 DELETE2_SIGNAL(sig,x1,x2,size); \ 626 } 627 628 #define ALLOC2_SC_SIGNAL( sig, name, type, x1, x2) \ 629 sig = new sc_signal<type> ** [x1]; \ 630 { \ 631 std::string separator="_"; \ 632 std::string str; \ 633 for (uint32_t it1=0; it1<x1; it1++) \ 634 { \ 635 sig [it1] = new sc_signal<type> * [x2]; \ 764 } while (0) 765 766 #define _INSTANCE2_SC_SIGNAL(component, sig1, sig2, x1, x2) \ 767 do \ 768 { \ 769 for (uint32_t it1=0; it1<x1; it1++) \ 636 770 for (uint32_t it2=0; it2<x2; it2++) \ 637 771 { \ 638 str = name+separator+toString(it1)+separator+toString(it2); \639 sig [it1][it2] = new sc_signal<type> (str.c_str());\640 PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2]);\772 TEST_SIGNAL(component->sig1 [it1][it2]->name(),component->sig1 [it1][it2]); \ 773 TEST_SIGNAL(sig2 [it1][it2]->name(),sig2 [it1][it2]); \ 774 (*(component->sig1[it1][it2])) (*(sig2[it1][it2])); \ 641 775 } \ 642 } \ 643 } 644 645 #define INSTANCE2_SC_SIGNAL(component, sig, x1, x2) \ 646 for (uint32_t it1=0; it1<x1; it1++) \ 647 for (uint32_t it2=0; it2<x2; it2++) \ 648 { \ 649 TEST_SIGNAL(component->sig [it1][it2]->name(),component->sig [it1][it2]); \ 650 TEST_SIGNAL(sig [it1][it2]->name(),sig [it1][it2]); \ 651 (*(component->sig[it1][it2])) (*(sig[it1][it2])); \ 652 } 653 654 #define _INSTANCE2_SC_SIGNAL(component, sig1, sig2, x1, x2) \ 655 for (uint32_t it1=0; it1<x1; it1++) \ 656 for (uint32_t it2=0; it2<x2; it2++) \ 657 { \ 658 TEST_SIGNAL(component->sig1 [it1][it2]->name(),component->sig1 [it1][it2]); \ 659 TEST_SIGNAL(sig2 [it1][it2]->name(),sig2 [it1][it2]); \ 660 (*(component->sig1[it1][it2])) (*(sig2[it1][it2])); \ 661 } 776 } while (0) 662 777 663 778 #define DELETE2_SC_SIGNAL(sig,x1,x2) \ 664 { \ 665 for (uint32_t it1=0; it1<x1; it1++) \ 666 { \ 667 for (uint32_t it2=0; it2<x2; it2++) \ 668 { \ 669 PRINT_SIGNAL_ADDRESS("",sig[it1][it2]); \ 670 delete sig[it1][it2]; \ 671 } \ 672 delete [] sig[it1]; \ 673 } \ 674 delete [] sig; \ 675 } 779 do \ 780 { \ 781 for (uint32_t it1=0; it1<x1; it1++) \ 782 { \ 783 for (uint32_t it2=0; it2<x2; it2++) \ 784 { \ 785 PRINT_SIGNAL_ADDRESS("",sig[it1][it2]); \ 786 delete sig[it1][it2]; \ 787 } \ 788 delete [] sig[it1]; \ 789 } \ 790 delete [] sig; \ 791 } while (0) 676 792 677 793 // ---------------------------------------------------------------------- … … 734 850 735 851 #define ALLOC3_INTERFACE_END(x1, x2, x3) \ 736 for (uint32_t it1=0; it1<x1; it1++) \ 737 { \ 738 for (uint32_t it2=0; it2<x2; it2++) \ 739 delete [] interface [it1][it2]; \ 740 delete [] interface [it1]; \ 741 } \ 742 delete [] interface; 852 do \ 853 { \ 854 for (uint32_t it1=0; it1<x1; it1++) \ 855 { \ 856 for (uint32_t it2=0; it2<x2; it2++) \ 857 delete [] interface [it1][it2]; \ 858 delete [] interface [it1]; \ 859 } \ 860 delete [] interface; \ 861 } while (0) 743 862 744 863 // #define _ALLOC3_VAL_ACK_IN( sig, name, type, x1, x2, x3) … … 746 865 747 866 #define _ALLOC3_VALACK_IN( sig,type, x1, x2, x3) \ 748 { \ 749 sig = new SC_IN (Tcontrol_t) *** [x1]; \ 750 for (uint32_t it1=0; it1<x1; it1++) \ 751 { \ 752 sig [it1] = new SC_IN (Tcontrol_t) ** [x2]; \ 753 for (uint32_t it2=0; it2<x2; it2++) \ 754 { \ 755 sig [it1][it2] = new SC_IN (Tcontrol_t) * [x3]; \ 756 for (uint32_t it3=0; it3<x3; it3++) \ 757 { \ 758 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_in (type); \ 759 } \ 760 } \ 761 } \ 762 } 867 do \ 868 { \ 869 sig = new SC_IN (Tcontrol_t) *** [x1]; \ 870 for (uint32_t it1=0; it1<x1; it1++) \ 871 { \ 872 sig [it1] = new SC_IN (Tcontrol_t) ** [x2]; \ 873 for (uint32_t it2=0; it2<x2; it2++) \ 874 { \ 875 sig [it1][it2] = new SC_IN (Tcontrol_t) * [x3]; \ 876 for (uint32_t it3=0; it3<x3; it3++) \ 877 { \ 878 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_in (type); \ 879 } \ 880 } \ 881 } \ 882 } while (0) 763 883 764 884 #define _ALLOC3_VALACK_OUT( sig,type, x1, x2, x3) \ 765 { \ 766 sig = new SC_OUT (Tcontrol_t) *** [x1]; \ 767 for (uint32_t it1=0; it1<x1; it1++) \ 768 { \ 769 sig [it1] = new SC_OUT (Tcontrol_t) ** [x2]; \ 770 for (uint32_t it2=0; it2<x2; it2++) \ 771 { \ 772 sig [it1][it2] = new SC_OUT (Tcontrol_t) * [x3]; \ 773 for (uint32_t it3=0; it3<x3; it3++) \ 774 { \ 775 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_out (type); \ 776 } \ 777 } \ 778 } \ 779 } 885 do \ 886 { \ 887 sig = new SC_OUT (Tcontrol_t) *** [x1]; \ 888 for (uint32_t it1=0; it1<x1; it1++) \ 889 { \ 890 sig [it1] = new SC_OUT (Tcontrol_t) ** [x2]; \ 891 for (uint32_t it2=0; it2<x2; it2++) \ 892 { \ 893 sig [it1][it2] = new SC_OUT (Tcontrol_t) * [x3]; \ 894 for (uint32_t it3=0; it3<x3; it3++) \ 895 { \ 896 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_valack_out (type); \ 897 } \ 898 } \ 899 } \ 900 } while (0) 780 901 781 902 782 903 #define _ALLOC3_SIGNAL_IN( sig, name, type, size, x1, x2,x3) \ 783 { \ 784 sig = new SC_IN (type) *** [x1]; \ 785 for (uint32_t it1=0; it1<x1; it1++) \ 786 { \ 787 sig [it1] = new SC_IN (type) ** [x2]; \ 788 for (uint32_t it2=0; it2<x2; it2++) \ 789 { \ 790 sig [it1][it2] = new SC_IN (type) * [x3]; \ 791 for (uint32_t it3=0; it3<x3; it3++) \ 792 { \ 793 if (size > 0) \ 794 { \ 795 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_in <type> (name, size); \ 796 } \ 797 else \ 798 { \ 799 PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \ 800 } \ 801 } \ 802 } \ 803 } \ 804 } 904 do \ 905 { \ 906 sig = new SC_IN (type) *** [x1]; \ 907 for (uint32_t it1=0; it1<x1; it1++) \ 908 { \ 909 sig [it1] = new SC_IN (type) ** [x2]; \ 910 for (uint32_t it2=0; it2<x2; it2++) \ 911 { \ 912 sig [it1][it2] = new SC_IN (type) * [x3]; \ 913 for (uint32_t it3=0; it3<x3; it3++) \ 914 { \ 915 if (size > 0) \ 916 { \ 917 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_in <type> (name, size); \ 918 } \ 919 else \ 920 { \ 921 PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \ 922 } \ 923 } \ 924 } \ 925 } \ 926 } while (0) 805 927 806 928 #define _ALLOC3_SIGNAL_OUT( sig, name, type, size, x1, x2,x3) \ 807 { \ 808 sig = new SC_OUT (type) *** [x1]; \ 809 for (uint32_t it1=0; it1<x1; it1++) \ 810 { \ 811 sig [it1] = new SC_OUT (type) ** [x2]; \ 812 for (uint32_t it2=0; it2<x2; it2++) \ 813 { \ 814 sig [it1][it2] = new SC_OUT (type) * [x3]; \ 815 for (uint32_t it3=0; it3<x3; it3++) \ 816 { \ 817 if (size > 0) \ 818 { \ 819 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_out <type> (name, size); \ 820 } \ 821 else \ 822 { \ 823 PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \ 824 } \ 825 } \ 826 } \ 827 } \ 828 } 929 do \ 930 { \ 931 sig = new SC_OUT (type) *** [x1]; \ 932 for (uint32_t it1=0; it1<x1; it1++) \ 933 { \ 934 sig [it1] = new SC_OUT (type) ** [x2]; \ 935 for (uint32_t it2=0; it2<x2; it2++) \ 936 { \ 937 sig [it1][it2] = new SC_OUT (type) * [x3]; \ 938 for (uint32_t it3=0; it3<x3; it3++) \ 939 { \ 940 if (size > 0) \ 941 { \ 942 sig [it1][it2][it3] = interface[it1][it2][it3]->set_signal_out <type> (name, size); \ 943 } \ 944 else \ 945 { \ 946 PRINT_SIZE_NUL(_component,interface[it1][it2][it3],name); \ 947 } \ 948 } \ 949 } \ 950 } \ 951 } while (0) 829 952 830 953 // #define ALLOC3_VAL_ACK_IN( sig, name, type ) _ALLOC3_VAL_ACK_IN( sig, name, type , iterator_1, iterator_2, iterator_3) … … 836 959 837 960 #define DELETE3_SIGNAL(sig, x1, x2, x3, size) \ 838 { \ 839 for (uint32_t it1=0; it1<x1; it1++) \ 840 { \ 841 for (uint32_t it2=0; it2<x2; it2++) \ 842 { \ 843 for (uint32_t it3=0; it3<x3; it3++) \ 844 { \ 961 do \ 962 { \ 963 for (uint32_t it1=0; it1<x1; it1++) \ 964 { \ 965 for (uint32_t it2=0; it2<x2; it2++) \ 966 { \ 967 for (uint32_t it3=0; it3<x3; it3++) \ 968 { \ 969 if (size > 0) \ 970 { \ 971 delete sig[it1][it2][it3]; \ 972 } \ 973 } \ 974 delete [] sig[it1][it2]; \ 975 } \ 976 delete [] sig[it1]; \ 977 } \ 978 delete [] sig; \ 979 } while (0) 980 981 #define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3) \ 982 do \ 983 { \ 984 sig = new SC_IN (type) *** [x1]; \ 985 for (uint32_t it1=0; it1<x1; it1++) \ 986 { \ 987 sig [it1] = new SC_IN (type) ** [x2]; \ 988 for (uint32_t it2=0; it2<x2; it2++) \ 989 { \ 990 sig [it1][it2] = new SC_IN (type) * [x3]; \ 991 for (uint32_t it3=0; it3<x3; it3++) \ 845 992 if (size > 0) \ 846 993 { \ 847 delete sig[it1][it2][it3]; \ 994 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \ 995 sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \ 996 } \ 997 } \ 998 } \ 999 } while (0) 1000 1001 #define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3) \ 1002 do \ 1003 { \ 1004 sig = new SC_OUT (type) *** [x1]; \ 1005 for (uint32_t it1=0; it1<x1; it1++) \ 1006 { \ 1007 sig [it1] = new SC_OUT (type) ** [x2]; \ 1008 for (uint32_t it2=0; it2<x2; it2++) \ 1009 { \ 1010 sig [it1][it2] = new SC_OUT (type) * [x3]; \ 1011 for (uint32_t it3=0; it3<x3; it3++) \ 1012 if (size > 0) \ 1013 { \ 1014 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \ 1015 sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \ 1016 } \ 1017 } \ 1018 } \ 1019 } while (0) 1020 1021 #define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3) \ 1022 do \ 1023 { \ 1024 DELETE3_SIGNAL(sig,x1,x2,x3,size); \ 1025 } while (0) 1026 1027 #define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3) \ 1028 do \ 1029 { \ 1030 sig = new sc_signal<type> *** [x1]; \ 1031 { \ 1032 std::string separator="_"; \ 1033 std::string str; \ 1034 for (uint32_t it1=0; it1<x1; it1++) \ 1035 { \ 1036 sig [it1] = new sc_signal<type> ** [x2]; \ 1037 for (uint32_t it2=0; it2<x2; it2++) \ 1038 { \ 1039 sig [it1][it2] = new sc_signal<type> * [x3]; \ 1040 for (uint32_t it3=0; it3<x3; it3++) \ 1041 { \ 1042 str = name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3); \ 1043 sig [it1][it2][it3] = new sc_signal<type> (str.c_str()); \ 1044 PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2][it3]); \ 848 1045 } \ 849 1046 } \ 850 delete [] sig[it1][it2]; \851 } \852 delete [] sig[it1]; \853 } \854 delete [] sig; \855 }856 857 #define ALLOC3_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2,x3) \858 { \859 sig = new SC_IN (type) *** [x1]; \860 for (uint32_t it1=0; it1<x1; it1++) \861 { \862 sig [it1] = new SC_IN (type) ** [x2]; \863 for (uint32_t it2=0; it2<x2; it2++) \864 { \865 sig [it1][it2] = new SC_IN (type) * [x3]; \866 for (uint32_t it3=0; it3<x3; it3++) \867 if (size > 0) \868 { \869 std::string str = (toString("in")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name)); \870 sig [it1][it2][it3] = new SC_IN (type) (str.c_str()); \871 } \872 1047 } \ 873 1048 } \ 874 } 875 876 #define ALLOC3_FOREIGN_SIGNAL_OUT( sig, interface, name, type, size, x1, x2,x3) \ 877 { \ 878 sig = new SC_OUT (type) *** [x1]; \ 879 for (uint32_t it1=0; it1<x1; it1++) \ 880 { \ 881 sig [it1] = new SC_OUT (type) ** [x2]; \ 1049 } while (0) 1050 1051 #define INSTANCE3_SC_SIGNAL(component, sig, x1, x2, x3) \ 1052 do \ 1053 { \ 1054 for (uint32_t it1=0; it1<x1; it1++) \ 882 1055 for (uint32_t it2=0; it2<x2; it2++) \ 883 {\884 sig [it1][it2] = new SC_OUT (type) * [x3];\885 for (uint32_t it3=0; it3<x3; it3++)\886 if (size > 0)\887 {\888 std::string str = (toString("out")+"_"+((interface!="")?(toString(interface)+"_"):toString(""))+toString(it1)+"_"+toString(it2)+"_"+toString(it3)+"_"+toString(name));\889 sig [it1][it2][it3] = new SC_OUT(type) (str.c_str()); \890 } \ 891 }\892 }\893 }894 895 #define DELETE3_FOREIGN_SIGNAL( sig, size,x1,x2,x3)\896 {\897 DELETE3_SIGNAL(sig,x1,x2,x3,size);\898 }899 900 #define ALLOC3_SC_SIGNAL( sig, name, type, x1, x2, x3)\901 sig = new sc_signal<type> *** [x1];\902 { \903 std::string separator="_"; \ 904 std::string str;\905 for (uint32_t it1=0; it1<x1; it1++)\906 {\907 sig [it1] = new sc_signal<type> ** [x2];\908 for (uint32_t it2=0; it2<x2; it2++)\909 {\910 sig [it1][it2] = new sc_signal<type> * [x3];\1056 for (uint32_t it3=0; it3<x3; it3++) \ 1057 { \ 1058 TEST_SIGNAL(component->sig [it1][it2][it3]->name(),component->sig [it1][it2][it3]); \ 1059 TEST_SIGNAL(sig [it1][it2][it3]->name(),sig [it1][it2][it3]); \ 1060 (*(component->sig[it1][it2][it3])) (*(sig[it1][it2][it3])); \ 1061 } \ 1062 } while (0) 1063 1064 #define _INSTANCE3_SC_SIGNAL(component, sig1, sig2, x1, x2, x3) \ 1065 do \ 1066 { \ 1067 for (uint32_t it1=0; it1<x1; it1++) \ 1068 for (uint32_t it2=0; it2<x2; it2++) \ 1069 for (uint32_t it3=0; it3<x3; it3++) \ 1070 { \ 1071 TEST_SIGNAL(component->sig1 [it1][it2][it3]->name(),component->sig1 [it1][it2][it3]); \ 1072 TEST_SIGNAL(sig2 [it1][it2][it3]->name(),sig2 [it1][it2][it3]); \ 1073 (*(component->sig1[it1][it2][it3])) (*(sig2[it1][it2][it3])); \ 1074 } \ 1075 } while (0) 1076 1077 #define DELETE3_SC_SIGNAL(sig,x1,x2,x3) \ 1078 do \ 1079 { \ 1080 for (uint32_t it1=0; it1<x1; it1++) \ 1081 { \ 1082 for (uint32_t it2=0; it2<x2; it2++) \ 1083 { \ 911 1084 for (uint32_t it3=0; it3<x3; it3++) \ 912 1085 { \ 913 str = name+separator+toString(it1)+separator+toString(it2)+separator+toString(it3); \ 914 sig [it1][it2][it3] = new sc_signal<type> (str.c_str()); \ 915 PRINT_SIGNAL_ADDRESS(str.c_str(),sig[it1][it2][it3]); \ 1086 PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]); \ 1087 delete sig[it1][it2][it3]; \ 916 1088 } \ 917 } \ 918 } \ 919 } 920 921 #define INSTANCE3_SC_SIGNAL(component, sig, x1, x2, x3) \ 922 for (uint32_t it1=0; it1<x1; it1++) \ 923 for (uint32_t it2=0; it2<x2; it2++) \ 924 for (uint32_t it3=0; it3<x3; it3++) \ 925 { \ 926 TEST_SIGNAL(component->sig [it1][it2][it3]->name(),component->sig [it1][it2][it3]); \ 927 TEST_SIGNAL(sig [it1][it2][it3]->name(),sig [it1][it2][it3]); \ 928 (*(component->sig[it1][it2][it3])) (*(sig[it1][it2][it3])); \ 929 } 930 931 #define _INSTANCE3_SC_SIGNAL(component, sig1, sig2, x1, x2, x3) \ 932 for (uint32_t it1=0; it1<x1; it1++) \ 933 for (uint32_t it2=0; it2<x2; it2++) \ 934 for (uint32_t it3=0; it3<x3; it3++) \ 935 { \ 936 TEST_SIGNAL(component->sig1 [it1][it2][it3]->name(),component->sig1 [it1][it2][it3]); \ 937 TEST_SIGNAL(sig2 [it1][it2][it3]->name(),sig2 [it1][it2][it3]); \ 938 (*(component->sig1[it1][it2][it3])) (*(sig2[it1][it2][it3])); \ 939 } 940 941 #define DELETE3_SC_SIGNAL(sig,x1,x2,x3) \ 942 { \ 943 for (uint32_t it1=0; it1<x1; it1++) \ 944 { \ 945 for (uint32_t it2=0; it2<x2; it2++) \ 946 { \ 947 for (uint32_t it3=0; it3<x3; it3++) \ 948 { \ 949 PRINT_SIGNAL_ADDRESS("",sig[it1][it2][it3]); \ 950 delete sig[it1][it2][it3]; \ 951 } \ 952 delete [] sig[it1][it2]; \ 953 } \ 954 delete [] sig[it1]; \ 955 } \ 956 delete [] sig; \ 957 } 1089 delete [] sig[it1][it2]; \ 1090 } \ 1091 delete [] sig[it1]; \ 1092 } \ 1093 delete [] sig; \ 1094 } while (0) 958 1095 959 1096 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h
r124 r128 16 16 17 17 // ***** general 18 typedef uint32_t Tcounter_t; // universal counter 19 typedef uint32_t Tptr_t; // universal pointer 18 20 typedef uint32_t Tinstruction_t; 19 21 typedef bool Tcontrol_t; 20 22 typedef uint8_t Texception_t; 21 23 typedef uint8_t Tcontext_t; 22 typedef uint16_tTpacket_t;24 typedef Tptr_t Tpacket_t; 23 25 typedef uint8_t Toperation_t; 24 26 typedef uint8_t Ttype_t; 25 typedef uint32_t Tcounter_t; // universal counter26 typedef uint32_t Tptr_t; // universal pointer27 27 typedef uint32_t Tspr_t; 28 28 typedef uint16_t Tspr_address_t; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
r127 r128 10 10 #define MORPHEO_MAJOR_VERSION "0" 11 11 #define MORPHEO_MINOR_VERSION "2" 12 #define MORPHEO_REVISION "12 7"12 #define MORPHEO_REVISION "128" 13 13 #define MORPHEO_CODENAME "Castor" 14 14 15 #define MORPHEO_DATE_DAY " 17"15 #define MORPHEO_DATE_DAY "26" 16 16 #define MORPHEO_DATE_MONTH "06" 17 17 #define MORPHEO_DATE_YEAR "2009"
Note: See TracChangeset
for help on using the changeset viewer.