gem5.git
6 years agosystemc: Implement + and - for sc_time, and sc_max_time.
Gabe Black [Sat, 21 Jul 2018 00:36:04 +0000 (17:36 -0700)]
systemc: Implement + and - for sc_time, and sc_max_time.

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

6 years agosystemc: Fix a couple memory errors.
Gabe Black [Sat, 21 Jul 2018 00:18:22 +0000 (17:18 -0700)]
systemc: Fix a couple memory errors.

Because events are held in vectors, it doesn't make sense to keep an
iterator into the parent to keep track of where that event is for easy
removal since the iterator becomes invalid when the vector is changed.

The events need to be stored in a vector because systemc defines an
accessor which returns that vector, and building a vector on the fly
would be cumbersome.

Also, make sure the Event parent pointer is set to nullptr if there
isn't a parent.

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

6 years agosystemc: Implement the SC_EXIT_ON_STARVATION exit mode.
Gabe Black [Fri, 20 Jul 2018 23:28:54 +0000 (16:28 -0700)]
systemc: Implement the SC_EXIT_ON_STARVATION exit mode.

This mode implies checking whether there's any activity left either
before starting a delta cycle, or processing delta or timed
notification or timeout.

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

6 years agosystemc: Fix the time resolution when constructing an sc_time.
Gabe Black [Fri, 20 Jul 2018 22:46:49 +0000 (15:46 -0700)]
systemc: Fix the time resolution when constructing an sc_time.

This is (sort of) mandated by the spec. More specifically the spec says
that the systemc API for changing the time resolution can only be
called once, and can only be called before a non-zero sc_time is
constructed.

Because sc_time can be constructed during elaboration and the gem5
version of time resolution is generally not locked down until the
actual simulation starts (after elaboration), the sc_time constructor
needs to call the fixing function itself to ensure that, for instance,
the scaling factors for various real life time units within gem5 are
initialized.

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

6 years agosystemc: Handle event notifications scheduled before sc_start.
Gabe Black [Fri, 20 Jul 2018 00:32:34 +0000 (17:32 -0700)]
systemc: Handle event notifications scheduled before sc_start.

After sc_start is called, gem5 has run far enough to have an event
queue to schedule the notification events on. Before then, it's still
legal to request a timed notification. The scheduler should keep track
of those requests, and once an event queue is available it should
add them to it.

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

6 years agosystemc: Make orphans top level objects instead of panic-ing.
Gabe Black [Fri, 20 Jul 2018 00:12:31 +0000 (17:12 -0700)]
systemc: Make orphans top level objects instead of panic-ing.

When a simulation ends, the sc_objects it contains are destroyed one
by one, not necessarily in hierarchy order. That means that a parent
object can legitimately be destroyed before its children. Instead of
panic-ing when that inevitably happens, this change makes gem5 turn
those children into top level objects.

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

6 years agosystemc: Implement some of the basics of sc_time.
Gabe Black [Thu, 19 Jul 2018 23:53:27 +0000 (16:53 -0700)]
systemc: Implement some of the basics of sc_time.

This is a very incomplete implementation, but is enough to unblock
implementing some other dependent features.

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

6 years agosystemc: Implement the various sc_module stage callbacks.
Gabe Black [Thu, 19 Jul 2018 22:51:24 +0000 (15:51 -0700)]
systemc: Implement the various sc_module stage callbacks.

This change also gets rid of the SystemC namespace which was
deprecated in favor of sc_gem5.

A few utility functions which check whether certain callbacks have
finished were also implemented. status tracking moved from a global
variable in sc_main.cc to a member of the kernel simobject.

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

6 years agobase: Avoid dividing by zero in Time::[gs]etTick.
Gabe Black [Tue, 11 Sep 2018 07:59:56 +0000 (00:59 -0700)]
base: Avoid dividing by zero in Time::[gs]etTick.

Those functions used the value SimClock::Int::ns which, if the time
resolution is larger than 1ns, can/will be zero. That will make
getTick always return zero, and setTick divide by zero. This change
modifies those functions so that the math they do avoids using any
integer Ticks per time unit value except for Frequency. It seems
unlikely that the Ticks will increment at less than 1Hz.

