History log of /gem5/src/systemc/tests/config.py
Revision Date Author Comments
# 13726:88c80964fd93 20-Feb-2019 Gabe Black <gabeblack@google.com>

systemc: Get rid of --working-dir in the test's config.py.

This option is no longer used and isn't needed.

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


# 13725:2561f9828b95 20-Feb-2019 Gabe Black <gabeblack@google.com>

systemc: Start using the m5.systemc module in the test config.py.

Start using sc_main and sc_main_result from the systemc module, and
stop using the versions of those functions which are attached to the
SystemC_Kernel SimObject.

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


# 13520:5b2b4cab1fa1 12-Dec-2018 Gabe Black <gabeblack@google.com>

systemc: Add a dummy argv[0] when running the tests.

One TLM test will complain if argc isn't 1 or 2, assuming that that
must mean that argc > 2. If it's 0 then the test will also complain and
fail. We therefore need to pass it at least a dummy value in argv/argc.

Change-Id: I5c64856f46d1459d7238e88ad8ba06933c7c38b8
Reviewed-on: https://gem5-review.googlesource.com/c/15065
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>


# 13311:45408a89d50e 06-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Stop passing arguments to sc_main.

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>


# 13301:0ef9dd4e1154 05-Oct-2018 Gabe Black <gabeblack@google.com>

systemc: Use the "catch action" and the handler func outside sc_main.

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>


# 13182:9e030f636a8c 07-Sep-2018 Gabe Black <gabeblack@google.com>

systemc: Fortify how exceptions are caught and passed around.

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>


# 13099:4cb81fed7ee3 27-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: Add a --working-dir option to the test config.py.

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>


# 13082:bbdf00db71ba 22-Aug-2018 Gabe Black <gabeblack@google.com>

systemc: Make the test config retrieve sc_main results.

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>


# 12870:9b917f0e3864 08-Jun-2018 Gabe Black <gabeblack@google.com>

systemc: Add a script which automates building and running tests.

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>