From f2ab5e7a9e11783da3b9d7338775cf4b5fe2c29c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 16 Jul 2018 16:14:33 -0700 Subject: systemc: Implement the sensitivity mechanism. This change lets processes be sensitive to events, timeouts, etc. Change-Id: If30a256dfa8a2e92192c1f9c96b48e2aa28ec27e Reviewed-on: https://gem5-review.googlesource.com/11713 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/core/sc_sensitive.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/systemc/core/sc_sensitive.cc') diff --git a/src/systemc/core/sc_sensitive.cc b/src/systemc/core/sc_sensitive.cc index d233cda6a..25bc1bb08 100644 --- a/src/systemc/core/sc_sensitive.cc +++ b/src/systemc/core/sc_sensitive.cc @@ -28,6 +28,8 @@ */ #include "base/logging.hh" +#include "systemc/core/process.hh" +#include "systemc/ext/core/sc_interface.hh" #include "systemc/ext/core/sc_sensitive.hh" namespace sc_core @@ -36,30 +38,34 @@ namespace sc_core sc_sensitive::sc_sensitive() : currentProcess(nullptr) {} sc_sensitive & -sc_sensitive::operator << (const sc_event &) +sc_sensitive::operator << (const sc_event &e) { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); + currentProcess->addStatic( + new sc_gem5::PendingSensitivityEvent(currentProcess, &e)); return *this; } sc_sensitive & -sc_sensitive::operator << (const sc_interface &) +sc_sensitive::operator << (const sc_interface &i) { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); + currentProcess->addStatic( + new sc_gem5::PendingSensitivityInterface(currentProcess, &i)); return *this; } sc_sensitive & -sc_sensitive::operator << (const sc_port_base &) +sc_sensitive::operator << (const sc_port_base &b) { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); + currentProcess->addStatic( + new sc_gem5::PendingSensitivityPort(currentProcess, &b)); return *this; } sc_sensitive & -sc_sensitive::operator << (sc_event_finder &) +sc_sensitive::operator << (sc_event_finder &f) { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); + currentProcess->addStatic( + new sc_gem5::PendingSensitivityFinder(currentProcess, &f)); return *this; } -- cgit v1.2.3