summaryrefslogtreecommitdiff
path: root/src/systemc/tests/config.py
AgeCommit message (Collapse)Author
2018-10-16systemc: Stop passing arguments to sc_main.Gabe Black
These arguments were originally just to make sure arguments could be successfully passed to sc_main, but serve no intrinsic purpose. There are some tests which can accept command line arguments to customize how they run, and having nonsense arguments confuses them and makes them behave incorrectly. Change-Id: Ib328edb12e01a97dca778bbf45b10e91dd8c07a6 Reviewed-on: https://gem5-review.googlesource.com/c/13317 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-16systemc: Use the "catch action" and the handler func outside sc_main.Gabe Black
If an exception escapes sc_main, Accellera catches it and feeds it into the report handler, telling it to run the catch actions. This seems like it sets up lots of dangerous scenarios, and also makes a vital error detecting path more complex and error prone. On the other hand, it makes one of the tests pass. Change-Id: I7f9d07e01e63c7abeee903febe2e434041ec49a4 Reviewed-on: https://gem5-review.googlesource.com/c/13307 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Fortify how exceptions are caught and passed around.Gabe Black
This change tightens up exception catching and makes gem5's systemc code react to exceptions more in line with the Accellera implementation. This prevents exceptions from being caught by the pybind11 integration which makes it very difficult to see where an exception came from, and makes the output differ by including a (mostly useless) backtrace. Change-Id: I7130d53a98fadd137073d1718f780f32f57c658c Reviewed-on: https://gem5-review.googlesource.com/c/12601 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-26systemc: Add a --working-dir option to the test config.py.Gabe Black
The tests expect to be run from a certain directory. Generally that doesn't matter, but in at least one case the test opens a file with a relative path, and that doesn't work unless CWD is what it expects. Change-Id: I34c0ed975e77daed50ace4f7eebd034bf04c5595 Reviewed-on: https://gem5-review.googlesource.com/12271 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-25systemc: Make the test config retrieve sc_main results.Gabe Black
Accellera's implementation prints any sc_report which is thrown and escapes sc_main, so we need to do the same to make some tests pass. Arguably gem5 should fail if sc_main reports an error, but verify.py would interpret that as the test failing too, and some tests purposefully generate errors. This change also stops using the logging module. It wasn't really providing any benefit, and added extra decoration to log messages which confused verify.py. Change-Id: I6850d0ada5e477b67527d99d421478586cda93b3 Reviewed-on: https://gem5-review.googlesource.com/12254 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>