sc_module.cc (13207:034ca389a810) | sc_module.cc (13248:a07071974510) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 577 unchanged lines hidden (view full) --- 586 ::sc_gem5::Process *p = sc_gem5::scheduler.current(); 587 if (!p) 588 return false; 589 else 590 return p->timedOut(); 591} 592 593 | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 577 unchanged lines hidden (view full) --- 586 ::sc_gem5::Process *p = sc_gem5::scheduler.current(); 587 if (!p) 588 return false; 589 else 590 return p->timedOut(); 591} 592 593 |
594namespace 595{ 596 597bool 598waitErrorCheck(sc_gem5::Process *p) 599{ 600 if (p->procKind() == SC_METHOD_PROC_) { 601 SC_REPORT_ERROR( 602 "(E519) wait() is only allowed in SC_THREADs and SC_CTHREADs", 603 "\n in SC_METHODs use next_trigger() instead"); 604 return true; 605 } 606 return false; 607} 608 609} // anonymous namespace 610 |
|
594void 595wait() 596{ 597 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 611void 612wait() 613{ 614 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
615 if (waitErrorCheck(p)) 616 return; |
|
598 p->cancelTimeout(); 599 p->clearDynamic(); 600 sc_gem5::scheduler.yield(); 601} 602 603void 604wait(int n) 605{ --- 4 unchanged lines hidden (view full) --- 610 for (int i = 0; i < n; i++) 611 wait(); 612} 613 614void 615wait(const sc_event &e) 616{ 617 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 617 p->cancelTimeout(); 618 p->clearDynamic(); 619 sc_gem5::scheduler.yield(); 620} 621 622void 623wait(int n) 624{ --- 4 unchanged lines hidden (view full) --- 629 for (int i = 0; i < n; i++) 630 wait(); 631} 632 633void 634wait(const sc_event &e) 635{ 636 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
637 if (waitErrorCheck(p)) 638 return; |
|
618 p->cancelTimeout(); 619 ::sc_gem5::newDynamicSensitivityEvent(p, &e); 620 sc_gem5::scheduler.yield(); 621} 622 623void 624wait(const sc_event_or_list &eol) 625{ 626 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 639 p->cancelTimeout(); 640 ::sc_gem5::newDynamicSensitivityEvent(p, &e); 641 sc_gem5::scheduler.yield(); 642} 643 644void 645wait(const sc_event_or_list &eol) 646{ 647 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
648 if (waitErrorCheck(p)) 649 return; |
|
627 p->cancelTimeout(); 628 ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol); 629 sc_gem5::scheduler.yield(); 630} 631 632void 633wait(const sc_event_and_list &eal) 634{ 635 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 650 p->cancelTimeout(); 651 ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol); 652 sc_gem5::scheduler.yield(); 653} 654 655void 656wait(const sc_event_and_list &eal) 657{ 658 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
659 if (waitErrorCheck(p)) 660 return; |
|
636 p->cancelTimeout(); 637 ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal); 638 sc_gem5::scheduler.yield(); 639} 640 641void 642wait(const sc_time &t) 643{ 644 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 661 p->cancelTimeout(); 662 ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal); 663 sc_gem5::scheduler.yield(); 664} 665 666void 667wait(const sc_time &t) 668{ 669 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
670 if (waitErrorCheck(p)) 671 return; |
|
645 p->setTimeout(t); 646 p->clearDynamic(); 647 sc_gem5::scheduler.yield(); 648} 649 650void 651wait(double d, sc_time_unit u) 652{ 653 wait(sc_time(d, u)); 654} 655 656void 657wait(const sc_time &t, const sc_event &e) 658{ 659 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 672 p->setTimeout(t); 673 p->clearDynamic(); 674 sc_gem5::scheduler.yield(); 675} 676 677void 678wait(double d, sc_time_unit u) 679{ 680 wait(sc_time(d, u)); 681} 682 683void 684wait(const sc_time &t, const sc_event &e) 685{ 686 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
687 if (waitErrorCheck(p)) 688 return; |
|
660 p->setTimeout(t); 661 ::sc_gem5::newDynamicSensitivityEvent(p, &e); 662 sc_gem5::scheduler.yield(); 663} 664 665void 666wait(double d, sc_time_unit u, const sc_event &e) 667{ 668 wait(sc_time(d, u), e); 669} 670 671void 672wait(const sc_time &t, const sc_event_or_list &eol) 673{ 674 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 689 p->setTimeout(t); 690 ::sc_gem5::newDynamicSensitivityEvent(p, &e); 691 sc_gem5::scheduler.yield(); 692} 693 694void 695wait(double d, sc_time_unit u, const sc_event &e) 696{ 697 wait(sc_time(d, u), e); 698} 699 700void 701wait(const sc_time &t, const sc_event_or_list &eol) 702{ 703 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
704 if (waitErrorCheck(p)) 705 return; |
|
675 p->setTimeout(t); 676 ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol); 677 sc_gem5::scheduler.yield(); 678} 679 680void 681wait(double d, sc_time_unit u, const sc_event_or_list &eol) 682{ 683 wait(sc_time(d, u), eol); 684} 685 686void 687wait(const sc_time &t, const sc_event_and_list &eal) 688{ 689 sc_gem5::Process *p = sc_gem5::scheduler.current(); | 706 p->setTimeout(t); 707 ::sc_gem5::newDynamicSensitivityEventOrList(p, &eol); 708 sc_gem5::scheduler.yield(); 709} 710 711void 712wait(double d, sc_time_unit u, const sc_event_or_list &eol) 713{ 714 wait(sc_time(d, u), eol); 715} 716 717void 718wait(const sc_time &t, const sc_event_and_list &eal) 719{ 720 sc_gem5::Process *p = sc_gem5::scheduler.current(); |
721 if (waitErrorCheck(p)) 722 return; |
|
690 p->setTimeout(t); 691 ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal); 692 sc_gem5::scheduler.yield(); 693} 694 695void 696wait(double d, sc_time_unit u, const sc_event_and_list &eal) 697{ --- 82 unchanged lines hidden --- | 723 p->setTimeout(t); 724 ::sc_gem5::newDynamicSensitivityEventAndList(p, &eal); 725 sc_gem5::scheduler.yield(); 726} 727 728void 729wait(double d, sc_time_unit u, const sc_event_and_list &eal) 730{ --- 82 unchanged lines hidden --- |