summaryrefslogtreecommitdiff
path: root/src/systemc/core/sc_sensitive.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-14 00:04:22 -0700
committerGabe Black <gabeblack@google.com>2018-10-09 21:49:30 +0000
commit7bc110ce5c12f47105e851a1a54c26a83eba6b87 (patch)
tree67eaaf20063cffc51fbf4dbfb4156737382bfe2a /src/systemc/core/sc_sensitive.cc
parent8817e547e524cd81b5176cf277ef611920b0815a (diff)
downloadgem5-7bc110ce5c12f47105e851a1a54c26a83eba6b87.tar.xz
systemc: Refactor sensitivities.
Dynamic and Static sensitivities used to be represented by the same classes, even though they're (almost) disjoint in how they worked. Also timeouts, which can be used alongside dynamic sensitivities, were handled by the sensitivities themselves. That meant that the sensitivity mechanism had to mix in more types of behaviors, increasing complexity. Also, the non-standard timed_out function Accellera includes is harder to implement if the path for timeouts and regular sensitivities are mixed together. This change splits up dynamic and static sensitivities and splits out timeouts. It also immitates the ordering Accellera uses when going through sensitivities for an event. Static sensitivities are triggered first in reverse order (why?), and then dynamic sensitivities are triggered in what amounts to reverse order. To delete a sensitivity which has been handled, it's swapped with the one in the last position, and then the vector is truncated to drop it at the end. This has the net effect of stirring the dynamic sensitivities, and isn't easily immitated using a different approach, even if other approaches would be more straightforward. Double check addSensitivity for event.hh Change-Id: I1e73dce386b95f68e9d6737deb8bed70ef717e0d Reviewed-on: https://gem5-review.googlesource.com/c/12805 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/sc_sensitive.cc')
-rw-r--r--src/systemc/core/sc_sensitive.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/systemc/core/sc_sensitive.cc b/src/systemc/core/sc_sensitive.cc
index 25bc1bb08..93b460a4b 100644
--- a/src/systemc/core/sc_sensitive.cc
+++ b/src/systemc/core/sc_sensitive.cc
@@ -41,7 +41,7 @@ sc_sensitive &
sc_sensitive::operator << (const sc_event &e)
{
currentProcess->addStatic(
- new sc_gem5::PendingSensitivityEvent(currentProcess, &e));
+ new sc_gem5::StaticSensitivityEvent(currentProcess, &e));
return *this;
}
@@ -49,7 +49,7 @@ sc_sensitive &
sc_sensitive::operator << (const sc_interface &i)
{
currentProcess->addStatic(
- new sc_gem5::PendingSensitivityInterface(currentProcess, &i));
+ new sc_gem5::StaticSensitivityInterface(currentProcess, &i));
return *this;
}
@@ -57,7 +57,7 @@ sc_sensitive &
sc_sensitive::operator << (const sc_port_base &b)
{
currentProcess->addStatic(
- new sc_gem5::PendingSensitivityPort(currentProcess, &b));
+ new sc_gem5::StaticSensitivityPort(currentProcess, &b));
return *this;
}
@@ -65,7 +65,7 @@ sc_sensitive &
sc_sensitive::operator << (sc_event_finder &f)
{
currentProcess->addStatic(
- new sc_gem5::PendingSensitivityFinder(currentProcess, &f));
+ new sc_gem5::StaticSensitivityFinder(currentProcess, &f));
return *this;
}