systemc: Refactor sensitivities.
authorGabe Black <gabeblack@google.com>
Fri, 14 Sep 2018 07:04:22 +0000 (00:04 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 9 Oct 2018 21:49:30 +0000 (21:49 +0000)
commit7bc110ce5c12f47105e851a1a54c26a83eba6b87
tree67eaaf20063cffc51fbf4dbfb4156737382bfe2a
parent8817e547e524cd81b5176cf277ef611920b0815a
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>
12 files changed:
src/systemc/core/SConscript
src/systemc/core/event.cc
src/systemc/core/event.hh
src/systemc/core/process.cc
src/systemc/core/process.hh
src/systemc/core/sc_module.cc
src/systemc/core/sc_sensitive.cc
src/systemc/core/sc_spawn.cc
src/systemc/core/sensitivity.cc [new file with mode: 0644]
src/systemc/core/sensitivity.hh [new file with mode: 0644]
src/systemc/ext/core/sc_event.hh
src/systemc/ext/core/sc_port.hh