gem5.git
6 years agotestlib: No catch of custom exceptions in sandbox
Sean Wilson [Fri, 17 Aug 2018 22:48:34 +0000 (17:48 -0500)]
testlib: No catch of custom exceptions in sandbox

Custom exceptions are not always properly pickled which could lead to
the sandbox test executor to crash when it tries to re __init__ pickled
exceptions thrown from the failed test.

Change-Id: I4e2ffe5802dda668b5d61c5a16e0989717121a04
Signed-off-by: Sean Wilson <spwilson27@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/12167
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agoconfig: Move KVM CPU checking to CpuConfig helper module
Andreas Sandberg [Tue, 28 Aug 2018 10:56:55 +0000 (11:56 +0100)]
config: Move KVM CPU checking to CpuConfig helper module

Both se.py and fs.py need to check if a CPU is a KVM CPU. This is
somewhat involved since CPUs can be disabled at compile time. Enable
better code reuse by moving it to the CpuConfig module.

Change-Id: I47b1512ecb62e757399a407a0e41be83b9f83be3
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12418
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agosystemc: Minimally implemented the deprecated sc_simcontext.
Gabe Black [Tue, 19 Jun 2018 00:17:35 +0000 (17:17 -0700)]
systemc: Minimally implemented the deprecated sc_simcontext.

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>

6 years agosystemc: Add a minimal version of the deprecated sc_process_b.
Gabe Black [Tue, 19 Jun 2018 00:04:28 +0000 (17:04 -0700)]
systemc: Add a minimal version of the deprecated sc_process_b.

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>

6 years agosystemc: Add bind() to sc_port_base.
Gabe Black [Mon, 18 Jun 2018 22:14:24 +0000 (15:14 -0700)]
systemc: Add bind() to sc_port_base.

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>

6 years agosystemc: Make the verify.py --list option print a total count.
Gabe Black [Sun, 17 Jun 2018 05:42:22 +0000 (22:42 -0700)]
systemc: Make the verify.py --list option print a total count.

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>

6 years agosystemc: Disable a few more tests that aren't going to work.
Gabe Black [Sun, 17 Jun 2018 05:33:28 +0000 (22:33 -0700)]
systemc: Disable a few more tests that aren't going to work.

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>

6 years agosystemc: Disable the phase_callbacks set of tests.
Gabe Black [Sat, 16 Jun 2018 06:25:58 +0000 (23:25 -0700)]
systemc: Disable the phase_callbacks set of tests.

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>

6 years agosystemc: Add the nonstandard sc_user exception type.
Gabe Black [Sat, 16 Jun 2018 06:19:23 +0000 (23:19 -0700)]
systemc: Add the nonstandard sc_user exception type.

This type is not in the spec but is used in the tests.

Change-Id: I4537a33b0b5dcb3c72a091276d601c244c4a3862
Reviewed-on: https://gem5-review.googlesource.com/11284
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the nonstandard sc_trace_params and sc_trace_params_vec.
Gabe Black [Sat, 16 Jun 2018 06:18:24 +0000 (23:18 -0700)]
systemc: Add the nonstandard sc_trace_params and sc_trace_params_vec.

These two types are supposedly only for internal use in the Accellera
implementation based on a big warning in all caps, but they still
appear in the tests and examples in that version of systemc.

Change-Id: Icfb3ffdf1e78988def5dac145172bf28f93d7d38
Reviewed-on: https://gem5-review.googlesource.com/11283
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Make some functions static in conflict with the spec.
Gabe Black [Sat, 16 Jun 2018 06:02:30 +0000 (23:02 -0700)]
systemc: Make some functions static in conflict with the spec.

The spec is likely wrong in this case since a lot of the other
neighboring functions are static, and the Accellera implementation and
the tests seem to assume they're static.

Change-Id: Ia12a3735497b50f8a2419a52c83ef256416e7bc5
Reviewed-on: https://gem5-review.googlesource.com/11282
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the nonstandard time_stamp function.
Gabe Black [Sat, 16 Jun 2018 06:01:40 +0000 (23:01 -0700)]
systemc: Add the nonstandard time_stamp function.

Change-Id: I608c390b125611e5b62483c7e8567bb5479df553
Reviewed-on: https://gem5-review.googlesource.com/11281
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the nonstandard sc_hierarchical_name_exists function.
Gabe Black [Sat, 16 Jun 2018 05:42:26 +0000 (22:42 -0700)]
systemc: Add the nonstandard sc_hierarchical_name_exists function.

Change-Id: I1340bb6cb0ae29d81b5d73b3dd39ebb11c14802c
Reviewed-on: https://gem5-review.googlesource.com/11280
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the nonstandard timed_out function.
Gabe Black [Sat, 16 Jun 2018 05:05:53 +0000 (22:05 -0700)]
systemc: Add the nonstandard timed_out function.

Change-Id: If14a5f98f03448c712827b7f92d2a36992541518
Reviewed-on: https://gem5-review.googlesource.com/11279
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some deprecated sc_module constructors.
Gabe Black [Sat, 16 Jun 2018 04:44:15 +0000 (21:44 -0700)]
systemc: Add some deprecated sc_module constructors.

