- Timestamp:
- Jul 30, 2010, 4:47:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
r137 r139 413 413 } while (0) 414 414 415 #define ALLOC1_SIGNAL_IN ( sig, name, type, size)\415 #define ALLOC1_SIGNAL_IN_COND( sig, name, type, size, cond) \ 416 416 do \ 417 417 { \ … … 419 419 for (uint32_t it1=0; it1<iterator_1; it1++) \ 420 420 { \ 421 if (size > 0) \ 422 { \ 423 sig [it1] = interface[it1]->set_signal_in <type> (name, size); \ 424 } \ 425 else \ 426 { \ 427 PRINT_SIZE_NUL(_component,interface[it1],name); \ 428 } \ 429 } \ 430 } while (0) 431 432 #define ALLOC1_SIGNAL_OUT(sig, name, type, size) \ 421 if (cond) \ 422 { \ 423 if (size > 0) \ 424 { \ 425 sig [it1] = interface[it1]->set_signal_in <type> (name, size); \ 426 } \ 427 else \ 428 { \ 429 PRINT_SIZE_NUL(_component,interface[it1],name); \ 430 } \ 431 } \ 432 } \ 433 } while (0) 434 435 #define ALLOC1_SIGNAL_OUT_COND(sig, name, type, size, cond) \ 433 436 do \ 434 437 { \ … … 436 439 for (uint32_t it1=0; it1<iterator_1; it1++) \ 437 440 { \ 438 if (size > 0) \ 439 { \ 440 sig [it1] = interface[it1]->set_signal_out<type> (name, size); \ 441 } \ 442 else \ 443 { \ 444 PRINT_SIZE_NUL(_component,interface[it1],name); \ 445 } \ 446 } \ 447 } while (0) 448 449 #define DELETE1_SIGNAL(sig, x1, size) \ 450 do \ 451 { \ 452 for (uint32_t it1=0; it1<x1; it1++) \ 453 { \ 454 if (size > 0) \ 455 { \ 456 delete sig[it1]; \ 441 if (cond) \ 442 { \ 443 if (size > 0) \ 444 { \ 445 sig [it1] = interface[it1]->set_signal_out<type> (name, size); \ 446 } \ 447 else \ 448 { \ 449 PRINT_SIZE_NUL(_component,interface[it1],name); \ 450 } \ 451 } \ 452 } \ 453 } while (0) 454 455 #define ALLOC1_SIGNAL_IN( sig, name, type, size) ALLOC1_SIGNAL_IN_COND( sig, name, type, size,true) 456 #define ALLOC1_SIGNAL_OUT(sig, name, type, size) ALLOC1_SIGNAL_OUT_COND(sig, name, type, size,true) 457 458 #define DELETE1_SIGNAL_COND(sig, x1, size, cond) \ 459 do \ 460 { \ 461 for (uint32_t it1=0; it1<x1; it1++) \ 462 { \ 463 if (cond) \ 464 { \ 465 if (size > 0) \ 466 { \ 467 delete sig[it1]; \ 468 } \ 457 469 } \ 458 470 } \ 459 471 delete [] sig; \ 460 472 } while (0) 473 474 #define DELETE1_SIGNAL(sig, x1, size) DELETE1_SIGNAL_COND(sig, x1, size, true) 461 475 462 476 #define ALLOC1_FOREIGN_SIGNAL_IN(sig, interface, name, type, size,x1) \ … … 661 675 } while (0) 662 676 663 #define _ALLOC2_SIGNAL_IN ( sig, name, type, size, x1, x2)\677 #define _ALLOC2_SIGNAL_IN_COND( sig, name, type, size, x1, x2, cond) \ 664 678 do \ 665 679 { \ … … 670 684 for (uint32_t it2=0; it2<x2; it2++) \ 671 685 { \ 672 if (size > 0) \ 673 { \ 674 sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \ 675 } \ 676 else \ 677 { \ 678 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 679 } \ 680 } \ 681 } \ 682 } while (0) 683 684 #define _ALLOC2_SIGNAL_OUT( sig, name, type, size, x1, x2) \ 686 if (cond) \ 687 { \ 688 if (size > 0) \ 689 { \ 690 sig [it1][it2] = interface[it1][it2]->set_signal_in <type> (name, size); \ 691 } \ 692 else \ 693 { \ 694 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 695 } \ 696 } \ 697 } \ 698 } \ 699 } while (0) 700 701 #define _ALLOC2_SIGNAL_OUT_COND( sig, name, type, size, x1, x2, cond) \ 685 702 do \ 686 703 { \ … … 691 708 for (uint32_t it2=0; it2<x2; it2++) \ 692 709 { \ 693 if (size > 0) \ 694 { \ 695 sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \ 696 } \ 697 else \ 698 { \ 699 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 700 } \ 701 } \ 702 } \ 703 } while (0) 704 705 #define ALLOC2_VAL_ACK_IN( sig, name, type ) _ALLOC2_VAL_ACK_IN( sig, name, type , iterator_1, iterator_2) 706 #define ALLOC2_VAL_ACK_OUT(sig, name, type ) _ALLOC2_VAL_ACK_OUT(sig, name, type , iterator_1, iterator_2) 707 #define ALLOC2_VALACK_IN( sig, type ) _ALLOC2_VALACK_IN( sig, type , iterator_1, iterator_2) 708 #define ALLOC2_VALACK_OUT( sig, type ) _ALLOC2_VALACK_OUT( sig, type , iterator_1, iterator_2) 709 #define ALLOC2_SIGNAL_IN( sig, name, type, size) _ALLOC2_SIGNAL_IN( sig, name, type, size, iterator_1, iterator_2) 710 #define ALLOC2_SIGNAL_OUT( sig, name, type, size) _ALLOC2_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2) 711 712 #define DELETE2_SIGNAL(sig, x1,x2, size) \ 713 do \ 714 { \ 715 for (uint32_t it1=0; it1<x1; it1++) \ 716 { \ 717 for (uint32_t it2=0; it2<x2; it2++) \ 718 { \ 719 if (size > 0) \ 720 { \ 721 delete sig[it1][it2]; \ 710 if (cond) \ 711 { \ 712 if (size > 0) \ 713 { \ 714 sig [it1][it2] = interface[it1][it2]->set_signal_out <type> (name, size); \ 715 } \ 716 else \ 717 { \ 718 PRINT_SIZE_NUL(_component,interface[it1][it2],name); \ 719 } \ 720 } \ 721 } \ 722 } \ 723 } while (0) 724 725 #define _ALLOC2_SIGNAL_IN( sig, name, type, size, x1, x2) _ALLOC2_SIGNAL_IN_COND( sig, name, type, size, x1, x2,true) 726 #define _ALLOC2_SIGNAL_OUT(sig, name, type, size, x1, x2) _ALLOC2_SIGNAL_OUT_COND(sig, name, type, size, x1, x2,true) 727 728 #define ALLOC2_VAL_ACK_IN( sig, name, type ) _ALLOC2_VAL_ACK_IN( sig, name, type , iterator_1, iterator_2) 729 #define ALLOC2_VAL_ACK_OUT(sig, name, type ) _ALLOC2_VAL_ACK_OUT(sig, name, type , iterator_1, iterator_2) 730 #define ALLOC2_VALACK_IN( sig, type ) _ALLOC2_VALACK_IN( sig, type , iterator_1, iterator_2) 731 #define ALLOC2_VALACK_OUT( sig, type ) _ALLOC2_VALACK_OUT( sig, type , iterator_1, iterator_2) 732 #define ALLOC2_SIGNAL_IN( sig, name, type, size) _ALLOC2_SIGNAL_IN( sig, name, type, size, iterator_1, iterator_2) 733 #define ALLOC2_SIGNAL_OUT( sig, name, type, size) _ALLOC2_SIGNAL_OUT( sig, name, type, size, iterator_1, iterator_2) 734 735 #define DELETE2_SIGNAL_COND(sig, x1,x2, size, cond) \ 736 do \ 737 { \ 738 for (uint32_t it1=0; it1<x1; it1++) \ 739 { \ 740 for (uint32_t it2=0; it2<x2; it2++) \ 741 { \ 742 if (cond) \ 743 { \ 744 if (size > 0) \ 745 { \ 746 delete sig[it1][it2]; \ 747 } \ 722 748 } \ 723 749 } \ … … 726 752 delete [] sig; \ 727 753 } while (0) 754 755 #define DELETE2_SIGNAL(sig, x1,x2, size) DELETE2_SIGNAL_COND(sig, x1,x2, size,true) 728 756 729 757 #define ALLOC2_FOREIGN_SIGNAL_IN( sig, interface, name, type, size, x1, x2) \
Note: See TracChangeset
for help on using the changeset viewer.