summaryrefslogtreecommitdiff
path: root/src/systemc/tests
AgeCommit message (Collapse)Author
2018-09-20systemc: Ignore a warning in the reference test outputs.Gabe Black
The warning is about deprecated sc_module constructors which don't take an sc_module_name. Change-Id: I2ef864a5bdac93eb8104a842179ffe45a8335085 Reviewed-on: https://gem5-review.googlesource.com/12068 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Always set USE_SYSTEMC=1 when compiling with verify.py.Gabe Black
It doesn't make sense not to have systemc enabled when building the systemc regression tests. Change-Id: I23b81fd4d7cbd0dbf5efbea773d816296d6492be Reviewed-on: https://gem5-review.googlesource.com/12065 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-20systemc: Make verify.py ignore an Info: message.Gabe Black
This message is about how to disable a warning about sc_bit being deprecated. Change-Id: I1a0b12e2ca5b58328e37605ba3f7e3e1a384e351 Reviewed-on: https://gem5-review.googlesource.com/12064 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Make verify.py ignore another warning.Gabe Black
Also make warning filters more general and easier to add by writing a function to generate them. Change-Id: I8d813ded9ad8a9ccac4e48e5ea80a3c9c23959da Reviewed-on: https://gem5-review.googlesource.com/12061 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Make verify.py compare non output log reference files.Gabe Black
There are only a few of these which are vcd files. If there are reference files which aren't the log and which aren't in the gem5 output directory, mark those tests as failed as well. Change-Id: I2c880c13d0f90ccf16ac0439dbac68de9223cc90 Reviewed-on: https://gem5-review.googlesource.com/12060 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Delete empty/misnamed test reference file.Gabe Black
The name of the reference file doesn't match the name of the test, and is empty. There's also a correctly named log file in the same directory which will be used instead. Change-Id: I6501b465b99af403ae4af6d43189280c4b45fc8f Reviewed-on: https://gem5-review.googlesource.com/12059 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Remove some junk test reference files.Gabe Black
These files have truncated names, and are identical to correct versions of the log files. Change-Id: I1e5e3c8c489d41dea21f62b4664b05bf6a742117 Reviewed-on: https://gem5-review.googlesource.com/12058 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Make verify.py delete obsolete diff files.Gabe Black
If diff file exists but the underlying diff has been fixed, delete the diff file. Change-Id: Icadc21a61c084198a8a246ab6d00a9b885647cde Reviewed-on: https://gem5-review.googlesource.com/12056 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Make verify.py ignore a warning.Gabe Black
Change-Id: Ia887b7195d84d0ba9e77370d7b928e201ca78731 Reviewed-on: https://gem5-review.googlesource.com/12055 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Teach verify.py to diff files when checking test results.Gabe Black
Currently it just diffs the stdout and ignores other reference files. It also doesn't filter out noise in the diffs from non test related simulator messages. These include startup messages, messages when the simulator finishes executing, and some non-standard warnings, etc. Change-Id: Idcb19edd893cd8818423c2c5ebb6cbfb278baffa Reviewed-on: https://gem5-review.googlesource.com/12054 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Add return code verification to verify.py.Gabe Black
This just checks whether gem5 exited of its own accord with a successful error code, or in other words that it didn't hang or crash. More checking will need to be added to verify the output against the golden reference. Change-Id: I1ddef56aa73b5f700743830bd6212804531c484f Reviewed-on: https://gem5-review.googlesource.com/12053 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Record the test's return code in the output directory.Gabe Black
verify.py will be able to use that value later to determine whether a test was successful. Change-Id: Ib499a4b6f202ee46e66e5de1b61a7e6309df9886 Reviewed-on: https://gem5-review.googlesource.com/12052 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Extend the execute phase of verify.py.Gabe Black
Add -j and --timeout options to the execute phase of verify.py. The --timeout option is implemented using the timeout utility program which is assumed to be available on the host system. Python 3.3 added a timeout argument to the subprocess module which is an alternative approach, but then we would be dependent on python 3.3. -j is implemented using the standard multiprocess.pool.ThreadPool class. Change-Id: I15b92f2b14de6710e2027a6a19984b2644b2a8df Reviewed-on: https://gem5-review.googlesource.com/12051 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Disable tests which use sensitive_(pos|neg).Gabe Black
Those members are deprecated and not worth supporting. Change-Id: I30b64b36ba3201bb0bcbb541da512676c2bf8510 Reviewed-on: https://gem5-review.googlesource.com/11357 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-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: Make the verify.py --list option print a total count.Gabe Black
Make the --list option of verify.py print a count of how many tests it printed. Because --list respects the filter options, this is an easy way to check how many tests have certain properties. Change-Id: I03fac349a946631c20c8e6b49e0ad8934872898e Reviewed-on: https://gem5-review.googlesource.com/11288 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Disable a few more tests that aren't going to work.Gabe Black
One would never have worked as far as I can tell, and the others depend on a feature that breaks building the systemc library. Change-Id: Ia3db31a15675ca6df2db16362ee2d9c8700cd0af Reviewed-on: https://gem5-review.googlesource.com/11287 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Disable the phase_callbacks set of tests.Gabe Black
This feature is experimental, nonstandard, and would in some cases be difficult to implement in gem5. Change-Id: Ic7fe77e6a2e9dbc5aba06579fb85fd2f055cb6b1 Reviewed-on: https://gem5-review.googlesource.com/11285 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-28systemc: Add some common test include files.Gabe Black
These are "common" in the sense that they're not in a particular test directory, but I think they're only used by one test. Change-Id: I4ffd209d04ed0e5253085810913827b87412b302 Reviewed-on: https://gem5-review.googlesource.com/11272 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Exclude another test which exercises sc_string.Gabe Black
Change-Id: Ic05fe3d34ef403dd6ad9348478f73c6ed50cc7bc Reviewed-on: https://gem5-review.googlesource.com/11264 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Exclude a test which probably could never compile?Gabe Black
Part of this test just seems to be missing, so I'm not sure how it would ever actually work. Change-Id: I5350fea1dfd288e34e01afcd3780b2ffc3312344 Reviewed-on: https://gem5-review.googlesource.com/11260 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add a filter file for the tests which are expected to work.Gabe Black
Not all of the tests this filter accepts actually work, but we haven't yet explicitly decided not to try to make them tests work yet. Recording this in a file makes test runs more repeateable, and creates a place to record why certain tests or groups of tests are being excluded. Change-Id: I91d44b6500a3e8ff5d5808222ce03f138374cf8b Reviewed-on: https://gem5-review.googlesource.com/11258 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Add a filter-file option.Gabe Black
The --filter option is very useful, but can get to be long and complex and a bit too cumbersome to use from the command line. This change adds a --filter-file option which is mutually exclusive with --filter and which reads the filter expression from a file instead of accepting it on the command line. Change-Id: I381c92ddf0d9fe62acd20432fa4868e2121405b8 Reviewed-on: https://gem5-review.googlesource.com/11257 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-22systemc: Fix a small bug in verify.py.Gabe Black
The src_dir method of the Test class was using the wrong attribute of the test from the json file. It should use path, but was using src_dir. Change-Id: Iaaaf31c31b11b68ecd7dd98807e6b78597cebb99 Reviewed-on: https://gem5-review.googlesource.com/12029 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Remove references to internal constants from the tests.Gabe Black
The tests were referring to constants defined in the Accellera systemc implementation which identified various log message types. This change replaces those (sometimes quite long) string constants with their actual value. This doesn't make that interface any more fragile since the constant value won't track between the Accellera version and this one, but it does make its fragility more explicit by using the value directly. If in the future we decide to hide the magical nature of those particular string constants, we could make them into our own constants in the implementation. Regardless, the tests shouldn't refer to internal details of the implementation. Change-Id: I116a7407fcac49367649b250683117f3ccf4f9ed Reviewed-on: https://gem5-review.googlesource.com/11181 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Remove more Accellera source specific include paths in tests.Gabe Black
Some more tests were including Accellera headers specifically, even after including systemc.h which would bring those headers in alongside all the others. Change-Id: Ib2db0a410e0ecea0035b636e8dd04c85045b8578 Reviewed-on: https://gem5-review.googlesource.com/11179 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Make a test stop including an internal path for sc_vector.Gabe Black
The sc_vector class is available through systemc.h already, so there's no reason to include an internal path which is only there on Accellera by coincidence of the implementation. Change-Id: I41cab4711c0837cd9b20c21871b79be5165bf498 Reviewed-on: https://gem5-review.googlesource.com/11176 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc: Add a script which automates building and running tests.Gabe Black
The only required option for the script is the path to a build directory, for instance build/ARM. It uses that when running scons and when referring to generated files (like the built versions of the tests). It uses the location of the script itself to find source files, like the "golden" version of outputs. This script runs tests in three phases, compilation, running, and then verification. By default, all three phases are run for all tests, but which phases run and how they work can be customized by specifying them explicitly on the command line with the --phase option. Each time the --phase option shows up on the command line, it should be followed by the name of the phase being specified. That both declares that that phase should be run, and also that any subsequent options apply to that phase, at least until the next --phase option. Currently, only the "compile" and "execute" phases are implemented, and only the "compile" phase has been tested at all or has any options defined. The "compile" phase simply takes all the options it was given and pass them on to scons. The "verify" phase simply prints a message which says what it would have verified. The script can list the available tests with the --list option, as determined by the json systemc test manifest file which scons can generate, and which the script can refresh if passed the --update-json option. You can also specify what "flavor" of build you want to do, ie opt, debug, fast, etc., with the --flavor option. Only one flavor can be tested at a time, but that should be the desired behavior most of the time. If multiple flavors need to be tested, the script can be invoked multiple times. Finally, there is a --filter option which accepts a python expression as a string. That expression is evaluated in the namespace of the properties of each test in the json file, and if it returns true then that test is run. For instance, to verify only compile_only tests, you would use: systemc/tests/verify.py build/ARM --filter 'compile_only' To test only compile_only tests named bob, you would run this: systemc/tests/verify.py build/ARM --filter \ 'compile_only && name ="bob"' Also included is a simple config.py which is the beginning of a config which will run the systemc regression tests. Right now, all it knows how to do is run sc_main. Change-Id: I62666be8b1622d1355153e623b4274a939507e44 Reviewed-on: https://gem5-review.googlesource.com/10975 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc, scons: Link systemc tests against the shared gem5 library.Gabe Black
Otherwise, having hundreds of statically linked gem5s takes up a huge amount of space, and all those repeated linkings brings the mightiest workstation to its knees with sufficient parallelism, or will take forever without it. Change-Id: I4c358b1a50c5e2b0027ac72423f887e24c786b19 Reviewed-on: https://gem5-review.googlesource.com/10959 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-15systemc, scons: Add a mechanism to hook in the systemc tests.Gabe Black
This mechanism scans the systemc test directories as described in their original distribution. It tells scons how to build each test executable, and also how to build a json manifest file which lists all the tests and some properties about them. Change-Id: I8ebc748c1aed71f0bb76e04a2040f15abd2837d9 Reviewed-on: https://gem5-review.googlesource.com/10956 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-08-08systemc: Import tests from the Accellera systemc distribution.Gabe Black
Change-Id: Iad76b398949a55d768a34d027a2d8e3739953da6 Reviewed-on: https://gem5-review.googlesource.com/10845 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com>