Change-Id: Ibe2bfe63536af33fca6040f4aef999ee928d876b
Reviewed-on: https://gem5-review.googlesource.com/11278
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the non-standard sc_time_tuple class.
Gabe Black [Sat, 16 Jun 2018 04:30:16 +0000 (21:30 -0700)]
systemc: Add the non-standard sc_time_tuple class.

Change-Id: Ia3d6a6a4ea3383c82605653faac570ced7bebb70
Reviewed-on: https://gem5-review.googlesource.com/11277
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add non-standard sc_status constants.
Gabe Black [Sat, 16 Jun 2018 04:28:41 +0000 (21:28 -0700)]
systemc: Add non-standard sc_status constants.

Change-Id: I02f52df318473906062035b188348fb875daad08
Reviewed-on: https://gem5-review.googlesource.com/11276
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add deprecated sc_time constructors.
Gabe Black [Sat, 16 Jun 2018 03:48:08 +0000 (20:48 -0700)]
systemc: Add deprecated sc_time constructors.

Change-Id: Iffae751272302ff2996258a1ab31b086e12bbb8d
Reviewed-on: https://gem5-review.googlesource.com/11275
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add an sc_event_finder::find_event method.
Gabe Black [Sat, 16 Jun 2018 03:17:21 +0000 (20:17 -0700)]
systemc: Add an sc_event_finder::find_event method.

The guts of sc_event_finder are supposed to be implementation defined,
but the tests reach in and call this particular method on that class.

Change-Id: I21c18fa68ccce7bc1a13122ee3b452ecb81b713a
Reviewed-on: https://gem5-review.googlesource.com/11274
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some deprecated sc_time factory methods.
Gabe Black [Sat, 16 Jun 2018 03:16:48 +0000 (20:16 -0700)]
systemc: Add some deprecated sc_time factory methods.

Change-Id: I0d9a7040a48b9f0d0079e9daecaf44ea78c186de
Reviewed-on: https://gem5-review.googlesource.com/11273
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some common test include files.
Gabe Black [Sat, 16 Jun 2018 03:02:54 +0000 (20:02 -0700)]
systemc: Add some common test include files.

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>

6 years agosystemc: Add some nonstandard, undocumented sc_report_* functions.
Gabe Black [Sat, 16 Jun 2018 03:02:06 +0000 (20:02 -0700)]
systemc: Add some nonstandard, undocumented sc_report_* functions.

The tests use these functions.

Change-Id: I3cdc10d433d9388742a20fb3a97a1a3efa699e11
Reviewed-on: https://gem5-review.googlesource.com/11271
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agobase: If valgrind is available, tell it about Fiber stacks.
Gabe Black [Wed, 22 Aug 2018 23:49:22 +0000 (16:49 -0700)]
base: If valgrind is available, tell it about Fiber stacks.

Valgrind can get confused when  switching stacks between different
Fibers. If valgrind (and its headers) are available, this change adds
calls to some hooks so valgrind knows where the new stacks are and
doesn't report a bunch of false positives.

Change-Id: I00aefe60372be6de7371dec29427d7182dbee7b6
Reviewed-on: https://gem5-review.googlesource.com/12227
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agocpu: Stream/SubstreamID support in TrafficGen
Giacomo Travaglini [Fri, 20 Jul 2018 10:23:49 +0000 (11:23 +0100)]
cpu: Stream/SubstreamID support in TrafficGen

This patch is adding support for generating memory requests which set
the StreamID/SubstreamID field, so that is possible to emulate devices
attached to an external IOMMU/SMMU with a Traffic generator.

Change-Id: Iea068de581ae7125a9d49314124a08c045c75b49
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12188

6 years agocpu: Turn BaseTrafficGen numSuppressed into a stat
Michiel W. van Tol [Tue, 24 Jul 2018 14:28:34 +0000 (15:28 +0100)]
cpu: Turn BaseTrafficGen numSuppressed into a stat

This is changing numSuppressed from being a warn only variable into
a Stat so that it is visible at the end of simulation.

Change-Id: I934782e796c898bfc0e773cc88c597a68e403272
Reviewed-on: https://gem5-review.googlesource.com/11849
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem: Add StreamID and SubstreamID
Stanislaw Czerniawski [Wed, 16 May 2018 12:30:24 +0000 (13:30 +0100)]
mem: Add StreamID and SubstreamID

This patch adds StreamID and SubstreamID to Request. These fields can
be used by a SMMU/IOMMU model to pick up the correct translation
context for each request and they correspond to an ASID in a device.
For this reason they have been merged together with the request asid
in a union, so that a cpu will set the asid and a device will set
the Stream and Substream ID.

Change-Id: Iac2b5a1ba9c6598ee7635c30845dc68ba6787c34
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12187
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agosystemc: Add deprecated default time unit management functions.
Gabe Black [Sat, 16 Jun 2018 03:00:36 +0000 (20:00 -0700)]
systemc: Add deprecated default time unit management functions.

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>

6 years agosystemc: Add deprecated notify_delayed functions.
Gabe Black [Sat, 16 Jun 2018 02:58:37 +0000 (19:58 -0700)]
systemc: Add deprecated notify_delayed functions.