Change-Id: I5cc9db14699c00dcbff48e4593b98522b13b4ccd
Reviewed-on: https://gem5-review.googlesource.com/12573
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agobase: Correct a small typo in sim/core.(hh|cc).
Gabe Black [Tue, 11 Sep 2018 07:57:34 +0000 (00:57 -0700)]
base: Correct a small typo in sim/core.(hh|cc).

The value GHz with a small z was spelled GHZ with a large z, which was
inconsistent with the other frequency-like values in that namespace.

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

6 years agobase: Save and restore the width setting of streams used with cprintf.
Gabe Black [Tue, 11 Sep 2018 07:55:28 +0000 (00:55 -0700)]
base: Save and restore the width setting of streams used with cprintf.

The flags, precision, and fill character were all being saved and
restored, but cprintf might also change the width setting of the
stream, and that wasn't being saved or restored and could leak from
the cprintf statement.

This change adds the code to save and restore that value.

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

6 years agonet: Fix a bug when receiving fragamented packets
Pin-Yen Lin [Tue, 14 Aug 2018 06:23:25 +0000 (14:23 +0800)]
net: Fix a bug when receiving fragamented packets

In the previous implementation, the function EtherTap::recvReal will only
read one packet when received some ``interrupt'' (explicitly, when async_IO
set to true). When someone tries to send a large message to the simulated
device, the message will be divided to several packets due to packet
fragmentation. In this situation recvReal will only read one packet and
left the other packets in the buffer. This significantly increases the
networking latency. So before reading from socket, I change the socket into
non-blocking mode and keep reading from it until there's no packet left.

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

6 years agobase: Fix isSubset() for addr ranges with interleaving
Nikos Nikoleris [Wed, 29 Aug 2018 10:36:22 +0000 (11:36 +0100)]
base: Fix isSubset() for addr ranges with interleaving

This change extends isSubset() which checks whether the range is a
subset of an input range to support address ranges with interleaving
and hashing.

Change-Id: I3dc9ceccb189b7c8665de0355f0555fc2c37d872
Reviewed-on: https://gem5-review.googlesource.com/12319
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

6 years agoconfigs: Use the same address ranges for dir and mem_ctrls
Nikos Nikoleris [Thu, 30 Aug 2018 09:26:31 +0000 (10:26 +0100)]
configs: Use the same address ranges for dir and mem_ctrls

In Ruby, for every directory we create one memory controller for every
range in the memory ranges. Previously the memory controllers and the
directories created their address ranges independently and as a result
a mismatch was possible. In fact, we assinged an interleaved address
range with hasing for the memory controllers while the corresponding
directories would be assigned the same interleaved address range
without hashing.

This change uses the address range of the memory controllers to
populate the list of address ranges for the corresponding directory
and avoid bugs due to code duplication.

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

6 years agodev-arm: Make GenericTimer use standard ArmInterruptPin
Giacomo Travaglini [Thu, 30 Aug 2018 16:48:48 +0000 (17:48 +0100)]
dev-arm: Make GenericTimer use standard ArmInterruptPin

This patch is deleting the custom ArchTimer::Interrupt implementation in
favour of the standard ArmInterruptPin.

Change-Id: I5aa5661e48834398bd7aae15df9578b8db5c8da3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12402
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agodev-arm: Factory SimObject for generating ArmInterruptPin
Giacomo Travaglini [Thu, 30 Aug 2018 15:43:02 +0000 (16:43 +0100)]
dev-arm: Factory SimObject for generating ArmInterruptPin

With this patch the python ArmInterruptPin SimObject matches to the
C++ ArmInterruptPinGen. The latter is in charge of generating
the ArmInterruptPin (which is not a SimObject anymore).
This is meant to ease the generation of ArmInterruptPins: by
not being SimObjects we are not forced to instantiate them
in the configuration script; we can generate them dynamically
instead throughout simulation.

Change-Id: I917d73a26168447221f5993c8ae975ee3771e3bf
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12401
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agoarm: Use the interrupt adaptor in the PMU
Andreas Sandberg [Thu, 23 Mar 2017 18:54:56 +0000 (18:54 +0000)]
arm: Use the interrupt adaptor in the PMU

Rewrite interrupt handling in the PMU model to use the new interrupt
adaptor.

Change-Id: I2cbb99580c46d3e21a1335b897843b7b6e41f10c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12400
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agoarm: Add support for tracking TCs in ISA devices
Andreas Sandberg [Thu, 23 Mar 2017 18:57:41 +0000 (18:57 +0000)]
arm: Add support for tracking TCs in ISA devices

