History log of /gem5/src/systemc/core/sc_module.cc
Revision Date Author Comments
# 13785:3280e13bf334 12-Mar-2019 Gabe Black <gabeblack@google.com>

systemc: Hook up gem5_getPort to the gem5 getPort mechanism.

Change-Id: I771607c4436f4c1ca9d355d1da52924308cfc3b3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17229
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13382:7db1e345834c 02-Nov-2018 Gabe Black <gabeblack@google.com>

systemc: Change how SC_BIND_PROXY_NIL is initialized.

The previous implementation dereferenced a null pointer to create a
reference which would then have its address taken in the sc_bind_proxy
constructor. clang says that that uses undefined behavior, so this
change adds a default constructor which initializes the two contained
pointers to null explicitly.

We have to hope systemc code doesn't play around with sc_bind_proxy too
much and doesn't accidentally use this constructor unintentionally, but
it seems like the least bad possible solution which makes clang happy.

Change-Id: Ic59603495fe7a406586a18ce44de979f84089bcd
Reviewed-on: https://gem5-review.googlesource.com/c/13879
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13335:299a16ef8e3c 10-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Get rid of leftovers from unimplemented warnings past.

These warnings were removed when the functionality they warned about
was implemented, but there were some leftovers like unnecessary
includes and some helper functions which hid gem5 specific headers
from the ext directory.

Change-Id: Ic886ac0f1264687524e3a7b7eaab8836f318a5a2
Reviewed-on: https://gem5-review.googlesource.com/c/13398
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13317:36c574a4036e 07-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Switch to using predefined messages for core.

Create and use predefined messages for core which match the ones
Accellera uses.

Change-Id: I05b1398933f753946d5917f39d0f39c7cb45ed9f
Reviewed-on: https://gem5-review.googlesource.com/c/13323
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13315:baeb753a3f10 06-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Add a warning about dont_initialize and cthreads.

Change-Id: I7cc3e571a7a63eed383ad7f897342a539318f961
Reviewed-on: https://gem5-review.googlesource.com/c/13321
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13303:045f002c325c 06-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Distinguish internal events from normal sc_events.

The internal events aren't supposed to show up in the namespace or as
children of objects.

Change-Id: Id04b9bfe2e1f8f216390dd989797558eaf33d715
Reviewed-on: https://gem5-review.googlesource.com/c/13309
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13296:7f0348c6e8cf 05-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Add an error check to sc_gen_unique_name.

Accellera checks for a null pointer, and a test tries using that input.

Change-Id: I0f098f53de37ebbe481ea46e61fc0a9a404c29db
Reviewed-on: https://gem5-review.googlesource.com/c/13302
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13292:0dc64d73b440 04-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Add some deprecated positional binding operators.

These are used in one of the tests, specifically the comma operator. It
didn't cause compilation to fail because of the default meaning of the
comma.

Change-Id: I7ce7fe74f02d4ad6a4ab896a2f0d6bd1ce635c2f
Reviewed-on: https://gem5-review.googlesource.com/c/13298
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13288:f1c04129f709 04-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Change how signal based resets work.

The previous implementation used the value changed event to track when
signals changed value, but there were a couple problems with this
approach. First, this piggybacked on the sensitivity mechanism in some
ways, but diverged in others. The sensitivity didn't notify a process
when it was satisfied like other sensitivity types would, and it also
ignored whether the process was disabled.

Second, the value_changed_event is notified by a signal instance as a
delta notification, but reset signals are supposed to act immediately.
That means they should happen before all delta notifications, or in
other words all delta notifications should see the reset status of a
given process. That's particularly important in the case of wait(int n)
where setting the reset clears the reset count, and the count is
checked when determining whether or not to wake up a process when its
sensitivity is satisfied, potentially by a delta notification.

Third, by removing the middle man and not trying to repurpose the
sensitivity mechanism, the code gets simpler and easier to understand.

Change-Id: I0d05d11437291d368b060f6a45a207813615f113
Reviewed-on: https://gem5-review.googlesource.com/c/13294
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13285:86dc66ffac35 03-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Add an sc_gen_unique_name namespace to processes as well.