Change-Id: I8ec68920b35f9207b6856a0b1ddfdf7545b7148a
Reviewed-on: https://gem5-review.googlesource.com/11269
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some nonstandard cthread related sc_module functions.
Gabe Black [Sat, 16 Jun 2018 01:43:14 +0000 (18:43 -0700)]
systemc: Add some nonstandard cthread related sc_module functions.

Change-Id: I73f9868b80f9b75e7bd90df6e894daea60a203a1
Reviewed-on: https://gem5-review.googlesource.com/11268
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the deprecated sc_trace_delta_cycles function.
Gabe Black [Sat, 16 Jun 2018 01:15:48 +0000 (18:15 -0700)]
systemc: Add the deprecated sc_trace_delta_cycles function.

This function enables or disables tracing of delta cycles in a
particular trace file.

Change-Id: I53164a792856d071de1fefc76977cca8eb5fd735
Reviewed-on: https://gem5-review.googlesource.com/11267
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add a nonstandard sc_signal constructor.
Gabe Black [Sat, 16 Jun 2018 01:07:43 +0000 (18:07 -0700)]
systemc: Add a nonstandard sc_signal constructor.

This constructor takes an initial value to set the sc_signal to, and
is used in the tests.

Change-Id: I197218846d9a79f9237238c78b1bbd8a7f55443f
Reviewed-on: https://gem5-review.googlesource.com/11266
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some nonstandard (get|set)_catch_actions functions.
Gabe Black [Sat, 16 Jun 2018 01:07:05 +0000 (18:07 -0700)]
systemc: Add some nonstandard (get|set)_catch_actions functions.

These are used by the tests.

Change-Id: I09bbe81854f0faa524a4c6aa0ef31d80e4a8de24
Reviewed-on: https://gem5-review.googlesource.com/11265
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Exclude another test which exercises sc_string.
Gabe Black [Sat, 16 Jun 2018 00:30:22 +0000 (17:30 -0700)]
systemc: Exclude another test which exercises sc_string.

Change-Id: Ic05fe3d34ef403dd6ad9348478f73c6ed50cc7bc
Reviewed-on: https://gem5-review.googlesource.com/11264
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the nonstandard, undocumented halt function.
Gabe Black [Sat, 16 Jun 2018 00:29:44 +0000 (17:29 -0700)]
systemc: Add the nonstandard, undocumented halt function.

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>

6 years agosystemc: Define the nonstandard sc_event_queue_port typedef.
Gabe Black [Sat, 16 Jun 2018 00:01:57 +0000 (17:01 -0700)]
systemc: Define the nonstandard sc_event_queue_port typedef.

Used in the tests.

Change-Id: Ic4b4a313b2bd02e5cb3ec07c4f7ee79219728881
Reviewed-on: https://gem5-review.googlesource.com/11262
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some nonstandard SC_WAIT* macros.
Gabe Black [Sat, 16 Jun 2018 00:01:14 +0000 (17:01 -0700)]
systemc: Add some nonstandard SC_WAIT* macros.

These are not in the standard, but are defined by Accellera and used in
the tests.

Change-Id: I4cbddac4eb75c58d8ae3eb77d1f291dac3c51cd6
Reviewed-on: https://gem5-review.googlesource.com/11261
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Exclude a test which probably could never compile?
Gabe Black [Fri, 15 Jun 2018 23:44:29 +0000 (16:44 -0700)]
systemc: Exclude a test which probably could never compile?

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>

6 years agosystemc: Add nonstandard sc_trace-s for sc_event and sc_time.
Gabe Black [Fri, 15 Jun 2018 23:43:42 +0000 (16:43 -0700)]
systemc: Add nonstandard sc_trace-s for sc_event and sc_time.

These are not in the standard but are defined by Accellera and are
used in the regression tests.

Change-Id: Idb8358530b1135526c52733e628461a17308e216
Reviewed-on: https://gem5-review.googlesource.com/11259
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add a filter file for the tests which are expected to work.
Gabe Black [Fri, 15 Jun 2018 22:53:32 +0000 (15:53 -0700)]
systemc: Add a filter file for the tests which are expected to work.

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>

6 years agosystemc: Add a filter-file option.
Gabe Black [Fri, 15 Jun 2018 22:52:23 +0000 (15:52 -0700)]
systemc: Add a filter-file option.

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>

6 years agosystemc: Add support for deprecated integer report handler ids.
Gabe Black [Fri, 15 Jun 2018 22:14:54 +0000 (15:14 -0700)]
systemc: Add support for deprecated integer report handler ids.

These are deprecated but still used in the regression tests.

Change-Id: Id59cf950fbe0530a6cdce20a256d450b243f12d3
Reviewed-on: https://gem5-review.googlesource.com/11256
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the nonstandard macro SC_NEW.
Gabe Black [Fri, 15 Jun 2018 21:56:10 +0000 (14:56 -0700)]
systemc: Add the nonstandard macro SC_NEW.

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>

6 years agosystemc: Add the nonstandard triggered function sc_event.
Gabe Black [Thu, 14 Jun 2018 23:39:37 +0000 (16:39 -0700)]
systemc: Add the nonstandard triggered function sc_event.

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>

