sensitivity.hh (13262:ef4b783f84f7) | sensitivity.hh (13288:f1c04129f709) |
---|---|
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 --- 67 unchanged lines hidden (view full) --- 76 virtual void clear() = 0; 77 78 void satisfy(); 79 virtual bool notify(Event *e); 80 81 enum Category 82 { 83 Static, | 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 --- 67 unchanged lines hidden (view full) --- 76 virtual void clear() = 0; 77 78 void satisfy(); 79 virtual bool notify(Event *e); 80 81 enum Category 82 { 83 Static, |
84 Dynamic, 85 Reset | 84 Dynamic |
86 }; 87 88 virtual Category category() = 0; 89 90 bool ofMethod(); 91}; 92 93 94/* | 85 }; 86 87 virtual Category category() = 0; 88 89 bool ofMethod(); 90}; 91 92 93/* |
95 * Dynamic vs. static vs. reset sensitivity. | 94 * Dynamic vs. static sensitivity. |
96 */ 97 98class DynamicSensitivity : virtual public Sensitivity 99{ 100 protected: 101 DynamicSensitivity(Process *p) : Sensitivity(p) {} 102 103 void addToEvent(const ::sc_core::sc_event *e) override; --- 15 unchanged lines hidden (view full) --- 119 void delFromEvent(const ::sc_core::sc_event *e) override; 120 121 public: 122 Category category() override { return Static; } 123}; 124 125typedef std::vector<StaticSensitivity *> StaticSensitivities; 126 | 95 */ 96 97class DynamicSensitivity : virtual public Sensitivity 98{ 99 protected: 100 DynamicSensitivity(Process *p) : Sensitivity(p) {} 101 102 void addToEvent(const ::sc_core::sc_event *e) override; --- 15 unchanged lines hidden (view full) --- 118 void delFromEvent(const ::sc_core::sc_event *e) override; 119 120 public: 121 Category category() override { return Static; } 122}; 123 124typedef std::vector<StaticSensitivity *> StaticSensitivities; 125 |
127class ResetSensitivity : virtual public Sensitivity 128{ 129 private: 130 bool _val; 131 bool _sync; | |
132 | 126 |
133 protected: 134 ResetSensitivity(Process *p, bool _val, bool _sync) : 135 Sensitivity(p), _val(_val), _sync(_sync) 136 {} 137 138 void addToEvent(const ::sc_core::sc_event *e) override; 139 void delFromEvent(const ::sc_core::sc_event *e) override; 140 141 bool val() { return _val; } 142 bool sync() { return _sync; } 143 144 public: 145 Category category() override { return Reset; } 146}; 147 148typedef std::vector<ResetSensitivity *> ResetSensitivities; 149 150 | |
151/* 152 * Sensitivity to an event or events, which can be static or dynamic. 153 */ 154 155class SensitivityEvent : virtual public Sensitivity 156{ 157 protected: 158 const ::sc_core::sc_event *event; --- 155 unchanged lines hidden (view full) --- 314 Process *p, const sc_core::sc_event_and_list *eal); 315 316 DynamicSensitivityEventAndList( 317 Process *p, const sc_core::sc_event_and_list *eal); 318 319 bool notify(Event *e) override; 320}; 321 | 127/* 128 * Sensitivity to an event or events, which can be static or dynamic. 129 */ 130 131class SensitivityEvent : virtual public Sensitivity 132{ 133 protected: 134 const ::sc_core::sc_event *event; --- 155 unchanged lines hidden (view full) --- 290 Process *p, const sc_core::sc_event_and_list *eal); 291 292 DynamicSensitivityEventAndList( 293 Process *p, const sc_core::sc_event_and_list *eal); 294 295 bool notify(Event *e) override; 296}; 297 |
322/* 323 * Reset sensitivities. 324 */ 325 326void newResetSensitivitySignal( 327 Process *p, const sc_core::sc_signal_in_if<bool> *signal, 328 bool val, bool sync); 329 330void newResetSensitivityPort( 331 Process *p, const sc_core::sc_in<bool> *port, bool val, bool sync); 332void newResetSensitivityPort( 333 Process *p, const sc_core::sc_inout<bool> *port, bool val, bool sync); 334void newResetSensitivityPort( 335 Process *p, const sc_core::sc_out<bool> *port, bool val, bool sync); 336 337class ResetSensitivitySignal : 338 public ResetSensitivity, public SensitivityEvent 339{ 340 protected: 341 const sc_core::sc_signal_in_if<bool> *_signal; 342 343 friend void newResetSensitivitySignal( 344 Process *p, const sc_core::sc_signal_in_if<bool> *signal, 345 bool val, bool sync); 346 347 ResetSensitivitySignal( 348 Process *p, const sc_core::sc_signal_in_if<bool> *signal, 349 bool _val, bool _sync); 350 351 bool notify(Event *e) override; 352}; 353 354class ResetSensitivityPort : public ResetSensitivitySignal 355{ 356 private: 357 friend void newResetSensitivityPort( 358 Process *p, const sc_core::sc_in<bool> *port, bool val, bool sync); 359 friend void newResetSensitivityPort( 360 Process *p, const sc_core::sc_inout<bool> *port, 361 bool val, bool sync); 362 friend void newResetSensitivityPort( 363 Process *p, const sc_core::sc_out<bool> *port, 364 bool val, bool sync); 365 366 ResetSensitivityPort( 367 Process *p, const sc_core::sc_port_base *port, 368 bool _val, bool _sync) : 369 Sensitivity(p), ResetSensitivitySignal(p, nullptr, _val, _sync) 370 {} 371 372 public: 373 void setSignal(const ::sc_core::sc_signal_in_if<bool> *signal); 374}; 375 | |
376} // namespace sc_gem5 377 378#endif //__SYSTEMC_CORE_SENSITIVITY_HH__ | 298} // namespace sc_gem5 299 300#endif //__SYSTEMC_CORE_SENSITIVITY_HH__ |