The standard says that there are namespaces for each module, and
one global namespace. Accellera also has namespaces for each process,
which shows up in the test output.

Change-Id: I4c8c5cecd5fb685d7bab521d9ae131aef23a6ab4
Reviewed-on: https://gem5-review.googlesource.com/c/13291
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13284:db01c2acd23f 03-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Add some error checks to the sc_module constructor.

These match error checks which are already in, for instance, the
sc_port constructor.

Change-Id: I8dfb4ce37bf0e59c6fa879f0afda5112af78b40b
Reviewed-on: https://gem5-review.googlesource.com/c/13290
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13280:3a1147706ccf 02-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Implement sc_hierarchical_name_exists.

This function checks the top level collection of events and objects
to find if one with a particular name exists.

Change-Id: Icf539b502fa9c7401be907ee975eb24a47e79a87
Reviewed-on: https://gem5-review.googlesource.com/c/13206
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13268:9802f3e0a6ae 28-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Centralize how object parents are chosen.

There's a lot of repeated code for this. Also, the sc_vector type
needs to be able to artificially inject a parent for the objects it
creates.

Change-Id: I76f9b551632cd2cd70e26741b215290b35c382e9
Reviewed-on: https://gem5-review.googlesource.com/c/13194
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13260:4d18f1d20093 26-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Implement signal based resets.

The implementation is based on sc_event sensitivities.

Also of note is that the way reset works in the Accellera
implementation isn't consistent with the spec. That says that
wait(int n) is supposed to be equivalent to calling wait() n times,
assuming n is greater than 0.

Instead, Accellera stores that count and then doesn't wake up the
process until the count is 0, decrementing it otherwise.

That means that when the process is in reset, it won't actually reset
for those intermediate wait()s which it would if wait() was called
repeatedly. Also, oddly, when a reset becomes asserted, it will clear
the count to 0 explicitly. That may have been an attempt to make the
behavior of wait(int n) match the spec, but it doesn't handle cases
where the reset is already set when wait(int n) is called.

Change-Id: I92f8e9a128e6618af94dc048ce570a4436e17e4b
Reviewed-on: https://gem5-review.googlesource.com/c/13186
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13248:a07071974510 22-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Make sure the right type process is running when calling wait.

That function is only allowed when running a thread or cthread.

Change-Id: Idf98b70018169d4f724aa8168f3c4e8161f0b83d
Reviewed-on: https://gem5-review.googlesource.com/c/12967
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13207:034ca389a810 14-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Rework how delayed sensitivities are handled.

Make BindInfo into a more general purpose Port class which mirrors
sc_module and Module, sc_object and Object, etc. This tracks multiple
bindings internally, and also pending sensitivities. Keep a global
list of ports which are added in reverse order to match Accellera, and
which is iterated over to finalize binding and for phase callbacks.
This is as opposed to doing it one module at a time, and is to better
match Accellera's ordering for the regressions.

Also the sensitivity classes are now built with factory functions,
which gets around problems calling virtual functions from their
constructors or forgetting to having to have extra boilerplate each
place they're constructed.

The port class also now finalizes port or event finder sensitivities
when its binding is completed, unless it's already complete in which
case it does so immediately.

Change-Id: I1b01689715c425b94e0f68cf0271f5c1565d8c61
Reviewed-on: https://gem5-review.googlesource.com/c/12806
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13206:c944ef4abb48 14-Sep-2018 Gabe Black <gabeblack@google.com>

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>


# 13194:9c6b495e650c 10-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Keep all pre-init processes on a single list.

We were keeping track of processes which should be initialized and
those which shouldn't on two different lists, and then processing
each list one after the other. This could reorder processes from the
order they were created, and so cause spurious differences which cause
the Accellera tests to fail.

This does make the scheduler slightly simpler, so it's not all bad.

Change-Id: I63306a41ce7bea91fa9ff2f6774ce9150134ce48
Reviewed-on: https://gem5-review.googlesource.com/c/12613
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13191:a2254693aa5b 07-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Centralize module callbacks and report new warnings.

By centralizing module callbacks, the gem5 module class knows when
different stages of the simulation are happening and can do it's own
extra checks. It also compartmentalizes modules more since the kernel
object doesn't have to reach into them to enumerate ports and exports.