6 years agosystemc: Add the nonstandard variable sc_allow_process_control_corners.
Gabe Black [Thu, 14 Jun 2018 23:37:08 +0000 (16:37 -0700)]
systemc: Add the nonstandard variable sc_allow_process_control_corners.

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>

6 years agosystemc: Add some "implementation defined" stuff to sc_attr_cltn.
Gabe Black [Thu, 14 Jun 2018 03:09:24 +0000 (20:09 -0700)]
systemc: Add some "implementation defined" stuff to sc_attr_cltn.

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>

6 years agosystemc: Fix a small bug in verify.py.
Gabe Black [Wed, 15 Aug 2018 01:42:43 +0000 (18:42 -0700)]
systemc: Fix a small bug in verify.py.

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>

6 years agodev, arm: Fix incorrect GIC address range sizes
Andreas Sandberg [Wed, 18 Jul 2018 15:53:18 +0000 (16:53 +0100)]
dev, arm: Fix incorrect GIC address range sizes

The GICv2 specifies that 8KiB of the memory map is allocated to the
CPU interface and 4KiB is allocated to the distributor. The current
distributor size is off by 1 and the CPU interface is completely off
by a lot.

Change-Id: I90a9f669a46a37d79c6cc542087cf91f2044f104
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11769

6 years agomisc: Appease GCC 8
Jason Lowe-Power [Fri, 3 Aug 2018 01:07:51 +0000 (18:07 -0700)]
misc: Appease GCC 8

GCC 8 adds a number of new warnings to -Wall which generate errors.

- Fix memset to 0 for structs by adding casts.
- Fix cast with const when the const was ignored.
- Fix catch a polymorphic type by value

We now compile with GCC 8!

Change-Id: Iab70ce11190eee67608fc25c0bedff170152b153
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/11949
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
6 years agoext: Cherry-pick pybind change to support GCC 8
Jason Lowe-Power [Tue, 31 Jul 2018 16:22:44 +0000 (09:22 -0700)]
ext: Cherry-pick pybind change to support GCC 8

GCC 8's -Wcast-function-type didn't like this line in pybind. Rather
than updating pybind to the HEAD, we'll wait for a new release. The last
release was in April and didn't include this change.

See https://github.com/pybind/pybind11/pull/1396.

Change-Id: I199c3023487d5a73a745396df8e7fcd6635a146c
Reported-by: Thawra Kadeed <kadeed@ida.ing.tu-bs.de>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/11909
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
6 years agoutil: add util/maint/show_changes_by_file.py tool
Brandon Potter [Mon, 5 Feb 2018 18:15:17 +0000 (13:15 -0500)]
util: add util/maint/show_changes_by_file.py tool

The script diffs an upstream branch and a feature branch to find
all files which have been changed between the branches. It then
searches for all the corresponding changesets and binds them to
the files in the output.

The tool's output resembles the following:

/path/to/file/
    filename
        git-hash
        git-hash
    filename
        git-hash

/path/to/file/
    filename
        git-hash

Change-Id: Icd67953748f38dad984488c5445313eaa56fa202
Reviewed-on: https://gem5-review.googlesource.com/7861
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

6 years agoscons,ruby: do not generate unnecessary files
Brandon Potter [Thu, 15 Feb 2018 22:31:10 +0000 (17:31 -0500)]
scons,ruby: do not generate unnecessary files

Do not generate garnet tester file or Ruby debug headers without a Ruby
protocol (i.e. PROTOCOL=None). It makes no sense to include these files
into the build when there will be no protocol to utilize them.

Change-Id: I8db4dd532f60008217a10c88a2e089f85df9d104
Reviewed-on: https://gem5-review.googlesource.com/8381
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agotests: add a stack printer test
Brandon Potter [Fri, 19 May 2017 16:58:32 +0000 (11:58 -0500)]
tests: add a stack printer test

Add a test to print out stack contents for SE mode programs.
The test will print out argc, argv, envp, and some auxiliary
vectors.

Change-Id: I489d752ee40fde24c531d8918d0c050f4df936c5
Reviewed-on: https://gem5-review.googlesource.com/3440
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agoruby: remove unused code inside '#if 0 ... #endif'
Brandon Potter [Mon, 19 Feb 2018 19:49:05 +0000 (14:49 -0500)]
ruby: remove unused code inside '#if 0 ... #endif'

The commented code contains bitrot. It is not clear how to fix the code
so remove it.

The code will not compile if the preprocessor defines are removed. The
llocker and uulocker variables that are used as indices into the
persistent_randomize array are undefined. It's not clear what they should
be from the current code.

5ab13e2deb shows when the lines were last modified. The functionality
contained in the comments probably have not been used since that time.
(This is an example of why one should never add commented code that
is enabled by removing defines. The code rots and sits in the source
forever.)

Change-Id: I3e0e7c9afc0b6088130e6f319075809fb6f16e5a
Reviewed-on: https://gem5-review.googlesource.com/8481
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agohsail-x86: fix gpu dynamic instruction error
Brandon Potter [Fri, 17 Aug 2018 00:58:19 +0000 (20:58 -0400)]
hsail-x86: fix gpu dynamic instruction error

