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 --- 58 unchanged lines hidden (view full) --- 67 68 sc_core::sc_event *sc_event() { return _sc_event; } 69 70 const std::string &name() const; 71 const std::string &basename() const; 72 bool inHierarchy() const; 73 sc_core::sc_object *getParentObject() const; 74 |
75 void notify(StaticSensitivities &senses); 76 void notify(DynamicSensitivities &senses); 77 |
78 void notify(); 79 void notify(const sc_core::sc_time &t); 80 void 81 notify(double d, sc_core::sc_time_unit &u) 82 { 83 notify(sc_core::sc_time(d, u)); 84 } 85 void cancel(); --- 12 unchanged lines hidden (view full) --- 98 return e->_gem5_event; 99 } 100 101 void 102 addSensitivity(StaticSensitivity *s) const 103 { 104 // Insert static sensitivities in reverse order to match Accellera's 105 // implementation. |
106 auto &senses = s->ofMethod() ? staticSenseMethod : staticSenseThread; 107 senses.insert(senses.begin(), s); |
108 } 109 void 110 delSensitivity(StaticSensitivity *s) const 111 { |
112 auto &senses = s->ofMethod() ? staticSenseMethod : staticSenseThread; 113 for (auto &t: senses) { |
114 if (t == s) { |
115 t = senses.back(); 116 senses.pop_back(); |
117 break; 118 } 119 } 120 } 121 void 122 addSensitivity(DynamicSensitivity *s) const 123 { |
124 auto &senses = s->ofMethod() ? dynamicSenseMethod : dynamicSenseThread; 125 senses.push_back(s); |
126 } 127 void 128 delSensitivity(DynamicSensitivity *s) const 129 { |
130 auto &senses = s->ofMethod() ? dynamicSenseMethod : dynamicSenseThread; 131 for (auto &t: senses) { |
132 if (t == s) { |
133 t = senses.back(); 134 senses.pop_back(); |
135 break; 136 } 137 } 138 } 139 140 private: 141 sc_core::sc_event *_sc_event; 142 143 std::string _basename; 144 std::string _name; 145 bool _inHierarchy; 146 147 sc_core::sc_object *parent; 148 149 ScEvent delayedNotify; 150 |
151 mutable StaticSensitivities staticSenseMethod; 152 mutable StaticSensitivities staticSenseThread; 153 mutable DynamicSensitivities dynamicSenseMethod; 154 mutable DynamicSensitivities dynamicSenseThread; |
155}; 156 157extern Events topLevelEvents; 158extern Events allEvents; 159 160EventsIt findEvent(const std::string &name); 161 162} // namespace sc_gem5 163 164#endif //__SYSTEMC_CORE_EVENT_HH__ |