sensitivity.hh (13260:4d18f1d20093) | sensitivity.hh (13262:ef4b783f84f7) |
---|---|
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 Process *process; 68 69 Sensitivity(Process *p) : process(p) {} 70 virtual ~Sensitivity() {} 71 72 virtual void addToEvent(const ::sc_core::sc_event *e) = 0; 73 virtual void delFromEvent(const ::sc_core::sc_event *e) = 0; 74 | 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 Process *process; 68 69 Sensitivity(Process *p) : process(p) {} 70 virtual ~Sensitivity() {} 71 72 virtual void addToEvent(const ::sc_core::sc_event *e) = 0; 73 virtual void delFromEvent(const ::sc_core::sc_event *e) = 0; 74 |
75 virtual bool 76 notifyWork(Event *e) 77 { 78 satisfy(); 79 return true; 80 } 81 | |
82 public: 83 virtual void clear() = 0; 84 85 void satisfy(); | 75 public: 76 virtual void clear() = 0; 77 78 void satisfy(); |
86 bool notify(Event *e); | 79 virtual bool notify(Event *e); |
87 88 enum Category 89 { 90 Static, 91 Dynamic, 92 Reset 93 }; 94 --- 207 unchanged lines hidden (view full) --- 302{ 303 private: 304 friend void newDynamicSensitivityEventOrList( 305 Process *p, const sc_core::sc_event_or_list *eol); 306 307 DynamicSensitivityEventOrList( 308 Process *p, const sc_core::sc_event_or_list *eol); 309 | 80 81 enum Category 82 { 83 Static, 84 Dynamic, 85 Reset 86 }; 87 --- 207 unchanged lines hidden (view full) --- 295{ 296 private: 297 friend void newDynamicSensitivityEventOrList( 298 Process *p, const sc_core::sc_event_or_list *eol); 299 300 DynamicSensitivityEventOrList( 301 Process *p, const sc_core::sc_event_or_list *eol); 302 |
310 bool notifyWork(Event *e) override; | 303 bool notify(Event *e) override; |
311}; 312 313//XXX This sensitivity can't be reused. To reset it, it has to be deleted and 314//recreated. That works for dynamic sensitivities, but not for static. 315//Fortunately processes can't be statically sensitive to sc_event_and_lists. 316class DynamicSensitivityEventAndList : 317 public DynamicSensitivity, public SensitivityEvents 318{ 319 private: 320 friend void newDynamicSensitivityEventAndList( 321 Process *p, const sc_core::sc_event_and_list *eal); 322 323 DynamicSensitivityEventAndList( 324 Process *p, const sc_core::sc_event_and_list *eal); 325 | 304}; 305 306//XXX This sensitivity can't be reused. To reset it, it has to be deleted and 307//recreated. That works for dynamic sensitivities, but not for static. 308//Fortunately processes can't be statically sensitive to sc_event_and_lists. 309class DynamicSensitivityEventAndList : 310 public DynamicSensitivity, public SensitivityEvents 311{ 312 private: 313 friend void newDynamicSensitivityEventAndList( 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 |
326 bool notifyWork(Event *e) override; | 319 bool notify(Event *e) override; |
327}; 328 329/* 330 * Reset sensitivities. 331 */ 332 333void newResetSensitivitySignal( 334 Process *p, const sc_core::sc_signal_in_if<bool> *signal, --- 15 unchanged lines hidden (view full) --- 350 friend void newResetSensitivitySignal( 351 Process *p, const sc_core::sc_signal_in_if<bool> *signal, 352 bool val, bool sync); 353 354 ResetSensitivitySignal( 355 Process *p, const sc_core::sc_signal_in_if<bool> *signal, 356 bool _val, bool _sync); 357 | 320}; 321 322/* 323 * Reset sensitivities. 324 */ 325 326void newResetSensitivitySignal( 327 Process *p, const sc_core::sc_signal_in_if<bool> *signal, --- 15 unchanged lines hidden (view full) --- 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 |
358 bool notifyWork(Event *e) override; | 351 bool notify(Event *e) override; |
359}; 360 361class ResetSensitivityPort : public ResetSensitivitySignal 362{ 363 private: 364 friend void newResetSensitivityPort( 365 Process *p, const sc_core::sc_in<bool> *port, bool val, bool sync); 366 friend void newResetSensitivityPort( --- 19 unchanged lines hidden --- | 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( --- 19 unchanged lines hidden --- |