The gpu_dyn_inst.hh file was missing a clone method from
inherited classes. (The clone method is the way to implement
the prototype design pattern.) Because the inherited clone
method was declare as pure virtual, the method needed to
be implemented. Otherwise, the compiler complains that the
class is abstract.

Change-Id: I38782d5f7379f32be886401f7c127fe60d2f8811
Reviewed-on: https://gem5-review.googlesource.com/12108
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

6 years agohsail-x86: fix addr_range_map error
Brandon Potter [Fri, 17 Aug 2018 00:55:01 +0000 (20:55 -0400)]
hsail-x86: fix addr_range_map error

683f411dca introduced changes to the addr_range_map's
"find" method. Nikos replaced the relevant code with a new
"contains" method. Propagate the changes to the gpu-compute
code.

Change-Id: I8cfe3b15cbfb476685b0ed5ba423ea5a8f1000d8
Reviewed-on: https://gem5-review.googlesource.com/12107
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

6 years agotests: Add explicit build test
Jason Lowe-Power [Thu, 19 Apr 2018 01:03:28 +0000 (18:03 -0700)]
tests: Add explicit build test

Change-Id: Ia613ab580b880a463c9cf0dd63f61497db31fe75
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/10121

6 years agotests: Add test for the m5-exit instruction.
Sean Wilson [Thu, 3 Aug 2017 16:22:57 +0000 (11:22 -0500)]
tests: Add test for the m5-exit instruction.

Change-Id: I92a589b267ce659b6fbcf710043436b84fcb1c63
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/4423
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
6 years agotests: Add a simple example test
Sean Wilson [Thu, 3 Aug 2017 16:21:57 +0000 (11:21 -0500)]
tests: Add a simple example test

Change-Id: I0753db61d6344b9ed95c0d90a1ab097de7e2af12
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/4422
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
6 years agotests: Add Makefiles for hello
Jason Lowe-Power [Fri, 22 Sep 2017 01:43:30 +0000 (20:43 -0500)]
tests: Add Makefiles for hello

This adds Makefiles for hello for ARM and x86 by leveraging docker and
dockcross. See https://github.com/dockcross/dockcross for more
information.

These Makefiles also allow for automatic uploading to the correct location
for users to download when running the new tests.

Change-Id: I7085000393cd5283502a7af362c85befda749181
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/4883

6 years agotests: Add documentation for new testing code
Jason Lowe-Power [Thu, 21 Sep 2017 21:29:43 +0000 (14:29 -0700)]
tests: Add documentation for new testing code

Change-Id: Id62ad8e452e640073079e76c9ce5898c8888edee
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/4882

6 years agotests,ext: Add a new testing library proposal
Sean Wilson [Thu, 3 Aug 2017 16:28:49 +0000 (11:28 -0500)]
tests,ext: Add a new testing library proposal

The new test library is split into two parts: The framework which resides
in ext/, and the gem5 helping components in /tests/gem5.

Change-Id: Ib4f3ae8d7eb96a7306335a3e739b7e8041aa99b9
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/4421
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agotests: Fix hello.c test program
Jason Lowe-Power [Fri, 22 Sep 2017 00:56:57 +0000 (19:56 -0500)]
tests: Fix hello.c test program

Update the hello test to have a sane return code.

Change-Id: I9576b71ee995d8aa410c4ed19d44cc4e9fad10ee
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/4881
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoconfigs: Always exit with code 0
Jason Lowe-Power [Fri, 22 Sep 2017 00:52:00 +0000 (17:52 -0700)]
configs: Always exit with code 0

Update simulation.py to always exit with code 0 assuming the simulation
exits normally. If the running application has a return code that is non
zero, then print the return code before exiting.

Change-Id: I1983985d50311627574d4364b32ee961ae88e003
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/4880

6 years agosystemc: Partially implement SC_FORK and SC_JOIN.
Gabe Black [Thu, 14 Jun 2018 02:10:38 +0000 (19:10 -0700)]
systemc: Partially implement SC_FORK and SC_JOIN.

These macros need to expand to some minimal amount of wrapping code to
make the regression tests syntactically legal and compile.

Change-Id: I0b5569704b129d9c315526fc3363ef846a1b5c65
Reviewed-on: https://gem5-review.googlesource.com/11184
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some deprecated features to sc_clock.*.
Gabe Black [Thu, 14 Jun 2018 01:52:02 +0000 (18:52 -0700)]
systemc: Add some deprecated features to sc_clock.*.

Add in two deprecated typedefs, and a deprecated constructor. These
are necessary to get the regressions to build.

Change-Id: Id8320a67c680acbca0abaee9898158ffd2678d67
Reviewed-on: https://gem5-review.googlesource.com/11183
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add some non-standard sc_trace variants.
Gabe Black [Thu, 14 Jun 2018 01:46:06 +0000 (18:46 -0700)]
systemc: Add some non-standard sc_trace variants.

These overloads of sc_trace take the unsigned version of some primitive
types. The compiler thought it was ambiguous how to convert an unsigned
integer value into a signed one since there were several different
functions which took signed integer parameters of various sizes.

These versions of sc_trace aren't in the standard, but they are in the
Accellera implementation and do fix building of the regression tests.

