summaryrefslogtreecommitdiff
path: root/src/systemc/core
AgeCommit message (Collapse)Author
2018-09-05systemc: Fill out sc_process_handle and create Process classes.Gabe Black
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>
2018-09-05systemc: Implement some basic plumbing in sc_module.hh.Gabe Black
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>
2018-09-05systemc: Implement most of sc_object.Gabe Black
To avoid making it hard to change sc_object's implementation in the future, this change keeps most of the data members out of sc_object and keeps them in a seperate Object which is managed independently but still matches to the sc_objects one to one. This change also moves away from the SystemC/sc_gem5 namespace pair in favor of sc_gem5. Having two namespaces with classes, etc, living in both was complicating things. Having to use a namespace that doesn't fit in one scheme or the other isn't great, but it's the lesser of two evils. Change-Id: Ib59c3c515ca98c7fe519c59e9fe9270304b71cc0 Reviewed-on: https://gem5-review.googlesource.com/11611 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Get sc_main to work even when dynamically linked.Gabe Black
Unfortunately multiply defined weak symbols don't work like they're supposed to when the different versions are across dynamic linking boundaries. Fortunately, a weak symbol with no definition at all will still consistently evaluate as 0, and a singularly defined weak symbol will still resolve correctly. Instead of relying on a weak version of sc_main being overridden by a strong/non-default definition, this change leaves it as undefined and detects at run time whether the symbol resolves to 0 or to an actual code location. Change-Id: I31c4ff769b0c52277c6cf4845ca3f85000009583 Reviewed-on: https://gem5-review.googlesource.com/11610 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement the sc_attr classes.Gabe Black
Change-Id: Ibbe6da957b1b36687178f226e80718adc0f4ab81 Reviewed-on: https://gem5-review.googlesource.com/11609 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Enable some more sc_simcontext related tests.Gabe Black
Now that we bit the bullet and stubbed out sc_simcontext and related functions a little bit, we can enable a couple more tests. This change also adds in some functions the new tests expect sc_simcontext to have. Change-Id: I00b5cc0c6eb658eb689b9c85ed171f290009768d Reviewed-on: https://gem5-review.googlesource.com/11356 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Add the nonstandard sc_join class and sc_thread_handle type.Gabe Black
Change-Id: I09905bad4797d9c456229afe601006ce16977394 Reviewed-on: https://gem5-review.googlesource.com/11353 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Minimally implemented the deprecated sc_simcontext.Gabe Black
This is supposed to be deprecated, but is still used in a small way by the tests. Change-Id: I94fc32f9e0f03d50c00ce5421926203859064020 Reviewed-on: https://gem5-review.googlesource.com/11352 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add a minimal version of the deprecated sc_process_b.Gabe Black
This type is deprecated, but some tests still rely on it. This change adds just enough of it to satisfy the tests, and also the several different mechanisms for retrieving the sc_process_b which refers to the currently active process. Change-Id: Id122ae5df23744b5de1e1c97573412f97a73b77a Reviewed-on: https://gem5-review.googlesource.com/11351 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add bind() to sc_port_base.Gabe Black
sc_port_base is supposed to be implementation defined, but internal details of it are relied on by the systemc tests. Change-Id: I53d84e708a5543a2cf4bd0deffc2efea1c008d97 Reviewed-on: https://gem5-review.googlesource.com/11350 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add the nonstandard sc_hierarchical_name_exists function.Gabe Black
Change-Id: I1340bb6cb0ae29d81b5d73b3dd39ebb11c14802c Reviewed-on: https://gem5-review.googlesource.com/11280 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add the nonstandard timed_out function.Gabe Black
Change-Id: If14a5f98f03448c712827b7f92d2a36992541518 Reviewed-on: https://gem5-review.googlesource.com/11279 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add some deprecated sc_module constructors.Gabe Black
Change-Id: Ibe2bfe63536af33fca6040f4aef999ee928d876b Reviewed-on: https://gem5-review.googlesource.com/11278 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add the non-standard sc_time_tuple class.Gabe Black
Change-Id: Ia3d6a6a4ea3383c82605653faac570ced7bebb70 Reviewed-on: https://gem5-review.googlesource.com/11277 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add deprecated sc_time constructors.Gabe Black
Change-Id: Iffae751272302ff2996258a1ab31b086e12bbb8d Reviewed-on: https://gem5-review.googlesource.com/11275 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add some deprecated sc_time factory methods.Gabe Black
Change-Id: I0d9a7040a48b9f0d0079e9daecaf44ea78c186de Reviewed-on: https://gem5-review.googlesource.com/11273 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add deprecated default time unit management functions.Gabe Black
Having default time units is deprecated, and so are the functions that manage them. Change-Id: Ie21f9a5fca9868dd4f0adcd9f32c568fbec1fa72 Reviewed-on: https://gem5-review.googlesource.com/11270 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add deprecated notify_delayed functions.Gabe Black
Change-Id: I8ec68920b35f9207b6856a0b1ddfdf7545b7148a Reviewed-on: https://gem5-review.googlesource.com/11269 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add some nonstandard cthread related sc_module functions.Gabe Black
Change-Id: I73f9868b80f9b75e7bd90df6e894daea60a203a1 Reviewed-on: https://gem5-review.googlesource.com/11268 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add the nonstandard, undocumented halt function.Gabe Black
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>
2018-08-22systemc: Add the nonstandard macro SC_NEW.Gabe Black
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>
2018-08-22systemc: Add the nonstandard triggered function sc_event.Gabe Black
The Accellera implementation of sc_event has a non-standard triggered function which returns whether or not that particular event has been triggered in the current delta cycle. The tests call it, so we probably need to have it. Change-Id: I675099b65d00e09536618d4d2d707bf3c25e3bde Reviewed-on: https://gem5-review.googlesource.com/11187 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add the nonstandard variable sc_allow_process_control_corners.Gabe Black
This variable controls what happens in some situations which are left as undefined in the spec. It's behavior is explained in a big comment in the Accellera implementation. Since it's used in the regression tests, we need to at least have that variable so they'll compile and link properly. Change-Id: I1ac4592641be3d9dd10e7bf6144704a6fac1b2d4 Reviewed-on: https://gem5-review.googlesource.com/11186 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add some "implementation defined" stuff to sc_attr_cltn.Gabe Black
These "impelementation defined" methods are tested by the regression tests, so we need to have them. We might as well have the same general interface as the Accellera implementation since nothing there seems overly specialized for that environment. Change-Id: Ief6567fcd9d99d3a0f526cfa3b65043b2c828efa Reviewed-on: https://gem5-review.googlesource.com/11185 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Construct and manage a module name stack.Gabe Black
Change-Id: I5f7f64d6c3d7e08ec6d2529f3c5d84fbfc2c421b Reviewed-on: https://gem5-review.googlesource.com/10850 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Make sc_main run in its own fiber.Gabe Black
The fiber will run until either sc_main returns, or until sc_start is called. If sc_start is called, then the fiber will only be paused and waiting for simulation cycles to be run by gem5. Once sc_pause and sc_stop are implemented, if those are called the sc_main fiber will be re-entered and allowed to run further towards completion. Change-Id: I4df94f4f6fed8d49471732619a203d734d9a13a6 Reviewed-on: https://gem5-review.googlesource.com/10849 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Implement some simple accessor functions in sc_main.cc.Gabe Black
These functions just read or write values with minimal amounts of logic. Change-Id: I22d5b49a2550a88a854d1619f08b0055c1312271 Reviewed-on: https://gem5-review.googlesource.com/10847 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Add some missing functions which interact with the scheduler.Gabe Black
Change-Id: Ifc8c8d4a7bb6e941485e80f4884cfa4bb648c17c Reviewed-on: https://gem5-review.googlesource.com/10846 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-07-24systemc: Flesh out the sc_port implementation slightly.Gabe Black
This makes other files compile because it changes the relationship between constructors,etc., slightly. Change-Id: I8d9a6e12ec640a82da166fe05c4f5e91f3f608de Reviewed-on: https://gem5-review.googlesource.com/10840 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-07-24systemc: Stub out the sc_spawn related classes and functions.Gabe Black
Change-Id: I79f695cca97aaae9af324eb18cab073f42f0a193 Reviewed-on: https://gem5-review.googlesource.com/10837 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-07-24systemc: Stub out the sc_process_handle class.Gabe Black
Change-Id: I2250ccb369e0a5f2b9172d35662a9ce5e41ab1c1 Reviewed-on: https://gem5-review.googlesource.com/10836 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-07-24systemc: Seperate the "external" header interface.Gabe Black
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>