Change-Id: I55887284af9c05150fe9d054f5b6147cad6092a1
Reviewed-on: https://gem5-review.googlesource.com/c/12610
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13189:057566bc8fd6 07-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Implement the deprecated "timed_out" function.

This function requires some slightly annoying bookkeeping since it
doesn't just report whether the current process is running as a result
of a timeout, it reports whether it's running as a result of a timeout
*and* it could have been running from some other sensitivity instead.
Pure timeouts don't count as timeouts which makes it harder to handle
in a general way.

Change-Id: I533d97fe66d20d7b83aba80f2ef45a8944668070
Reviewed-on: https://gem5-review.googlesource.com/c/12608
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13175:b93fb6caf043 05-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Implement the nonstandard halt function.

Change-Id: Ie9bd9db92a63169980230bc9a15e153d5609dd0b
Reviewed-on: https://gem5-review.googlesource.com/c/12594
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13155:4e77f1d0cdc3 01-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Implement the nonstandard at_negedge and at_posedge.

Change-Id: I7ea5cfd309db4b9883df551fd7dcec186e4f38a3
Reviewed-on: https://gem5-review.googlesource.com/c/12467
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13146:3539fe351218 01-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Report an error if n <= 0 in wait(int n).

This is in the spec, and tested by one of the regression tests.

Change-Id: I035cfad279be3859242919a95598f191d5d06165
Reviewed-on: https://gem5-review.googlesource.com/c/12458
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13135:4bb2f323fb1a 30-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: Raise an error when SC_METHOD, etc. is used after starting.

Those mechanisms for creating processes are only allowed before the
end of elaboration, or in other words before sc_start is called.
Technically the check in Accellera's implementation won't trigger if
the simulation is stopped, and we immitate that behavior.

Change-Id: I9b8b5bd32f876781b6e0d5c0ee0e09de19bdabc1
Reviewed-on: https://gem5-review.googlesource.com/c/12447
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13091:81fceed26e1e 23-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: Implement positional binding.

Change-Id: Ifbcd7e4148b82b9bf5241e040e812925daea3705
Reviewed-on: https://gem5-review.googlesource.com/12263
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13079:e7e261dd975b 22-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: If no sc_module_name was used, throw an error.

This is tested by the regression tests. Also make sure the handshake
which sets up instances of sc_module is cleaned up if we bail partway
through for some reason, for instance if an intermediate class throws
an exception as part of its constructor.

Change-Id: I89afe5f76832cc132aa2bb8f19916dea64546784
Reviewed-on: https://gem5-review.googlesource.com/12251
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13060:a5465580f647 16-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: Don't run clocked thread processes during the init phase.

Change-Id: I170d67fef61dd5536a842a1f64682d90ae7a1507
Reviewed-on: https://gem5-review.googlesource.com/12211
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13035:bafbdba2352a 07-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: Implement sc_gen_unique_name.

The Accellera implementation statically allocates the buffer it uses to
build the unique names and only allocates the name generator if it's
going to be used for a particular module. I assume that's to avoid
allocating a large buffer if it's not going to be used.

In this implementation, I use an std::string which manages its own
memory and so shouldn't need to be selectively allocated. I also use a
string stream to construct the name instead of sprintf.

Change-Id: If92c68586a85b5d27c067a75a6e9ebbf00d8c785
Reviewed-on: https://gem5-review.googlesource.com/12066
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12993:977fa1dfe9b3 20-Jul-2018 Gabe Black <gabeblack@google.com>

systemc: Implement much of sc_spawn.

This doesn't implement reset signals, although those aren't implemented
for static processes either yet.

Change-Id: I748a7f75b9b91774c91d969bc1ff5b07e1711aa3
Reviewed-on: https://gem5-review.googlesource.com/12044
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12982:c7966254372e 19-Jul-2018 Gabe Black <gabeblack@google.com>

systemc: Implement the various sc_module stage callbacks.

This change also gets rid of the SystemC namespace which was
deprecated in favor of sc_gem5.

A few utility functions which check whether certain callbacks have
finished were also implemented. status tracking moved from a global
variable in sc_main.cc to a member of the kernel simobject.