Change-Id: I26fd06d90ae6bf5fc5aed24bc2ac826ad69eee31
Reviewed-on: https://gem5-review.googlesource.com/11182
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Remove references to internal constants from the tests.
Gabe Black [Thu, 14 Jun 2018 01:41:27 +0000 (18:41 -0700)]
systemc: Remove references to internal constants from the tests.

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>

6 years agosystemc: Turn some macros into enums to fix regression test building.
Gabe Black [Thu, 14 Jun 2018 01:25:04 +0000 (18:25 -0700)]
systemc: Turn some macros into enums to fix regression test building.

The spec defines these constants to be macros, but the regression test
refers to them using the sc_core namespace. That breaks things because
the macros don't expand to an identifier, they expand to an expression.

This change converts the macros into enums like in the Accellera
implementation to get the regression tests to build.

Change-Id: I3db7dc87a7a597907df658624a7343bc6ca1734e
Reviewed-on: https://gem5-review.googlesource.com/11180
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Remove more Accellera source specific include paths in tests.
Gabe Black [Tue, 12 Jun 2018 02:02:59 +0000 (19:02 -0700)]
systemc: Remove more Accellera source specific include paths in tests.

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>

6 years agosystemc: Include boost/bind.hpp in the systemc header.
Gabe Black [Tue, 12 Jun 2018 01:53:25 +0000 (18:53 -0700)]
systemc: Include boost/bind.hpp in the systemc header.

The systemc spec says that sc_bind, sc_ref and sc_cref macros should
expand to boost::bind, boost::ref, and boost::cref respectively, but
that it's "use is not mandantory". Unfortunately, the regression tests
use those macros without actually including the boost headers for
themselves, and so they won't compile without dragging in these boost
headers as a dependency.

This should be mostly ok to include here since gem5 itself shouldn't
include systemc, just the sub headers that systemc brings in. systemc
code which includes systemc *will* have a dependency on boost, but that
at least contains the new dependency somewhat.

Change-Id: I1877a1b7dae2952f30a9d577d778739abbe7ac3b
Reviewed-on: https://gem5-review.googlesource.com/11178
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Fill out some of the sc_vector.hh classes.
Gabe Black [Tue, 12 Jun 2018 01:47:49 +0000 (18:47 -0700)]
systemc: Fill out some of the sc_vector.hh classes.

The iterator class needs to have some operators, etc., defined so that
tests written against it can compile correctly. The implementations
were heavily influenced by the Accellera implementation.

Also it should be noted that the systemc spec is incorrect where it
defines these classes. When implemented like they are in the
Accellera version, the versions of bind in sc_vector_assembly which
take sc_vector<T>::iterator and iterator parameters are different, and
so they can overload each other. If implemented as described by the
spec however, those types are the same and the code won't compile.

Change-Id: I62852adf7e6c0a2f3df076ba4e93d2501859c32d
Reviewed-on: https://gem5-review.googlesource.com/11177
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Make a test stop including an internal path for sc_vector.
Gabe Black [Fri, 8 Jun 2018 22:27:07 +0000 (15:27 -0700)]
systemc: Make a test stop including an internal path for sc_vector.

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>

6 years agosystemc: Add a script which automates building and running tests.
Gabe Black [Fri, 8 Jun 2018 05:10:58 +0000 (22:10 -0700)]
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>

6 years agosystemc, scons: Link systemc tests against the shared gem5 library.
Gabe Black [Fri, 8 Jun 2018 03:45:33 +0000 (20:45 -0700)]
systemc, scons: Link systemc tests against the shared gem5 library.

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>

6 years agosystemc: Add in the deprecated binding port constructors.
Gabe Black [Fri, 8 Jun 2018 01:23:41 +0000 (18:23 -0700)]
systemc: Add in the deprecated binding port constructors.

These are needed by... you guessed it, the regression tests.

Change-Id: Id30e71944cc7f3faca7dcb197f37938368364fcd
Reviewed-on: https://gem5-review.googlesource.com/10958
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add a non-standard default writer policy on sc_buffer.
Gabe Black [Thu, 7 Jun 2018 21:39:31 +0000 (14:39 -0700)]
systemc: Add a non-standard default writer policy on sc_buffer.

The standard says there's not supposed to be a default writer policy
for the sc_buffer template class, but in the Accellera implementation
there is, and the regression tests depend on it to compile.

Change-Id: I31d17617441224e86c56c54e45364be8f4f45b00
Reviewed-on: https://gem5-review.googlesource.com/10957
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc, scons: Add a mechanism to hook in the systemc tests.
Gabe Black [Thu, 7 Jun 2018 06:06:10 +0000 (23:06 -0700)]
systemc, scons: Add a mechanism to hook in the systemc tests.

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>

6 years agosystemc: Add the deprecated sc_signal_out_if typedef.
Gabe Black [Thu, 7 Jun 2018 05:58:08 +0000 (22:58 -0700)]
systemc: Add the deprecated sc_signal_out_if typedef.

This is needed by the regression tests.

Change-Id: I5666cf9ad445869e74edda857afd59ab7ece4f4c
Reviewed-on: https://gem5-review.googlesource.com/10955
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Add the deprecated sc_module::end_module function.
Gabe Black [Wed, 6 Jun 2018 20:57:06 +0000 (13:57 -0700)]
systemc: Add the deprecated sc_module::end_module function.