ISA devices typically need to keep track of the thread context they
are associated with. Among other things, this is required for
interrupt delivery. Add a BaseISADevice:setThreadContext() method to
wire such models to the right thread context.

Change-Id: Iad354d176c0c4c4e34c6ab8b5acaee0b69da0406
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12399
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
6 years agodev, arm: Add misc reg tracing to the generic timer
Andreas Sandberg [Thu, 22 Mar 2018 17:58:59 +0000 (17:58 +0000)]
dev, arm: Add misc reg tracing to the generic timer

Change-Id: Ice9376b8eb42423679b0191910e8c980f8017f88
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12398

6 years agodev-arm: Create a getter for ArmInterruptPin ID number
Giacomo Travaglini [Tue, 28 Aug 2018 14:34:34 +0000 (15:34 +0100)]
dev-arm: Create a getter for ArmInterruptPin ID number

A pin owner might want to know which is the irq number
associated with the pin.

Change-Id: I095393d4d25efe13eb2a75a0b0b055d386c2c126
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/12298
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

6 years agomem: Make DRAMCtrl a QoS-aware Memory Controller
Matteo Andreozzi [Fri, 4 Aug 2017 10:11:53 +0000 (11:11 +0100)]
mem: Make DRAMCtrl a QoS-aware Memory Controller

This patch is turning DRAMCtrl a QoS-aware Memory Controller with "no
policy" as a default policy.

Change-Id: I48163da8c8208498cf0398b07094cb840272507f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11973
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
6 years agomem: Implement base QoS Policies.
Giacomo Travaglini [Thu, 10 May 2018 16:07:42 +0000 (17:07 +0100)]
mem: Implement base QoS Policies.

This patch implements a base fixed priority policy and an ideal
turnaround policy for the QoS memory controller.

Change-Id: I38ce16f845fc0ec86d6fc4cc5dc5406f213a465e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11972
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
6 years agomem: Add a simple QoS-aware Memory Controller
Matteo Andreozzi [Thu, 10 May 2018 20:59:08 +0000 (21:59 +0100)]
mem: Add a simple QoS-aware Memory Controller

This patch implements QoSMemorySink: a simple generic QoS-aware memory
controller which inherits from QoS::MemCtrl.

Change-Id: I537a4e2d4cb8f54fa0002eb088b2c6957afb9973
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11971
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Matthew Poremba <porembam@gmail.com>
6 years agomem: Add a QoS-aware Memory Controller type
Matteo Andreozzi [Wed, 10 Jan 2018 13:38:47 +0000 (13:38 +0000)]
mem: Add a QoS-aware Memory Controller type

This is the implementation of QoS algorithms support for gem5 memory
objects. This change-list provides a framework for specifying QoS
algorithm which can be used to prioritise service to specific masters in
the memory controller.
The QoS support implemented here is designed to be extendable so that
new QoS algorithms can be easily plugged into the memory controller as
"QoS Policies".

Change-Id: I0b611f13fce54dd1dd444eb806f8e98afd248bd5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11970
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
6 years agosim: Add System method for MasterID lookup
Giacomo Travaglini [Thu, 10 May 2018 13:37:27 +0000 (14:37 +0100)]
sim: Add System method for MasterID lookup

A new method (lookupMasterId) has been added to the System. A client
should use it when querying the System for the MasterID of a particular
master. It changes from getMasterId since it is
not registering a new MasterID if the master is not found in the
master's list.

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

6 years agomem-cache: Create Skewed Assoc placement policy
Daniel R. Carvalho [Fri, 9 Mar 2018 14:47:33 +0000 (15:47 +0100)]
mem-cache: Create Skewed Assoc placement policy

Create a class that implements the skewed associative placement
policy. It uses the hash function and expansions of the skewing
functions described in "Skewed-Associative caches", by Seznec.

Only 8 skewing functions are implemented, and therefore if more
are needed a hash function will be recursively applied on top
of the output of one of these functions to generate different
values. This is not optimal, and if more functions are needed
it might be more effective to implement them.

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

6 years agonet: Fix a bug when handling IPv6 packets
Pin-Yen Lin [Mon, 13 Aug 2018 06:23:24 +0000 (14:23 +0800)]
net: Fix a bug when handling IPv6 packets

