Changeset 52 for sources/src/sc_sensitive.cc
- Timestamp:
- Jan 22, 2013, 4:23:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/sc_sensitive.cc
r27 r52 41 41 #include "sc_module.h" 42 42 #include "internal.h" 43 43 44 #ifdef HAVE_CONFIG_H 44 45 #include "config.h" … … 48 49 49 50 namespace sc_core { 50 void assert_before_init () 51 { 52 if (sc_core::already_initialized == true) 53 exit (14); 54 } 55 static 56 void add_sensitivity (const sc_event &s) 57 { 58 if (method == NULL) { 59 cerr << "declare a process before declaring " << s << " event\n"; 60 exit (1); 61 } 62 method->sensitivity_list.push_back(s); 63 } 51 52 53 void assert_before_init() { 54 if (sc_core::already_initialized) { 55 exit(14); 56 } 64 57 } 65 58 66 // 59 60 static void add_sensitivity(const sc_event & s) { 61 if (method == NULL) { 62 cerr << "declare a process before declaring " << s << " event\n"; 63 exit(1); 64 } 65 method->sensitivity_list.push_back(s); 66 } 67 68 } 69 70 67 71 using namespace sc_core; 68 72 … … 73 77 // ---------------------------------------------------------------------------- 74 78 75 sc_sensitive& sc_sensitive::operator << (const sc_port_base& port) 76 { 77 sc_event s (port,sc_event::VAL); 78 sc_core::add_sensitivity (s); 79 return *this; 79 sc_sensitive & sc_sensitive::operator << (const sc_port_base & port) { 80 sc_event s(port, sc_event::VAL); 81 sc_core::add_sensitivity(s); 82 return *this; 80 83 } 81 84 82 sc_sensitive& sc_sensitive::operator () (const sc_port_base& port) 83 {84 return *this << port;85 86 sc_sensitive & sc_sensitive::operator () (const sc_port_base & port) { 87 return *this << port; 85 88 } 86 89 87 sc_sensitive& sc_sensitive::operator << (const sc_event &e) 88 {89 sc_core::add_sensitivity(e);90 return *this;90 91 sc_sensitive & sc_sensitive::operator << (const sc_event & e) { 92 sc_core::add_sensitivity(e); 93 return *this; 91 94 } 92 95 93 sc_sensitive& sc_sensitive::operator () (const sc_event& e) 94 {95 return *this << e;96 97 sc_sensitive & sc_sensitive::operator () (const sc_event & e) { 98 return *this << e; 96 99 } 97 100 98 sc_sensitive& sc_sensitive::operator << (sc_event_finder& e) 99 {100 return *this << e.port();101 102 sc_sensitive & sc_sensitive::operator << (sc_event_finder & e) { 103 return *this << e.port(); 101 104 } 102 105 103 sc_sensitive& sc_sensitive::operator () (sc_event_finder& e) 104 {105 return *this << e;106 107 sc_sensitive & sc_sensitive::operator () (sc_event_finder & e) { 108 return *this << e; 106 109 } 107 110 108 sc_sensitive& sc_sensitive::operator << (const sc_interface &e) 109 {110 return *this << e.default_event();111 112 sc_sensitive & sc_sensitive::operator << (const sc_interface & e) { 113 return *this << e.default_event(); 111 114 } 112 115 113 sc_sensitive& sc_sensitive::operator () (const sc_interface &e) 114 {115 return *this << e;116 117 sc_sensitive & sc_sensitive::operator () (const sc_interface & e) { 118 return *this << e; 116 119 } 120 117 121 118 122 … … 124 128 // ---------------------------------------------------------------------------- 125 129 126 sc_sensitive_pos& sc_sensitive_pos::operator << (const sc_port_base& port) 127 {128 sc_event s (port,sc_event::POS);129 sc_core::add_sensitivity(s);130 return *this;130 131 sc_sensitive_pos & sc_sensitive_pos::operator << (const sc_port_base & port) { 132 sc_event s(port, sc_event::POS); 133 sc_core::add_sensitivity(s); 134 return *this; 131 135 } 132 136 133 sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_port_base& port) 134 {135 return *this << port;137 138 sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_port_base & port) { 139 return *this << port; 136 140 } 137 141 138 /*139 sc_sensitive_pos& sc_sensitive_pos::operator << (const sc_interface &e)140 {141 sc_event s (e, sc_event::POS);142 sc_core::add_sensitivity (s);143 return *this;144 };145 142 146 sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_interface &e)147 {148 return *this << e;149 };150 */151 143 152 144 // ---------------------------------------------------------------------------- … … 156 148 // ---------------------------------------------------------------------------- 157 149 158 sc_sensitive_neg& sc_sensitive_neg::operator << (const sc_port_base& port) 159 { 160 sc_event s (port,sc_event::NEG); 161 sc_core::add_sensitivity (s); 162 return *this; 150 sc_sensitive_neg & sc_sensitive_neg::operator << (const sc_port_base & port) { 151 sc_event s(port, sc_event::NEG); 152 sc_core::add_sensitivity(s); 153 return *this; 163 154 } 164 155 165 sc_sensitive_neg& sc_sensitive_neg::operator () (const sc_port_base& port) 166 {167 return *this << port;156 157 sc_sensitive_neg & sc_sensitive_neg::operator () (const sc_port_base & port) { 158 return *this << port; 168 159 } 169 160 170 161 171 162 163 /* 164 # Local Variables: 165 # tab-width: 4; 166 # c-basic-offset: 4; 167 # c-file-offsets:((innamespace . 0)(inline-open . 0)); 168 # indent-tabs-mode: nil; 169 # End: 170 # 171 # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 172 */ 173
Note: See TracChangeset
for help on using the changeset viewer.