The regression tests use this function. In the Accellera implementation
it seems to just do some error checking, so our version doesn't do
anything for now.

Change-Id: Icaad45e934bad69e301bc0234f73e69791940736
Reviewed-on: https://gem5-review.googlesource.com/10854
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Construct and manage a module name stack.
Gabe Black [Fri, 1 Jun 2018 01:42:07 +0000 (18:42 -0700)]
systemc: Construct and manage a module name stack.

Change-Id: I5f7f64d6c3d7e08ec6d2529f3c5d84fbfc2c421b
Reviewed-on: https://gem5-review.googlesource.com/10850
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Make sc_main run in its own fiber.
Gabe Black [Thu, 31 May 2018 21:50:41 +0000 (14:50 -0700)]
systemc: Make sc_main run in its own fiber.

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>

6 years agosystemc: Implement some simple accessor functions in sc_main.cc.
Gabe Black [Wed, 30 May 2018 22:28:29 +0000 (15:28 -0700)]
systemc: Implement some simple accessor functions in sc_main.cc.

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>

6 years agosystemc: Add some missing functions which interact with the scheduler.
Gabe Black [Wed, 30 May 2018 21:48:11 +0000 (14:48 -0700)]
systemc: Add some missing functions which interact with the scheduler.

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>

6 years agobase: Replace cppversion == version with >= version
Bradley [Thu, 26 Jul 2018 10:02:03 +0000 (03:02 -0700)]
base: Replace cppversion == version with >= version

For forward compatibility with later compilers, we should have a greater
than comparison instead of an explicit equality with a particular C++
version.

Change-Id: If848097420b9575f80134986410da3dab32567da
Signed-off-by: Bradley Wang <radwang@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/11871
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agocpu: Add hash functionality for RegId class
Bradley Wang [Fri, 20 Jul 2018 01:28:49 +0000 (18:28 -0700)]
cpu: Add hash functionality for RegId class

Having a hash function defined within the header will allow all
classes using RegId to use the class as a Key in a STL
unordered_map.

Change-Id: I32fd302a087c74e844dcbfce93fef9d0ed98d6bf
Signed-off-by: Bradley Wang <radwang@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/11870
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agocpu: Removed unnecessary file reg_class_impl.hh
Bradley Wang [Fri, 20 Jul 2018 01:23:29 +0000 (18:23 -0700)]
cpu: Removed unnecessary file reg_class_impl.hh