When gem5 runs with the networking support, it will run into an assertion
fail and aborted. This is because it tries to calculate checksum for IPv6
packet and this makes the IpPtr pointer ``ip'' become NULL. For that there
is functions and classes for IPv6 in base/inet.cc, I added IPv6 support for
i8254xGBe.cc. Because IPv6 header does not have identification number,  I
ignored some of the debug messages using ip->id().

Change-Id: Ida5e36aefd2c5c26053f8152a0aac24191e7757c
Reviewed-on: https://gem5-review.googlesource.com/12339
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

6 years agosystemc: Implement pending activity related functions
Gabe Black [Thu, 19 Jul 2018 03:59:56 +0000 (20:59 -0700)]
systemc: Implement pending activity related functions

Track the number of notifications/timeouts that are scheduled at any
given time. This lets us implement sc_pending_activity_at_current_time,
sc_pending_activity_at_future_time, and sc_time_to_pending_activity.

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

6 years agosystemc: Implement sc_pause, sc_stop, and re-sc_start-ing.
Gabe Black [Tue, 17 Jul 2018 07:09:59 +0000 (00:09 -0700)]
systemc: Implement sc_pause, sc_stop, and re-sc_start-ing.

This change further modifies the scheduler to implement the sc_pause
and sc_stop functions, and to ensure that calling sc_start again works.
Also, some small changes were made to how processes and contexts are
hooked up. Now, rather than checking whether a process is running to
determine wether it started on its own or needs to be started manually,
there's a bool which explicitly tracks whether it needs this step. The
problem was that once a thread finished, it wasn't considered running
any more. In that case it had run but finished, but that was
indistinguishable from it needing to run but not having been started.

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

6 years agosystemc: Implement sc_get_current_process_handle's other personality.
Gabe Black [Tue, 17 Jul 2018 03:23:21 +0000 (20:23 -0700)]
systemc: Implement sc_get_current_process_handle's other personality.

When run during simulation, sc_get_current_process_handle returns a
handle for the currently running process or a invalid handle if no
process is running (ie sc_main is running).

When run during elaboration, it returns a handle to the most recently
created process. This second context is what this change handles.

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

6 years agosystemc: Handle suspended processes and handle sensitivity overload.
Gabe Black [Mon, 16 Jul 2018 23:44:07 +0000 (16:44 -0700)]
systemc: Handle suspended processes and handle sensitivity overload.

This change keeps track of whether a process would have become ready
but was suspended so that it can become ready when the process is
resumed.

Also, this makes a process ignore its static sensitivity while a
dynamic sensitivity is in place.

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

6 years agosystemc: Implement next_trigger and wait.
Gabe Black [Mon, 16 Jul 2018 23:25:32 +0000 (16:25 -0700)]
systemc: Implement next_trigger and wait.

These set up dynamic sensitivity.

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

6 years agosystemc: Implement the sensitivity mechanism.
Gabe Black [Mon, 16 Jul 2018 23:14:33 +0000 (16:14 -0700)]
systemc: Implement the sensitivity mechanism.

This change lets processes be sensitive to events, timeouts, etc.

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

6 years agosystemc: Hook up sc_time_stamp sc_delta_count.
Gabe Black [Mon, 16 Jul 2018 22:53:04 +0000 (15:53 -0700)]
systemc: Hook up sc_time_stamp sc_delta_count.

sc_time_stamp reports the current simulation time. sc_delta_count was
hooked up to a dummy value. This change hooks it up to the scheduler so
that it returns the real value.

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

6 years agosystemc: Implement much of events, event lists and event exprs.
Gabe Black [Thu, 12 Jul 2018 03:00:50 +0000 (20:00 -0700)]
systemc: Implement much of events, event lists and event exprs.

Three things aren't yet implemented, waking up processes which are
sensitive to the event, triggering of events, and garbage collecting
list objects which came from expression objects.

The garbage collection aspect is problematic since there doesn't seem
to be a correct way to implement it given the constraints in the spec,
including the way that's implemented by Accellera. It's something that
will need to be dealt with at some point, but in the interest of
forward progress it's being ignored for now.

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

6 years agosystemc: Implement channel updates and rework the scheduler.
Gabe Black [Thu, 5 Jul 2018 05:41:29 +0000 (22:41 -0700)]
systemc: Implement channel updates and rework the scheduler.