Change-Id: I50967fae9c576fbe45b1faff587aaa824857a289
Reviewed-on: https://gem5-review.googlesource.com/12033
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12958:a8188f40f342 16-Jul-2018 Gabe Black <gabeblack@google.com>

systemc: Implement next_trigger and wait.

These set up dynamic sensitivity.

Change-Id: I6cf2c2e4f93fe001eb7df8377753d51846b57d32
Reviewed-on: https://gem5-review.googlesource.com/11714
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12953:ddfd5e4643a9 03-Jul-2018 Gabe Black <gabeblack@google.com>

systemc: Partially implement the scheduler.

This change implements the "evaluate" part of the delta cycles, and
sketches out a function to run delta cycles and the initialization
phase. The kernel object now schedules an event at time zero which
runs the initialization phase.

Also, some small places which were stubbed out pending a way to check
the currently running process have been filled in now that that's
being tracked.

Change-Id: I6899569eb0195ff1c059fa4e68e90ef162b2f2df
Reviewed-on: https://gem5-review.googlesource.com/11709
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12952:94fca7e8120b 29-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Fill out sc_process_handle and create Process classes.

The sc_process_handle class now primarily delegates to a Process object
it points at. The Process object does book keeping as far as its
internal state, but doesn't yet have a way to run its target function
or to schedule itself or inject exceptions into its context of
execution.

Change-Id: I98389778abe29aa26e3e3a91bf02e6721acc8a9c
Reviewed-on: https://gem5-review.googlesource.com/11613
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12951:9db2476bea4e 25-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Implement some basic plumbing in sc_module.hh.

Take care of some low hanging fruit as far as wrapper methods and
the sc_bind_proxy class.

Change-Id: I7f55a37eeaa82338bd608218c0261fbc39e65fc2
Reviewed-on: https://gem5-review.googlesource.com/11612
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12930:f0e472cf340c 16-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add the nonstandard sc_hierarchical_name_exists function.

Change-Id: I1340bb6cb0ae29d81b5d73b3dd39ebb11c14802c
Reviewed-on: https://gem5-review.googlesource.com/11280
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12929:6ed4226c66c7 16-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add the nonstandard timed_out function.

Change-Id: If14a5f98f03448c712827b7f92d2a36992541518
Reviewed-on: https://gem5-review.googlesource.com/11279
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12928:1746600c4672 16-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add some deprecated sc_module constructors.

Change-Id: Ibe2bfe63536af33fca6040f4aef999ee928d876b
Reviewed-on: https://gem5-review.googlesource.com/11278
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12914:8fe7d8389c0f 15-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add some nonstandard cthread related sc_module functions.

Change-Id: I73f9868b80f9b75e7bd90df6e894daea60a203a1
Reviewed-on: https://gem5-review.googlesource.com/11268
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12909:88127fe770f5 15-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add the nonstandard, undocumented halt function.

Used in the tests.

Change-Id: I9b4f10600a50e0def1b5d55428cb4ad49e401295
Reviewed-on: https://gem5-review.googlesource.com/11263
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12901:72bc9ff65802 15-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add the nonstandard macro SC_NEW.

This is in the Accellera implementation and in the regression tests.
The implementation here is a bit different than theirs in that it uses
std::unique_ptrs.

Change-Id: Id3d1ad82482b94a5d99f27e02d1e447ca1944797
Reviewed-on: https://gem5-review.googlesource.com/11255
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 12837:413a7b490b1b 08-May-2018 Gabe Black <gabeblack@google.com>

systemc: Seperate the "external" header interface.

Most (but not all) of the SystemC headers are part of the "external"
interface that an existing, standard compliant module would include
through <systemc.h> or <systemc>. Since those follow slightly different
rules (relative includes, no gem5 includes), this change separates them
out so that they're easier to identify.

Also, this change moves the other files into a "core" subdirectory,
with the intention to add a "dt", aka data type, directory some time in
the future when those standard defined types are implemented.

Change-Id: Ida63f9cc0bc0431024d4dd691cc5b22b944a99a8
Reviewed-on: https://gem5-review.googlesource.com/10835
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>