Previously, reg_class_impl.hh was added in order to prevent a cyclic
dependency between it and the_isa.hh (See
http://reviews.gem5.org/r/3754). It was determined that this was not
necessary. The two files had almost entirely the same includes, and the
current test-suite including multiple gcc and clang compilers on both
MacOS and Linux successfully built the library with all functionality
moved into the reg_class.hh file.

Change-Id: I0319e187b9eb280726a003951bb1ce315ffe17f5
Signed-off-by: Bradley Wang <radwang@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/11869
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agoarm: Add support for RCpc load-acquire instructions (ARMv8.3)
Giacomo Gabrielli [Tue, 14 Feb 2017 14:25:41 +0000 (14:25 +0000)]
arm: Add support for RCpc load-acquire instructions (ARMv8.3)

Please note that at the moment these instructions behave like the
existing load-acquire instructions, which follow the more conservative
RCsc consistency model. This means that the new instructions are
_functionally_ correct, but the potential performance improvements
enabled by the RCpc model will not be experienced in timing
simulations.

Change-Id: I04c786ad2941072bf28feba7d2ec6e142c8b74cb
Reviewed-by: Andreas Hansson <andreas.hansson@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11989
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

6 years agosystemc: Import tests from the Accellera systemc distribution.
Gabe Black [Thu, 24 May 2018 08:37:55 +0000 (01:37 -0700)]
systemc: Import tests from the Accellera systemc distribution.

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>

6 years agosystemc: Add the Accellera implementation for the data type classes.
Gabe Black [Thu, 24 May 2018 08:29:36 +0000 (01:29 -0700)]
systemc: Add the Accellera implementation for the data type classes.

These files have been cleaned up style wise, and some macros have been
resolved like they were for the header files.

Change-Id: I447e5311961036847e7da0c5a86c0da25a633010
Reviewed-on: https://gem5-review.googlesource.com/10844
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoSystemc: Port over all of the systemc "datatype" headers.
Gabe Black [Tue, 22 May 2018 09:21:17 +0000 (02:21 -0700)]
Systemc: Port over all of the systemc "datatype" headers.

These are the headers originally written by Accellera with a few
modifications. Most significantly, I went through and mostly (but not
entirely) manually editted them to conform to gem5 style and to be
more self consistent. Second, I resolved some macros which optionally
select features. I removed support for deprecated functions, and
otherwise enabled everything.

The actual implementation behind these headers will also be ported
over, but in a subsequent change.

Change-Id: I203d3f6c8a3af9120b946001d01defbb0643a6b6
Reviewed-on: https://gem5-review.googlesource.com/10843
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Stub out all the standard utilility classes and functions.
Gabe Black [Fri, 18 May 2018 09:12:34 +0000 (02:12 -0700)]
systemc: Stub out all the standard utilility classes and functions.

Change-Id: I9e9724edb6281e0b0a6bae5546b0ede77d295c12
Reviewed-on: https://gem5-review.googlesource.com/10841
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agoarch-arm: Don't fail to initialise PMU if BP is missing
Andreas Sandberg [Wed, 20 Jun 2018 13:23:59 +0000 (14:23 +0100)]
arch-arm: Don't fail to initialise PMU if BP is missing

The branch predictor currently assumes that each CPU has a branch
predictor. This isn't true in some cases (e.g., KVM, Atomic).

Change-Id: I61e80dca940c2dadba1b812449691c9dba1c06d9
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11520
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

6 years agoarch-riscv: Add xret instructions
Alec Roelke [Sun, 10 Jun 2018 22:41:34 +0000 (18:41 -0400)]
arch-riscv: Add xret instructions

This patch adds the uret, sret, and mret instructions for use with
returning from user-, supervisor-, and machine-level code, respectively.
These instructions read the STATUS register to determine the previous
privilege level and modify it to re-enable interrupts at the old
privilege level. These instructions can only be executed at the
corresponding privilege level or higher.

Change-Id: I6125c31cb2fdcc3f83eca86910519e81ffbbbfc9
Reviewed-on: https://gem5-review.googlesource.com/11136
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Robert Scheffel <robert.scheffel1@tu-dresden.de>
6 years agoarch-riscv: Add support for trap value register
Alec Roelke [Mon, 19 Feb 2018 03:28:44 +0000 (22:28 -0500)]
arch-riscv: Add support for trap value register

RISC-V has a set of CSRs that contain information about a trap that was
taken into each privilegel level, such as illegal instruction bytes or
faulting address.  This patch adds that register, modifies existing
faults to make use of it, and adds a new fault for future use with
handling page faults and bad addresses.

Change-Id: I3004bd7b907e7dc75e5f1a8452a1d74796a7a551
Reviewed-on: https://gem5-review.googlesource.com/11135
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>

6 years agoarch-riscv: Add support for fault handling
Alec Roelke [Mon, 19 Feb 2018 03:28:44 +0000 (22:28 -0500)]
arch-riscv: Add support for fault handling

This patch adds support for handling RISC-V faults, including tracking
current and previous execution privilege, correctly switching to
the privilege mode specified by CSRs, and setting/storing the PC.  It
also includes changes introduced by patch #9821, which disables
interrupts during handling of a fault.

Change-Id: Ie9c0f29719620c20783540d3bdb2db44f6114fc9
Reviewed-on: https://gem5-review.googlesource.com/9161
Maintainer: Alec Roelke <ar4jc@virginia.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
6 years agomisc: Update CONTRIBUTING with gerrit changes
Jason Lowe-Power [Thu, 26 Jul 2018 18:59:39 +0000 (11:59 -0700)]
misc: Update CONTRIBUTING with gerrit changes

Change-Id: I39b5a784a056195a5e71fd21b3abb5fc91ab70e7
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/11872

6 years agobase: Fix ucontext compilation error for macOS
Giacomo Travaglini [Tue, 17 Jul 2018 09:42:06 +0000 (10:42 +0100)]
base: Fix ucontext compilation error for macOS

ucontext functions (like getcontext, setcontext etc) have been marked
as deprecated and are hence hidden in latest macOS releases.
This patch uncovers them; warnings wil be produced but compilation
won't fail since -Wno-error=deprecated-declarations flag is currently
used.

Change-Id: Ic10e6f77a38875828b1891eaed2f0626ecffff67
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11729
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agocpu: Warn when (un)serializing a traffic generator
Giacomo Travaglini [Thu, 19 Jul 2018 16:08:49 +0000 (17:08 +0100)]
cpu: Warn when (un)serializing a traffic generator

When checkpointing a system with a traffic generator, a warning is
produced so that the user is reminded serialization does not keep all
the traffic generator internal state.

Change-Id: I3c49c912c9ff3a4208f55b2da0a88fc694147280
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11831
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

6 years agocpu: Allow creation of traffic gen from generic SimObjects
Giacomo Travaglini [Wed, 18 Jul 2018 13:28:21 +0000 (14:28 +0100)]
cpu: Allow creation of traffic gen from generic SimObjects

This patch allows to instantiate a Traffic generator starting from a
generic SimObject, so that linking to a BaseTrafficGen only is no longer
mandatory. This permits SimObjects different than a BaseTrafficGen to
instantiate generators and to manually specify the MasterID they
will be using when generating memory requests.

Change-Id: Ic286cfa49fd9c9707e6f12a4ea19993dd3006b2b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11789
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem-cache: TempCacheBlk allocates and destroys its own data
Robert Kovacsics [Fri, 13 Jul 2018 13:38:00 +0000 (14:38 +0100)]
mem-cache: TempCacheBlk allocates and destroys its own data

This change is because I want to make CacheBlk::data private, so that
I can track all the places which write to it. But to keep that commit
smaller (it is pretty big, because of all the places which might
change it), I have split this into a commit of its own.

Change-Id: I15a2fc1752085ff3681f5c74ec90be3828a559ea
Reviewed-on: https://gem5-review.googlesource.com/11829
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>