summaryrefslogtreecommitdiff
path: root/src/systemc
AgeCommit message (Collapse)Author
2018-12-10systemc: Update test output for longer lived processes.Gabe Black
In the systemc spec, process handles can be invalidated if they have no children and are terminated. The implementation is not required to do so however, and for the sake of simplicity gem5 currently does not. To quote: "When the underlying process instance terminates, if the process instance has no surviving children, an implementation may choose to invalidate any associated process handles, but it is not obliged to do so." Two tests have reference output which is affected by this (legal) difference in behavior. In one case, the test creates new processes which reuse the names of processes that have been terminated. Since gem5 doesn't invalidate the old processes, a standard mechanism is activated which renames the processes to something which is unique. The other test has this same problem, and also prints the hierarchy of processes several times during the test. In that hierarchy, the terminated tests with no live children are still present, where in the old reference output they've been removed. This change updates the reference output to match gem5's behavior. Change-Id: I363448de10080bdce01a4df92f991c67b31a2401 Reviewed-on: https://gem5-review.googlesource.com/c/14919 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Maintainer: Gabe Black <gabeblack@google.com>
2018-12-10systemc: Update the ordering in the reference output for some tests.Gabe Black
There are a number of cases where systemc leaves the decision of what order things happen up to the kernel, and any ordering is legal and conformant with the spec as long as it's repeatable. The reference outputs reflect a particular choice of ordering which is implementation specific, and while considerable effort has been made to make the gem5 ordering match the Accellera ordering, at a certain point that's no longer practical or desirable. This change manually updates the reference output for the tests that haven't been excluded for other reasons which have this sort of ordering problem. They have been individually examined, and as best as I can tell changing the output this way does not mask any underlying error. One or two real problems were discovered in addition to the ordering issues, and those were fixed in earlier changes. Change-Id: I915269998de3f33d5ab5d1fd754a830fd620184d Reviewed-on: https://gem5-review.googlesource.com/c/14918 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Maintainer: Gabe Black <gabeblack@google.com>
2018-12-10systemc: Ignore process control functions on terminated processes.Gabe Black
These functions can descend to the children of a terminated process, but should have no effect on that process itself. Change-Id: I6e4bdec8c492dd03d05bc1397aa080e8a51397c1 Reviewed-on: https://gem5-review.googlesource.com/c/14917 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Maintainer: Gabe Black <gabeblack@google.com>
2018-12-10systemc: Update signals before initing processes.Gabe Black
We were supposed to do one update phase before adding all processes which didn't have dont_initialize() called to the run queue. We were doing that in the opposite order. Change-Id: I6dd4108040d455dc78029da029a2eb5e7af819cb Reviewed-on: https://gem5-review.googlesource.com/c/14915 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Maintainer: Gabe Black <gabeblack@google.com>
2018-12-08base, systemc: Fix clang compilationGiacomo Travaglini
This patch is fixing the following issues: - base: typename should be used only for types - systemc: 'GCC_VERSION' is not defined for clang Change-Id: I27c94445d65691a08a0a14a0ffe6b6942f6c455f Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/14976 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-30systemc: Disable systemc when using gcc versions older than 5.0.Gabe Black
These versions don't support the std::put_time function. Since versions of gcc older than 5.0 aren't going to be supported at all in the fairly near future, this should only be temporary. The number of people using both systemc and older versions of gcc should be very small, or even zero. Change-Id: Ie9572fdf83ba9569df6bc0457c98d86565dcdcd8 Reviewed-on: https://gem5-review.googlesource.com/c/14755 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-29systemc: Run the systemc tests directly from their build directories.Gabe Black
We were previously running them from the current directory to start with, and then having the config script switch to the build directory. That worked, except when output streams might be opened as part of the global constructors which would run before the config script. This change makes us start from the build directory directly, making the switch in the config script unnecessary and ensuring that no files leak outside of the build when running tests. Change-Id: I484168793bfc5abc4e5631fb3468733fb9d829af Reviewed-on: https://gem5-review.googlesource.com/c/14519 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-29systemc: Run the systemc tests with the CWD in the build directory.Gabe Black
This will prevent some (but not all) output files the tests generate from ending up outside the build directory. Because some output file streams are constructed as global objects, their paths are resolved relative to the CWD when gem5 starts, before the config script has a chance to change it. Subsequent changes will make verify.py should make gem5 start with the correct working directory, cleaning up the remaining leaking files. Change-Id: I75a1256719dab4c98ab868c209d09b9dcdabb458 Reviewed-on: https://gem5-review.googlesource.com/c/14518 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-29systemc: Add DEPS files for some tests with non-source file dependencies.Gabe Black
This ensures that those files will be available when running the test relative to its build directory. Change-Id: If775ca328b3e1165baa968e4b39c36db0172837c Reviewed-on: https://gem5-review.googlesource.com/c/14517 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-29systemc: Make verify.py recognize a DEPS file in test dirs.Gabe Black
This file lists additional files beyond the sources that the test relies on, like files it uses when running. Change-Id: Ifc4958b26eed08689e0e72bd87f84388dbcf1898 Reviewed-on: https://gem5-review.googlesource.com/c/14516 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-27systemc: set endianess to fix build for ARM hostCiro Santilli
ARM architectures were not covered in the endianess #if cases, which lead the build to fail on an arm host with message: error The file boost/detail/endian.hpp needs to be set up for your CPU type. Change-Id: Id012cf37810da113174a51746e290e25138739cb Reviewed-on: https://gem5-review.googlesource.com/c/14595 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-19systemc: Stop explicitly adding the systemc ext dir to CPPPATH.Gabe Black
That's now handled automatically when the native systemc API is enabled. Change-Id: If1f88929af335a40554a9fd8df6f68aa1a4c0ba4 Reviewed-on: https://gem5-review.googlesource.com/c/14398 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-19systemc: Put systemc headers in the include path when supported.Gabe Black
When the native systemc API support is built in, put the systemc and systemc.h header files in the include path so they can be used as normal. We don't want any external systemc headers being included and getting mixed in with our local ones. Change-Id: I5fc01ff5f069cfadb7c19a9dead13e7ce7272976 Reviewed-on: https://gem5-review.googlesource.com/c/14397 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-19systemc: Increase the stack size for the sc_main fiber to 8MB.Gabe Black
This is a reasonable size for a stack, and the default size for a stack on Linux as determined by some quick Googling. The sc_main fiber would normally use the primary program stack if run under the standard systemc implementation, and so might expect to have more room to play with. Change-Id: Ie12344939e7b249da203630ebc7dc773a387d716 Reviewed-on: https://gem5-review.googlesource.com/c/14396 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-12systemc: Push python headers on top of sourcesGiacomo Travaglini
Some build failures has been seen after USE_SYSTEMC being True by default and that has been caused by double definition of _XOPEN_SOURCE and _POSIX_C_SOURCE in some python versions (like 2.7.5, 2.7.13) and /usr/include/features.h (used by gcc) Python definition should preceed features.h one, since the latter will manually #undef them before #define them. Change-Id: I774711aaf8145df9ad7677a393a60cf3662d6816 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/14095 Maintainer: Gabe Black <gabeblack@google.com>
2018-11-12systemc: Stop using python to set/manage the global time resolution.Gabe Black
Now that that's managed in c++, we can do that directly without having to depend on the python code being available, the code which lets us call from c++ to python, or for the embedded python interpretter to have started running and have loaded the appropriate modules. Change-Id: Ied110d8f22181095f8c0c645636a9bd67964263e Reviewed-on: https://gem5-review.googlesource.com/c/14056 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-11-09systemc: Get rid of a duplicated base class initializer for sc_fifo.Gabe Black
These were consistent, but redundant and incorrect none the less. Change-Id: I9ff7fdb9c83f9a8af6fbe969c6c73b9aab8967ad Reviewed-on: https://gem5-review.googlesource.com/c/14136 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-09systemc: Add a missing "const" on one of the sc_event operators.Gabe Black
Change-Id: I073ccb0f2c6d1bfebadb95869d6acf7f4ce565af Reviewed-on: https://gem5-review.googlesource.com/c/14135 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-09systemc: Only build python utility code if python is enabled.Gabe Black
Change-Id: I58054ddd0d5ef0dbee18028c4218e7418347f959 Reviewed-on: https://gem5-review.googlesource.com/c/13979 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-11-09systemc: Separate and conditionalize exposing sc_main to python.Gabe Black
Change-Id: Ib39dd79c607b277ba94f90dee41c09c1b3b66481 Reviewed-on: https://gem5-review.googlesource.com/c/13978 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-11-09systemc: Seperate out the sc_main fiber and its bookkeeping.Gabe Black
By pulling out the sc_main fiber (scMainFiber), we can make it available to different entities in the simulator and avoid having to have parallel bookkeeping. Also this will make it possible to hook into sc_main without putting the code in sc_main.cc. Change-Id: I7689441424238e9b2e4d2b48e945dea35fd8cc5d Reviewed-on: https://gem5-review.googlesource.com/c/13977 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-09systemc: Stop using python init to set up predefined message ids.Gabe Black
We can now be sure register_id will work even mid static initializers, so we don't have to use python initialization as a hook to install these predefined message ids. Change-Id: I2e4d0c678ddda0a9ce5b114bdf1710f36e955f23 Reviewed-on: https://gem5-review.googlesource.com/c/13976 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-11-09systemc: Wrap some report maps in functions.Gabe Black
By declaring the map as a static variable in that function and then returning it, we can guarantee that it's initialized relative to other static initializers so that we don't try to use a data structure that isn't constructed yet. This will let us get rid of the dependence on python for setting up that mapping. Change-Id: I031ce2039de8f5f79fbb9d76cf1363f15207b64b Reviewed-on: https://gem5-review.googlesource.com/c/13975 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-11-05systemc: Enable systemc support by default.Gabe Black
Change-Id: I9375518a54e14413a499d065f5bc5e1031834c81 Reviewed-on: https://gem5-review.googlesource.com/c/13535 Maintainer: Gabe Black <gabeblack@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
2018-11-05systemc: Explicitly keep the sc_port bind alongside sc_in's version.Gabe Black
The sc_in bind function was hiding the one from sc_port by changing the const-ness of its parameter. This change explicitly exposes the underlying sc_port version, and keeps it alongside the new sc_in version. This seems mildly dangerous and undesirable because now there are two very similar functions which would both need to be overridden in order to get new behavior, but I don't think it's any more dangerous and undesirable than as (perhaps unintentionally) specified in the standard. Change-Id: Ib42a1f8e70bc97abeeeb8d614e71c4019b3a2323 Reviewed-on: https://gem5-review.googlesource.com/c/13880 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-05systemc: Change how SC_BIND_PROXY_NIL is initialized.Gabe Black
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>
2018-11-05systemc: Get rid of implementations for some disabled sc_vector methods.Gabe Black
These don't need to exist, and the specifics of their stub implementations were upsetting clang. Change-Id: Ib38a39c5cfbc2e1647cfb6ed14c660e10df2b1c3 Reviewed-on: https://gem5-review.googlesource.com/c/13878 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-05systemc: Move a function after the class it uses internally.Gabe Black
The class was defined, but only later in the file. By putting the function definition later, clang stops reporting an error. Change-Id: Id4dd1ec3f3a06f4d1dc10ef4ff8c545d98a6ae12 Reviewed-on: https://gem5-review.googlesource.com/c/13877 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-11-05systemc: Get rid of an unused private member in sc_clock.Gabe Black
It's not useful, and having it makes clang upset. Change-Id: I51366fd18a287e186c88f08af5c6ba8692779003 Reviewed-on: https://gem5-review.googlesource.com/c/13876 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Get rid of leftovers from unimplemented warnings past.Gabe Black
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>
2018-10-16systemc: Implement Object::simcontext().Gabe Black
Implement it as a nonstandard alias for the also non-standard sc_get_curr_simcontext. Change-Id: Ic9a51efa93f687e4b57d622247a5510136fab221 Reviewed-on: https://gem5-review.googlesource.com/c/13397 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Stop filtering out warnings about unimplemented features.Gabe Black
These no longer cause any of the tests to break, so there's no reason to filter them out. Change-Id: I9c0b25fc42eb3060ac7d6d6a46ded130227c302d Reviewed-on: https://gem5-review.googlesource.com/c/13396 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Warn about using deprecated sc_port constructors.Gabe Black
This gets rid of one of the last instances of a warning about unimplemented functionality. Change-Id: I3d8e50ea45554cba969118ce873ed3d2b041ec43 Reviewed-on: https://gem5-review.googlesource.com/c/13395 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add a python config class for sc_modules.Gabe Black
This class doesn't really add anything, but it provides a consistent base class for sc_modules vs. generic sc_objects. Change-Id: I3fbd4f6b5d1be0b5419f5cbd304aec61d404a341 Reviewed-on: https://gem5-review.googlesource.com/c/13355 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Don't include the scheduler in an external header file.Gabe Black
The scheduler is an internal detail and shouldn't be exposed to the headers in ext. It would transitively include more headers which are not in ext, making it not self contained. Change-Id: I8384cde9d19363953ffd0c91e7d8d27f8f79a570 Reviewed-on: https://gem5-review.googlesource.com/c/13336 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add an accessor for getting the current process.Gabe Black
This is to avoid having to expose the scheduler (which tracks the current process) to header files which should be independent of gem5 and the underlying implementation. Change-Id: I1b0810ab66c3ce52b5b94236d7df86da66a62472 Reviewed-on: https://gem5-review.googlesource.com/c/13335 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Don't re-schedule a process which is already scheduled.Gabe Black
Change-Id: I8e12713c49aad03d0bfb779883adcbfa8fd4b42e Reviewed-on: https://gem5-review.googlesource.com/c/13334 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Fix accounting in the sc_fifo class.Gabe Black
Reads shouldn't free up space until an update happens. Change-Id: I18e1601c27b44643f103c86f04b1fa2c23baf1e8 Reviewed-on: https://gem5-review.googlesource.com/c/13333 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Exclude a test which tests a feature we're not implementing.Gabe Black
Change-Id: Ieaca025786d70c0d851eec9d1eb9f7f01b513cde Reviewed-on: https://gem5-review.googlesource.com/c/13332 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Switch to using predefined messages for datatypes.Gabe Black
Create and use predefined messages for datatypes which match the ones Accellera uses. Change-Id: I92dd52f62462b864264217bb81f3ff1dcec020bf Reviewed-on: https://gem5-review.googlesource.com/c/13331 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Switch to using predefined messages for channels.Gabe Black
Create and use predefined messages for channels which match the ones Accellera uses. Change-Id: I179214838bbd83604e50225926cdc6b5b1b16923 Reviewed-on: https://gem5-review.googlesource.com/c/13330 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Don't depend on the order of static initializers.Gabe Black
STL containers may need to be constructed before they're used. Don't count on being able to insert into them during a static initializer. Change-Id: Icb05d5084a470e1ebd976ae6e1954b1a78aabd6a Reviewed-on: https://gem5-review.googlesource.com/c/13329 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Switch to using predefined messages for utils.Gabe Black
Create and use predefined messages for utils which match the ones Accellera uses. Change-Id: I932b7206fc16181d01a0d5b7441ce617b30e5365 Reviewed-on: https://gem5-review.googlesource.com/c/13328 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Remove a redundant error check.Gabe Black
If the check doesn't abort the port binding in progress, it will be reported twice. Change-Id: I691ebd0f1598193f861c6085341dcd2fb05dd210 Reviewed-on: https://gem5-review.googlesource.com/c/13327 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Check the maximum port size when finializing bindings.Gabe Black
Change-Id: Ie7d704547bb8523a3c44479a89d2af4fcce6e8b6 Reviewed-on: https://gem5-review.googlesource.com/c/13326 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Fix how the maximum size is computed for sc_ports.Gabe Black
Change-Id: I073eb16cbeb892f24ac3860daca056ed2fb09086 Reviewed-on: https://gem5-review.googlesource.com/c/13325 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Mark a test as expected to fail.Gabe Black
This test expects to exit with an error. Change-Id: Id0b1ae4967ad0b8a356c7a04ed5fe9eb2f3c6641 Reviewed-on: https://gem5-review.googlesource.com/c/13324 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Switch to using predefined messages for core.Gabe Black
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>
2018-10-16systemc: Add a mechanism for pre-registering message type ids.Gabe Black
These ids are the ones the Accellera implementation/tests use. Some of the tests expect them to be available and usable. Change-Id: I4e4dc3470c28d4113330a44ccd06ffe7724e75b1 Reviewed-on: https://gem5-review.googlesource.com/c/13322 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Add a warning about dont_initialize and cthreads.Gabe Black
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>