This change implements channel updates, and also reworks the scheduler
to delegate more to the gem5 event queue by taking advantage of
event priorities to ensure things happen in the right order. There's
a lengthy comment in scheduler.hh describes how that all works.

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

6 years agosystemc: Partially implement the scheduler.
Gabe Black [Tue, 3 Jul 2018 23:41:30 +0000 (16:41 -0700)]
systemc: Partially implement the scheduler.

This change implements the "evaluate" part of the delta cycles, and
sketches out a function to run delta cycles and the initialization
phase. The kernel object now schedules an event at time zero which
runs the initialization phase.

Also, some small places which were stubbed out pending a way to check
the currently running process have been filled in now that that's
being tracked.

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

6 years agosystemc: Fill out sc_process_handle and create Process classes.
Gabe Black [Fri, 29 Jun 2018 23:46:52 +0000 (16:46 -0700)]
systemc: Fill out sc_process_handle and create Process classes.

The sc_process_handle class now primarily delegates to a Process object
it points at. The Process object does book keeping as far as its
internal state, but doesn't yet have a way to run its target function
or to schedule itself or inject exceptions into its context of
execution.

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

6 years agosystemc: Implement some basic plumbing in sc_module.hh.
Gabe Black [Tue, 26 Jun 2018 03:37:58 +0000 (20:37 -0700)]
systemc: Implement some basic plumbing in sc_module.hh.

Take care of some low hanging fruit as far as wrapper methods and
the sc_bind_proxy class.

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

6 years agosystemc: Implement most of sc_object.
Gabe Black [Fri, 22 Jun 2018 21:19:44 +0000 (14:19 -0700)]
systemc: Implement most of sc_object.

To avoid making it hard to change sc_object's implementation in the
future, this change keeps most of the data members out of sc_object and
keeps them in a seperate Object which is managed independently but
still matches to the sc_objects one to one.

This change also moves away from the SystemC/sc_gem5 namespace pair in
favor of sc_gem5. Having two namespaces with classes, etc, living in
both was complicating things. Having to use a namespace that doesn't
fit in one scheme or the other isn't great, but it's the lesser of two
evils.

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

6 years agosystemc: Get sc_main to work even when dynamically linked.
Gabe Black [Fri, 22 Jun 2018 21:15:28 +0000 (14:15 -0700)]
systemc: Get sc_main to work even when dynamically linked.

Unfortunately multiply defined weak symbols don't work like they're
supposed to when the different versions are across dynamic linking
boundaries.

Fortunately, a weak symbol with no definition at all will still
consistently evaluate as 0, and a singularly defined weak symbol will
still resolve correctly.

Instead of relying on a weak version of sc_main being overridden by a
strong/non-default definition, this change leaves it as undefined and
detects at run time whether the symbol resolves to 0 or to an actual
code location.

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

6 years agosystemc: Implement the sc_attr classes.
Gabe Black [Fri, 22 Jun 2018 21:14:47 +0000 (14:14 -0700)]
systemc: Implement the sc_attr classes.

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

6 years agosystemc: Disable tests which use sensitive_(pos|neg).
Gabe Black [Tue, 19 Jun 2018 02:30:23 +0000 (19:30 -0700)]
systemc: Disable tests which use sensitive_(pos|neg).

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>

6 years agosystemc: Enable some more sc_simcontext related tests.
Gabe Black [Tue, 19 Jun 2018 02:09:56 +0000 (19:09 -0700)]
systemc: Enable some more sc_simcontext related tests.

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>

6 years agosystemc: Add m_cur_val and m_new_val to sc_signal.
Gabe Black [Tue, 19 Jun 2018 02:07:14 +0000 (19:07 -0700)]
systemc: Add m_cur_val and m_new_val to sc_signal.

These members are referred to in one of the tests.

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

6 years agosystemc: Add the "implementation defined" vport function.
Gabe Black [Tue, 19 Jun 2018 01:51:21 +0000 (18:51 -0700)]
systemc: Add the "implementation defined" vport function.

This function is in an "implementation defined" class body in the spec,
and has a comment next to it which says "(for internal use only)" next
to it, but it is still used directly in one of the tests.

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

6 years agosystemc: Add the nonstandard sc_join class and sc_thread_handle type.
Gabe Black [Tue, 19 Jun 2018 00:50:08 +0000 (17:50 -0700)]
systemc: Add the nonstandard sc_join class and sc_thread_handle type.

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

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>