gem5.git
5 years agosystemc: Change the type of a loop counter to avoid a warning.
Gabe Black [Sat, 9 Feb 2019 12:01:48 +0000 (04:01 -0800)]
systemc: Change the type of a loop counter to avoid a warning.

g++ complained about comparing an signed int loop counter with the
return value of a size() function. This change changes it to an
unsigned to make g++ happy/quiet.

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

5 years agoscons: Change an = to a += when accumulating sources from filters.
Gabe Black [Sat, 9 Feb 2019 09:37:48 +0000 (01:37 -0800)]
scons: Change an = to a += when accumulating sources from filters.

The loop accidentally used a = when it should have used a +=, meaning
only the sources from the final filter would be used.

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

5 years agosystemc: scons: Specify RPATH as a list.
Gabe Black [Sat, 9 Feb 2019 09:35:28 +0000 (01:35 -0800)]
systemc: scons: Specify RPATH as a list.

scons will attempt to use insert() on the value of RPATH when adding in
additional values. That will fail if RPATH is a Literal.

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

5 years agocpu: Proposal for changing the indirect branch predictor interface
Jairo Balart [Sun, 6 Jan 2019 19:35:11 +0000 (20:35 +0100)]
cpu: Proposal for changing the indirect branch predictor interface

Now the indirect branch predictor handles its own GHR instead of getting
the one from the direction predictor.

Also, now the commit method of the indirect predictor is called for every
pending branch on an update, as the indirect predictors may want to update
their interal structures/histories with the information of each branch.

Change-Id: I7053fbea42a53960a3bc1ba32912cc99c160511e
Reviewed-on: https://gem5-review.googlesource.com/c/15318
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoriscv: fix AMO, LR and SC instructions
Tuan Ta [Tue, 13 Feb 2018 04:13:34 +0000 (23:13 -0500)]
riscv: fix AMO, LR and SC instructions

(1) Atomic Memory Operation (AMO)

This patch changes how RISC-V AMO instructions are implemented. For each
AMO, instead of issuing a locking load and an unlocking store request to
downstream memory system, this patch issues a single memory request that
contains a corresponding AtomicOpFunctor to the memory system. Once the
memory system receives the request, the atomic operation is executed in
one single step.

This patch also changes how AMO instructions handle acquire and release
flags in AMOs (e.g., amoadd.aq and amoadd.rl). If an AMO is associated
with an acquire flag, a memory fence is inserted after the AMO completes
as a micro-op. If an AMO is associated with a release flag, another
memory fence is inserted before the AMO executes. If both flags are
specified, the AMO is broken down into a sequence of 3 micro-ops:
mem fence -> atomic RMW -> mem fence. This change makes this AMO
implementation comply to the release consistency model.

(2) Load-Reserved (LR) and Store-Conditional (SC)

Addresses locked by LR instructions are tracked in a stack data
structure. LR instruction pushes its target address to the stack, and SC
instruction pops the top address from the stack. As specified by RISC-V
ISA, a SC fails if its target address does not match with the most recent
LR.

Previously, there was a single stack for all hardware thread contexts.
A shared stack between thread contexts can lead to a infinite sequence
of failed SCs if LRs from other threads keep pushing new addresses to
this stack.

This patch gives each context its private stack to address the problem.

This patch also adds extra memory fence micro-ops to lr/sc to guarantee
a correct execution order of memory instructions with respect to release
consistency model.

Change-Id: I1e95900367c89dd866ba872a5203f63359ac51ae
Reviewed-on: https://gem5-review.googlesource.com/c/8189
Reviewed-by: Alec Roelke <ar4jc@virginia.edu>
Maintainer: Alec Roelke <ar4jc@virginia.edu>

5 years agocpu: support atomic memory request type with AtomicOpFunctor
Tuan Ta [Mon, 22 Jan 2018 18:12:50 +0000 (13:12 -0500)]
cpu: support atomic memory request type with AtomicOpFunctor

This patch enables all 4 CPU models (AtomicSimpleCPU, TimingSimpleCPU,
MinorCPU and DerivO3CPU) to issue atomic memory (AMO) requests to memory
system.

Atomic memory instruction is treated as a special store instruction in
all CPU models.

In simple CPUs, an AMO request with an associated AtomicOpFunctor is
simply sent to L1 dcache.

In MinorCPU, an AMO request bypasses store buffer and waits for any
conflicting store request(s) currently in the store buffer to retire
before the AMO request is sent to the cache. AMO requests are not buffered
in the store buffer, so their effects appear immediately in the cache.

In DerivO3CPU, an AMO request is inserted in the store buffer so that it
is delivered to the cache only after all previous stores are issued to
the cache. Data forwarding between between an outstanding AMO in the
store buffer and a subsequent load is not allowed since the AMO request
does not hold valid data until it's executed in the cache.

This implementation assumes that a target ISA implementation must insert
enough memory fences as micro-ops around an atomic instruction to
enforce a correct order of memory instructions with respect to its
memory consistency model. Without extra memory fences, this implementation
can allow AMOs and other memory instructions that do not conflict
(i.e., not target the same address) to reorder.

This implementation also assumes that atomic instructions execute within
a cache line boundary since the cache for now is not able to execute an
operation on two different cache lines in one single step. Therefore,
ISAs like x86 that require multi-cache-line atomic instructions need to
either use a pair of locking load and unlocking store or change the
cache implementation to guarantee the atomicity of an atomic
instruction.

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

5 years agokern,sim: implement FUTEX_WAKE_OP
Moyang Wang [Mon, 2 Apr 2018 20:23:13 +0000 (16:23 -0400)]
kern,sim: implement FUTEX_WAKE_OP

This patch implements FUTEX_WAKE_OP operation in the futex syscall.
Below is its description:

int futex(int *uaddr, int futex_op, int val,
          const struct timespec *timeout,
          int *uaddr2, int val3);

This operation was added to support some user-space use cases where more
than one futex must be handled at the same time.  The most notable
example is the implementation of pthread_cond_signal(3), which requires
operations on two futexes, the one used to implement the mutex and the
one used in the implementation of the wait queue associated with the
condition variable.  FUTEX_WAKE_OP allows such cases to be implemented
without leading to high rates of contention and context switching.

Reference: http://man7.org/linux/man-pages/man2/futex.2.html

Change-Id: I215f3c2a7bdc6374e5dfe06ee721c76933a10f2d
Reviewed-on: https://gem5-review.googlesource.com/c/9630
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agosim, kern: support FUTEX_CMP_REQUEUE
Moyang Wang [Mon, 2 Apr 2018 20:23:02 +0000 (16:23 -0400)]
sim, kern: support FUTEX_CMP_REQUEUE

This patch supports FUTEX_CMP_REQUEUE operation. Below is its
description from Linux man page:

futex syscall: int futex(int *uaddr, int futex_op, int val,
                         const struct timespec *timeout,
                         int *uaddr2, int val3);

This operation first checks whether the location uaddr still contains
the value val3.  If not, the operation fails with the error EAGAIN.
Otherwise, the operation wakes up a maximum of val waiters that are
waiting on the futex at uaddr.  If there are more than val waiters, then
the remaining waiters are removed from the wait queue of the source
futex at uaddr and added to the wait queue of the target futex at
uaddr2.  The val2 argument specifies an upper limit on the number of
waiters that are requeued to the futex at uaddr2.

Reference: http://man7.org/linux/man-pages/man2/futex.2.html

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

5 years agosim: handle the case when there're not enough HW thread contexts
Tuan Ta [Mon, 2 Apr 2018 20:22:50 +0000 (16:22 -0400)]
sim: handle the case when there're not enough HW thread contexts

In SE mode, since there's no OS scheduler, the number of active SW
threads is limited by the number of HW thread contexts. Previously, if
there is no spare HW thread context, the simulator just fails and stops.
Instead, this patch returns EAGAIN error code from a clone syscall if
there's no available HW thread context. Then it's up to the simulated
program to handle the error.

Linux man page reference:
http://man7.org/linux/man-pages/man2/clone.2.html
http://man7.org/linux/man-pages/man2/fork.2.html

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

5 years agoriscv: fixed syscall return value
Tuan Ta [Mon, 2 Apr 2018 20:22:30 +0000 (16:22 -0400)]
riscv: fixed syscall return value

In case of failure, a syscall returns a negative value encoding the
error code. This patch makes the risc-v implementation returns the
encoded value instead of its absolute value upon a failure of a syscall.

Change-Id: I6032b0337fe1cff5b326dbc6bb3b87a415f03300
Reviewed-on: https://gem5-review.googlesource.com/c/9627
Reviewed-by: Alec Roelke <ar4jc@virginia.edu>
Maintainer: Alec Roelke <ar4jc@virginia.edu>

5 years agocpu: fix how branching is handled when a thread is suspended in MinorCPU
Tuan Ta [Mon, 2 Apr 2018 20:22:16 +0000 (16:22 -0400)]
cpu: fix how branching is handled when a thread is suspended in MinorCPU

When a thread is suspended, all instructions after the suspension need
to be discarded since the thread will take a different execution stream
when it wakes up.

To do that, in MinorCPU, whenever a thread gets suspended, we change the
current execution stream by updating the current branch with
BranchData::SuspendThread reason.

Change-Id: I7cdcda22c1cf6e8ac8db8800b7d9ec052433fdf3
Reviewed-on: https://gem5-review.googlesource.com/c/9626
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu: stop scheduling suspended threads in all stages of MinorCPU
Tuan Ta [Mon, 2 Apr 2018 20:22:01 +0000 (16:22 -0400)]
cpu: stop scheduling suspended threads in all stages of MinorCPU

This patch makes suspended threads non-schedulable in Fetch1, Fetch2,
Decode and Execute stages in MinorCPU.

Change-Id: Ie79857e13b7b782d9c58c32310993a132b609cf9
Reviewed-on: https://gem5-review.googlesource.com/c/9625
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoriscv: ignore nanosleep syscall
Tuan Ta [Mon, 2 Apr 2018 20:21:46 +0000 (16:21 -0400)]
riscv: ignore nanosleep syscall

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

5 years agosim,cpu: make exit_group halt all threads in a group
Tuan Ta [Mon, 2 Apr 2018 20:21:37 +0000 (16:21 -0400)]
sim,cpu: make exit_group halt all threads in a group

When a thread calls exit_group, in addition to halting the thread
itself, it needs to halt all other threads in its group (i.e., threads
sharing the same thread group ID). This patch enables threads to do
that.

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

5 years agoarch-riscv: initialize RISC-V's thread pointer register in clone syscall
Tuan Ta [Mon, 2 Apr 2018 20:21:28 +0000 (16:21 -0400)]
arch-riscv: initialize RISC-V's thread pointer register in clone syscall

This patch initializes thread pointer register to Thread Local Storage
(TLS)'s pointer given to a clone system call.

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

5 years agosim,kern: support FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET ops
Tuan Ta [Mon, 2 Apr 2018 20:21:09 +0000 (16:21 -0400)]
sim,kern: support FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET ops

This patch adds support for two operations in futex system call:
FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET. The two operations are used to
selectively wake up a certain thread waiting on a futex variable.

Basically each thread waiting on a futex variable is associated with a
bitset that is checked when another thread tries to wake up all threads
waiting on the futex variable.

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

5 years agocpu: fixed how O3 CPU executes an exit system call
Tuan Ta [Mon, 2 Apr 2018 19:20:02 +0000 (15:20 -0400)]
cpu: fixed how O3 CPU executes an exit system call

When a thread executed an exit syscall in SE mode, the thread context
was removed immediately in the same cycle, which left inflight squash
operations and trap event incomplete. The problem happened when a new
thread was assigned to the CPU later. The new thread started with some
incomplete transactions of the previous thread (e.g., squashing). This
problem could cause incorrect execution flow for the new thread (i.e.,
pc was not reset properly at the exit point), deadlock (i.e., some
stage-to-stage signals were not reset) and incorrect rename map between
logical and physical registers.

This patch adds a new state called 'Halting' to the thread context and
defers removing thread context from a CPU until a trap event initiated
by an exit syscall execution is processed. This patch also makes sure
that the removal of a thread context happens after all inflight
transactions of the to-be-removed thread in the pipeline complete.

Change-Id: If7ef1462fb8864e22b45371ee7ae67e2a5ad38b8
Reviewed-on: https://gem5-review.googlesource.com/c/8184
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoarch-arm: Fix Virtual interrupts in AArch64
Giacomo Travaglini [Tue, 29 Jan 2019 13:22:11 +0000 (13:22 +0000)]
arch-arm: Fix Virtual interrupts in AArch64

Checking if cpsr.mode is equal to MODE_HYP doesn't work for AArch64.
This is because AArch64 is using different modes when in EL2, like EL2T
and EL2H.
This made Virtual Interrupts to be triggered even when executing in EL2
(hypervisor) whereas they should interrupt the scheduled VM only
(Non-Secure EL0 and EL1). This patch is fixing this by using the generic
currEL() helper for getting the exception level, which is working for
both AArch32 and AArch64.

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

5 years agoarch-arm: Fix extra comma in b7ce897f1e9545785bde982f72d04830c19d9a30
Giacomo Travaglini [Fri, 8 Feb 2019 11:20:57 +0000 (11:20 +0000)]
arch-arm: Fix extra comma in b7ce897f1e9545785bde982f72d04830c19d9a30

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

5 years agoarch-arm: Allow ArmPPI usage for PMU
Giacomo Travaglini [Thu, 31 Jan 2019 09:52:07 +0000 (09:52 +0000)]
arch-arm: Allow ArmPPI usage for PMU

Differently from ArmSPIs, ArmPPI interrupts need to be instantiated by
giving a ThreadContext pointer in the ArmPPIGen::get() method. Since the
PMU is registering the ThreadContext only at ISA startup time, ArmPPI
generation in deferred until the PMU has a non NULL pointer.

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

5 years agoarch-arm: Fix initialization of PMU counters
Ruben Ayrapetyan [Tue, 29 Jan 2019 19:19:51 +0000 (19:19 +0000)]
arch-arm: Fix initialization of PMU counters

A version of Linux kernel initializes counters before enabling them.
Without this change, gem5 overwrites the value of counter, which causes
incorrect counter values derived by kernel.

Change-Id: If0c515111103018d5f65f74434d7711a67aeaee4
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/16203
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoconfigs, arch-arm: Using AddrRange for Realview mem_regions
Giacomo Travaglini [Mon, 4 Feb 2019 13:31:23 +0000 (13:31 +0000)]
configs, arch-arm: Using AddrRange for Realview mem_regions

Physical memory ranges are now saved in Realview objects as pairs of
addresses (start address and size). This patch is substituting them with
a single AddrRange object.

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

5 years agoconfigs: Unifiy interpretation of Realview mem_regions
Giacomo Travaglini [Mon, 4 Feb 2019 12:11:03 +0000 (12:11 +0000)]
configs: Unifiy interpretation of Realview mem_regions

In every arm platform which is making use of them, mem_regions are
interpreted as a pair of start address and size. However arm
SimpleSystem, which is using VExpress_GEM5_V1, is interpreting them as
start address and end address.  This patch is fixing this mismatch.

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

5 years agoarch-riscv: Enable support for riscv 32-bit in SE mode.
Austin Harris [Thu, 27 Dec 2018 01:19:00 +0000 (19:19 -0600)]
arch-riscv: Enable support for riscv 32-bit in SE mode.

This patch splits up the riscv SE mode support for 32 and 64-bit.
A future patch will add support for decoding rv32 instructions.

Change-Id: Ia79ae19f753caf94dc7e5830a6630efb94b419d7
Signed-off-by: Austin Harris <austinharris@utexas.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/15355
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>

5 years agoriscv: remove NonSpeculative flag from fence inst
Tuan Ta [Mon, 2 Apr 2018 19:19:51 +0000 (15:19 -0400)]
riscv: remove NonSpeculative flag from fence inst

Fence instruction origially had two flags NonSpeculative and
MemBarrier. In O3 model, MemBarrier instructions are inserted
into the instruction queue by the InstructionQueue::insertBarrier (at
src/cpu/o3/iew_impl.hh:1083). Barrier instructions are implicitly
assumed to be non-speculative.

Adding NonSpeculative flag to fence instruction makes it inserted into
the instruction queue twice (at src/cpu/o3/iew_impl.hh:1083 and :1111).
This can lead to a deadlock if both pointers to the instruction are not
cleared from the queue when the instruction retires.

This patch removes NonSpeculative flag from the fence inst.

Change-Id: I26573d12a0b52f43b73c0e51158286dc98d05ea4
Reviewed-on: https://gem5-review.googlesource.com/c/8183
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <ar4jc@virginia.edu>
Maintainer: Alec Roelke <ar4jc@virginia.edu>

5 years agocpu: fix how a thread starts up in MinorCPU
Tuan Ta [Mon, 2 Apr 2018 19:19:40 +0000 (15:19 -0400)]
cpu: fix how a thread starts up in MinorCPU

When a thread is activated by another thread calling a clone system
call, the child thread's context is initialized in the middle of the
clone system call and before the context is fully initialized.
Therefore, the child thread starts fetching an unitialized PC, which
could lead to a page fault.

This patch adds a pipeline wakeup event that is scheduled later in the
cycle when the thread is activated. This event ensures that the first
fetch only happens after the thread context is fully initialized
(e.g., in case of clone syscall, it is when the parent thread copies
its context over to the child thread).

When a thread first starts or wakes up, input queue to the Fetch2 stage
needs to be drained since the execution flow is likely to change and
previously fetched instructions in the queue may no longer be in the
correct flow. This patch dumps/drains all inputs in the input queue
of a thread context in the Fetch2 stage when the associated thread wakes
up.

Change-Id: Iad970638e435858b7289cd471158cc0afdbbb0e5
Reviewed-on: https://gem5-review.googlesource.com/c/8182
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

5 years agoarch-riscv: Initialize interrupt mask
Tuan Ta [Tue, 5 Feb 2019 15:08:10 +0000 (10:08 -0500)]
arch-riscv: Initialize interrupt mask

This patch initializes RISCV interrupt mask to 0.

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

5 years agoscons: fix unused auto-generated blob variable in clang
Ciro Santilli [Sat, 26 Jan 2019 13:16:17 +0000 (13:16 +0000)]
scons: fix unused auto-generated blob variable in clang

Since f2bda876f73af4ecc38406f3562a3d16fd28a5a9, the build system started
adding a length for generated blobs as in:

const std::size_t variable_len = 123;

There were two types of blob files, ones with a header and the ones
without.

The ones with the header, also include the header in the .cc of the blob,
which contains a declaration:

extern const std::size_t variable_len;

Therefore, the ones without header, don't have that extern declaration,
which makes them static according to the C++ standard.

clang then correctly interprets that as problematic due to
-Wunused-const-variable, while GCC does not notice this.

This patch removes the length declaration from the blob files that don't
have the header. Those files currently don't use the length.

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

5 years agosim: added missed macro definition on MacOS
Andrea Mondelli [Mon, 4 Feb 2019 20:12:40 +0000 (15:12 -0500)]
sim: added missed macro definition on MacOS

A recent patch add the use of the macro:
CMSG_ALIGN
This macro is not very cross-platform, and needs to be
defined according to the platform.

This patch defines the missing macro on MacOS.

Change-Id: I582f69e652dc060b4532358141179ad6d37eafc7
Reviewed-on: https://gem5-review.googlesource.com/c/16102
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

5 years agomisc: added missing override specifier
Andrea Mondelli [Mon, 4 Feb 2019 20:21:40 +0000 (15:21 -0500)]
misc: added missing override specifier

Added missing specifier for various virtual functions.

Change-Id: I4783e92d78789a9ae182fad79aadceafb00b2458
Reviewed-on: https://gem5-review.googlesource.com/c/16103
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu: Made the Loop Predictor a SimObject
Javier Bueno [Mon, 28 Jan 2019 22:59:45 +0000 (23:59 +0100)]
cpu: Made the Loop Predictor a SimObject

The Loop Predictor implementation is now a SimObject so that other branch
predictors can easily use it (including LTAGE, which is now using it).
It has also been updated with the latest
available loop predictor implementation from Andre Seznec:

http://www.irisa.fr/alf/downloads/seznec/TAGE-GSC-IMLI.tar

Change-Id: I60ad079a2c49b00a1f84d5cfd3611631883a4b57
Reviewed-on: https://gem5-review.googlesource.com/c/15775
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agocpu: Made TAGE a SimObject that can be used by other predictors
Jairo Balart [Sat, 5 Jan 2019 09:24:17 +0000 (10:24 +0100)]
cpu: Made TAGE a SimObject that can be used by other predictors

The TAGE implementation is now a SimObject so that other branch predictors
can easily use it. It has also been updated with the latest available TAGE
implementation from Andre Seznec:

http://www.irisa.fr/alf/downloads/seznec/TAGE-GSC-IMLI.tar

Change-Id: I2251b8b2d7f94124f9955f52b917dc3b064f090e
Reviewed-on: https://gem5-review.googlesource.com/c/15317
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoriscv: Get rid of ISA specific register types in Interrupts.
Austin Harris [Mon, 4 Feb 2019 23:48:52 +0000 (17:48 -0600)]
riscv: Get rid of ISA specific register types in Interrupts.

Change-Id: I5542649c6af27a286f276a289b86c40dd7e32abc
Signed-off-by: Austin Harris <austinharris@utexas.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/16122
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agomem-cache: Updated version of the Signature Path Prefetcher
Javier Bueno [Thu, 13 Dec 2018 10:38:15 +0000 (11:38 +0100)]
mem-cache: Updated version of the Signature Path Prefetcher

This implementation is based in the description available in:
  Jinchun Kim, Seth H. Pugsley, Paul V. Gratz, A. L. Narasimha Reddy,
  Chris Wilkerson, and Zeshan Chishti. 2016.
  Path confidence based lookahead prefetching.
  In The 49th Annual IEEE/ACM International Symposium on Microarchitecture
  (MICRO-49). IEEE Press, Piscataway, NJ, USA, Article 60, 12 pages.

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

5 years agodev, arm: Removed contextId variable
Anouk Van Laer [Tue, 22 Jan 2019 18:08:44 +0000 (18:08 +0000)]
dev, arm: Removed contextId variable

The contextId variable is only used by the debug flag and will prevent
a more optimised binary (i.e. fast) from compiling.

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

5 years agocpu, arch: Replace the CCReg type with RegVal.
Gabe Black [Thu, 22 Nov 2018 00:20:57 +0000 (16:20 -0800)]
cpu, arch: Replace the CCReg type with RegVal.

Most architectures weren't using the CCReg type, and in x86 and arm
it was already a uint64_t.

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

5 years agopython: Remove getCode() type workaround
Andreas Sandberg [Mon, 28 Jan 2019 16:12:18 +0000 (16:12 +0000)]
python: Remove getCode() type workaround

Python 2.7 requires a workaround when wrapping exit objects to
explicitly convert the return of getCode() to int to not confuse
sys.exit. This workaround isn't needed and doesn't work on Python 3
since it doesn't have a separate long integer type.

Change-Id: I57bc3fd8f4699676c046ece8a52baa2796959ffd
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15978
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agosim: Prepare C++ side for Python 3
Andreas Sandberg [Fri, 25 Jan 2019 11:13:38 +0000 (11:13 +0000)]
sim: Prepare C++ side for Python 3

Python 3 uses wide strings instead of ordinary strings for many
APIs. Add the necessary conversions to comply with the new API.

Change-Id: I6f45c9c532537d50d54b542f34eb8fd8cb375874
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15977
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agotests: Add a helper to run external scripts
Andreas Sandberg [Mon, 28 Jan 2019 16:50:35 +0000 (16:50 +0000)]
tests: Add a helper to run external scripts

Some tests are really just a wrapper around a test script in
configs/. Add a helper method to wrap these scripts to make sure they
are executed in a consistent environment. This wrapper sets up a
global environment that is identical to that created by main() when it
executes the script. Unlike the old wrappers, it updates the module
search path to make relative imports work correctly in Python 3.

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

5 years agotests: Don't override tick rate in Ruby tests
Andreas Sandberg [Sun, 27 Jan 2019 11:12:15 +0000 (11:12 +0000)]
tests: Don't override tick rate in Ruby tests

Most Ruby tests assume that the highest frequency in the system under
test is 1GHz and limits the global tick rate to this frequency. This
assumption is broken since the default Ruby configuration scripts
clock the CPU at 2Ghz, which results in warnings and sometimes
incorrect behaviour.

Change-Id: I4b204660862ce3b0ea4a13df42caacd4398fef8c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15975
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agopower: Get rid of some ISA specific register types.
Gabe Black [Tue, 20 Nov 2018 03:12:28 +0000 (19:12 -0800)]
power: Get rid of some ISA specific register types.

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

5 years agonull: Get rid of some register type definitions.
Gabe Black [Tue, 20 Nov 2018 03:01:13 +0000 (19:01 -0800)]
null: Get rid of some register type definitions.

These are no longer used.

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

5 years agomips: Stop using architecture specific register types.
Gabe Black [Tue, 20 Nov 2018 02:37:16 +0000 (18:37 -0800)]
mips: Stop using architecture specific register types.

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

5 years agoalpha: Stop using architecture specific register types.
Gabe Black [Tue, 20 Nov 2018 02:28:12 +0000 (18:28 -0800)]
alpha: Stop using architecture specific register types.

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

5 years agox86: Stop using/defining some ISA specific register types.
Gabe Black [Wed, 21 Nov 2018 00:58:19 +0000 (16:58 -0800)]
x86: Stop using/defining some ISA specific register types.

These have been replaced with the generic RegVal type.

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

5 years agoriscv: Get rid of some ISA specific register types.
Gabe Black [Tue, 20 Nov 2018 03:29:52 +0000 (19:29 -0800)]
riscv: Get rid of some ISA specific register types.

Change-Id: Ie812cf1d42536094273ba2ec731c16cca38db100
Reviewed-on: https://gem5-review.googlesource.com/c/14466
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>

5 years agoarch: cpu: Rename *FloatRegBits* to *FloatReg*.
Gabe Black [Tue, 20 Nov 2018 02:14:16 +0000 (18:14 -0800)]
arch: cpu: Rename *FloatRegBits* to *FloatReg*.

Now that there's no plain FloatReg, there's no reason to distinguish
FloatRegBits with a special suffix since it's the only way to read or
write FP registers.

Change-Id: I3a60168c1d4302aed55223ea8e37b421f21efded
Reviewed-on: https://gem5-review.googlesource.com/c/14460
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agoarch,cpu: Add vector predicate registers
Giacomo Gabrielli [Tue, 16 Oct 2018 15:04:08 +0000 (16:04 +0100)]
arch,cpu: Add vector predicate registers

Latest-gen. vector/SIMD extensions, including the Arm Scalable Vector
Extension (SVE), introduce the notion of a predicate register file.
This changeset adds this feature across architectures and CPU models.

Change-Id: Iebcadbad89c0a582ff8b1b70de353305db603946
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/13715
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agoconfigs: Enable DTB autogeneration in starter_fs.py
Giacomo Travaglini [Fri, 25 Jan 2019 15:05:37 +0000 (15:05 +0000)]
configs: Enable DTB autogeneration in starter_fs.py

This patch is removing hardcoded default DTBs in favour of common DTB
autogeneration.

Change-Id: I68fdc2a169bfa8e8657c9ed4e4e127957a08cca1
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15959
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoarch-arm, configs: Create single instance of DTB autogeneration
Giacomo Travaglini [Fri, 25 Jan 2019 14:29:24 +0000 (14:29 +0000)]
arch-arm, configs: Create single instance of DTB autogeneration

This patch is rewriting the DTB autogeneration functions available in
fs_bigLITTLE.py and fs.py as a single method in the GenericArmSystem
so that other configuration scripts can make use of it.

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

5 years agotests: fix arm regression due to kernel not found
Ciro Santilli [Fri, 25 Jan 2019 19:23:48 +0000 (19:23 +0000)]
tests: fix arm regression due to kernel not found

At Ia49298304f658701ea0800bd79e08db404a655c3 we removed the default
kernel and DTB filenames from FSConfig.py.

However, the regression tests rely on that to find those blobs.

This commit restores those default filenames just for the config of the
regression tests.

Change-Id: I9d7d869b0087ee8a3b63088693f753a703ead5d6
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15957
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoconfigs: fs.py remove --generate-dtb and enable it by default
Ciro Santilli [Thu, 24 Jan 2019 14:13:39 +0000 (14:13 +0000)]
configs: fs.py remove --generate-dtb and enable it by default

The option is now enabled if neither --bare-metal nor --dtb-filename are
given.

This is what fs_bigLITTLE.py already did before this patch.

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

5 years agoconfigs, arch-arm: don't search for default DTB and kernel
Ciro Santilli [Mon, 3 Dec 2018 17:03:41 +0000 (17:03 +0000)]
configs, arch-arm: don't search for default DTB and kernel

Before this commit, there were default magic DTB and kernel filenames
for some platforms.

This was inelegant and error prone, as it refered to out-of-tree files,
and set defaults which users almost always want to customize with
explicit command line options.

One result of this is that a wrong exception could be thrown if --kernel
was given but not --machine-type, since the default machine type
VExpress_EMM had a default kernel, and the code would always search for
the default filename even though --kernel was given:

IOError: Can't find file 'vmlinux.aarch32.ll_20131205.0-gem5' on path.

The defaults existed only for older machine types, and not for the
usually recommended VExpress_GEM5_V1, which suggests that this
deprecation should not affect many users.

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

5 years agoarch-arm: Remove floatReg operand type
Giacomo Travaglini [Fri, 11 Jan 2019 13:32:20 +0000 (13:32 +0000)]
arch-arm: Remove floatReg operand type

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

5 years agoarch-arm: Use VecElem instead of FloatReg for FP instruction
Giacomo Travaglini [Mon, 17 Dec 2018 09:27:42 +0000 (09:27 +0000)]
arch-arm: Use VecElem instead of FloatReg for FP instruction

SIMD & FP Operations use FloatRegs in AArch32 mode and VecRegs in
AArch64 mode. The usage of two different register pools breaks
interprocessing between A32 and A64.  This patch is changing definition
of arm operands so that they are backed by VecElems in A32, which are
mapped to the same storage as A64 VecRegs.

Change-Id: I54e2ea0ef1ae61d29aca57ab09acb589d82c1217
Reviewed-on: https://gem5-review.googlesource.com/c/15603
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoarch: Fix VecElem Operand generation in ISA parser
Giacomo Travaglini [Fri, 14 Dec 2018 11:16:15 +0000 (11:16 +0000)]
arch: Fix VecElem Operand generation in ISA parser

Fixes include:

* Change of reg_class: VecElemClass in lieau of non-existing
  VectorElemClass.
* Removal of unused regId in operand constructor
* makeRead and makeWrite are using VecElem (which is a typedef
  of uint32_t) as a source/destination type, regardless of the real
  operand type (which is specified by ctype)

Change-Id: I4588e1120e1fc8fdb68b2b2f05d5e3692c55b2e8
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15602
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agocpu, arch, arch-arm: Wire unused VecElem code in the O3 model
Giacomo Travaglini [Thu, 10 Jan 2019 17:26:00 +0000 (17:26 +0000)]
cpu, arch, arch-arm: Wire unused VecElem code in the O3 model

VecElem code had been introduced in order to simulate change of renaming
for vector registers. Most of the work is happening on the rename_map
switchRenameMode. Change of renaming can happen after a squash in the
pipeline.
This patch is also changing the interface to the ISA part so that
a PCState is used instead of ISA in order to check if rename mode
has changed.

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

5 years agocpu: O3 rename using the flatIndex instead of index
Giacomo Travaglini [Thu, 10 Jan 2019 17:28:05 +0000 (17:28 +0000)]
cpu: O3 rename using the flatIndex instead of index

This patch is replacing the RegId::index with RegId::flatIndex so that
it provides a valid register number when used by a VecElem register.

Change-Id: I5b000abb9457cd325c2a3021e772a75ea33d8a4c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15600
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
5 years agoarch-arm: Inital vector rename mode depending on A32/A64
Giacomo Travaglini [Wed, 9 Jan 2019 20:10:29 +0000 (20:10 +0000)]
arch-arm: Inital vector rename mode depending on A32/A64

Change-Id: I6b99833641b0ab6534471d5ff3ca5d3791285481
Reviewed-on: https://gem5-review.googlesource.com/c/15599
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agocpu: Fix VecElemClass bugs in cpu models
Giacomo Travaglini [Fri, 4 Jan 2019 16:20:49 +0000 (16:20 +0000)]
cpu: Fix VecElemClass bugs in cpu models

This patch is:

* Adding a missing VecElemClass entry
* Fixing assertion in rename map which was checking the number of free
  vector registers rather than free vector element registers
* Fixing assertion in read/setVecElemOperand APIs.
* Using the right register index in SimpleThread
* Using VecElem instead of VecReg on O3 readArchVecElem

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

5 years agocpu: Add VecElem entries in MinorCPU Scoreboard
Giacomo Travaglini [Thu, 10 Jan 2019 11:17:09 +0000 (11:17 +0000)]
cpu: Add VecElem entries in MinorCPU Scoreboard

This patch is:
* Increasing the number of bits in the Scoreboard so that
  it is keeping track of VecElemClass dependencies.
* Fixing VecElemClass entry in the scoreboard table so that it
  correctly uses flatIndex rather than index.

Change-Id: Ie4877e5fe410b1437447adebbe289602a443f7c0
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15597
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
5 years agoarch-arm: Remove unused float operands
Giacomo Travaglini [Mon, 10 Dec 2018 09:05:43 +0000 (09:05 +0000)]
arch-arm: Remove unused float operands

Removing FaP1 and FDest2 since they are not currently used by any ARM
instruction.

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

5 years agoarch: Provide traceback when parsing ISA code
Giacomo Travaglini [Fri, 14 Dec 2018 11:08:38 +0000 (11:08 +0000)]
arch: Provide traceback when parsing ISA code

There is no line information When the ISA code is executed inside the
isa_parser environment and an error is encountered. The build stops and
reports the line of the let block containing the error.
This patch is enhacing the error reporting by printing the traceback of
the faulting ISA code.

Change-Id: I3acd17f0d78b2feb8fe6e48808a094c5b81624e6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15595
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agopython: Always throw TypeError on slave-slave connections
Nicholas Lindsay [Mon, 2 Jul 2018 15:07:31 +0000 (16:07 +0100)]
python: Always throw TypeError on slave-slave connections

params.py checks the validity of memory port-port connections before
they are instantiated in C++. This commit ensures that attempting to
connect two slave ports together will cause a TypeError.

Change-Id: Ia7d0a15df28b96c7bf5e568c4f4917d21a19b824
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15896
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agohsail: Remove the MiscReg type.
Gabe Black [Tue, 20 Nov 2018 03:03:24 +0000 (19:03 -0800)]
hsail: Remove the MiscReg type.

It has been replaced by the ISA agnostic RegVal.

Change-Id: I563ea3852e37b5c1cf51eb0ac9a6f2a827ba89cf
Reviewed-on: https://gem5-review.googlesource.com/c/14464
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agobase: arch: Get rid of the now unused FloatRegVal type.
Gabe Black [Tue, 20 Nov 2018 01:55:37 +0000 (17:55 -0800)]
base: arch: Get rid of the now unused FloatRegVal type.

This type is no longer used since FP registers are accessed as integer
bit patterns.

Change-Id: I1070f9443d6247165fd64c6bc041811c28287e9f
Reviewed-on: https://gem5-review.googlesource.com/c/14459
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agodev-arm: fix --generate-dtb for ARM
Ciro Santilli [Thu, 24 Jan 2019 09:04:34 +0000 (09:04 +0000)]
dev-arm: fix --generate-dtb for ARM

Was failing with:

NameError: global name 'FdtNode' is not defined

The problem was introduced at: 75831ce5b7880b67c1aa2e0871ce16d5c01cadc7

Change-Id: I7e2ce0e5311e7814229945b9f4e7318a8652dc1f
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15875
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agocpu-o3: O3 LSQ Generalisation
Rekai Gonzalez-Alberquilla [Mon, 13 Feb 2017 09:41:44 +0000 (09:41 +0000)]
cpu-o3: O3 LSQ Generalisation

This patch does a large modification of the LSQ in the O3 model. The
main goal of the patch is to remove the 'an operation can be served with
one or two memory requests' assumption that is present in the LSQ
and the instruction with the req, reqLow, reqHigh triplet, and
generalising it to operations that can be addressed with one request,
and operations that require many requests, embodied in the
SingleDataRequest and the SplitDataRequest.

This modification has been done mimicking the minor model to an extent,
shifting the responsibilities of dealing with VtoP translation and
tracking the status and resources from the DynInst to the LSQ via the
LSQRequest. The LSQRequest models the information concerning the
operation, handles the creation of fragments for translation and request
as well as assembling/splitting the data accordingly.

With this modifications, the implementation of vector ISAs, particularly
on the memory side, become more rich, as the new model permits a
dissociation of the ISA characteristics as vector length, from the
microarchitectural characteristics that govern how contiguous loads are
executing, allowing exploration of different LSQ to DL1 bus widths to
understand the tradeoffs in complexity and performance.

Part of the complexities introduced stem from the fact that gem5 keeps a
large amount of metadata regarding, in particular, memory operations,
thus, when an instruction is squashed while some operation as TLB lookup
or cache access is ongoing, when the relevant structure communicates to
the LSQ that the operation is over, it tries to access some pieces of
data that should have died when the instruction is squashed, leading to
asserts, panics, or memory corruption. To ensure the correct behaviour,
the LSQRequest rely on assesing who is their owner, and self-destroying
if they detect their owner is done with the request, and there will be
no subsequent action. For example, in the case of an instruction
squashed whal the TLB is doing a walk to serve the translation, when the
translation is served by the TLB, the LSQRequest detects that the
instruction was squashed, and as the translation is done, no one else
expect to access its information, and therefore, it self-destructs.
Having destroyed the LSQRequest earlier, would lead to wrong behaviour
as the TLB walk may access some fields of it.

Additional authors:
- Gabor Dozsa <gabor.dozsa@arm.com>

Change-Id: I9578a1a3f6b899c390cdd886856a24db68ff7d0c
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/13516
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

5 years agoarch-arm: Implement LoadAcquire/StoreRelease in AArch32
Giacomo Travaglini [Fri, 18 Jan 2019 11:42:59 +0000 (11:42 +0000)]
arch-arm: Implement LoadAcquire/StoreRelease in AArch32

This patch is implementing LoadAcquire/StoreRelease instructions in
AArch32, which were added in ARMv8-A only and where not present in
ARMv7.

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

5 years agoarch-arm: IsStoreConditional flag set depending on flavor
Giacomo Travaglini [Mon, 21 Jan 2019 14:43:11 +0000 (14:43 +0000)]
arch-arm: IsStoreConditional flag set depending on flavor

This patch is aligning A32 with A64 where the IsStoreConditional flag
doesn't have to be specified manually in the instruction implementation,
but will be automatically added to any exclusive store.

Change-Id: Id02ed6fc2beeca6d125017393714a7c6eb3d8a33
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15816
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoarch-arm: Remove SWP and SWPB instructions
Giacomo Travaglini [Fri, 18 Jan 2019 17:14:56 +0000 (17:14 +0000)]
arch-arm: Remove SWP and SWPB instructions

The SWP and SWPB instructions have been removed from AArch32.  It was
previously (ARMv7) possible to enable them with the ID_ISAR0.Swap bits,
which are now hardcoded to 0b0000 (SWP and SWPB not implemented)

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

5 years agosystemc: Fix TLM related includes.
Gabe Black [Wed, 23 Jan 2019 01:48:12 +0000 (17:48 -0800)]
systemc: Fix TLM related includes.

There are a couple things this CL fixes related to the TLM #includes.

1. Removes #includes of <systemc> and <tlm>. These bring in a header
file from boost which shouldn't be necessary but which some of the
tests (and likely some external code) depends on. We avoid including
those in files built into gem5 itself so that gem5 isn't dependent on
boost.

2. All includes in ext should be relative. That way those headers can
be removed from gem5 and still build, allowing them to be moved over
to or referenced from a foreign codebase which isn't part of gem5.

Change-Id: I76e267385b48cb4fe93aea89ec8319c76465a0a4
Reviewed-on: https://gem5-review.googlesource.com/c/15796
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agoarm: Replace MiscReg with RegVal in utility.(hh|cc).
Gabe Black [Wed, 23 Jan 2019 00:31:58 +0000 (16:31 -0800)]
arm: Replace MiscReg with RegVal in utility.(hh|cc).

These uses snuck in after the previous pass which made this switch in
the rest of these files.

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

5 years agomem-ruby: Fix missing TBE allocation and deallocation
Zicong Wang [Sun, 13 Jan 2019 09:46:29 +0000 (17:46 +0800)]
mem-ruby: Fix missing TBE allocation and deallocation

The TBE allocation and deallcation are currently missing during
the directory state transition from I to M in protocol MI_example.

Change-Id: If7569c02faf56ea84c34ee1345f1a33d318cdfff
Signed-off-by: Zicong Wang <wangzicong@nudt.edu.cn>
Reviewed-on: https://gem5-review.googlesource.com/c/15535
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agosparc: Get rid of some register type definitions.
Gabe Black [Fri, 19 Oct 2018 00:50:42 +0000 (17:50 -0700)]
sparc: Get rid of some register type definitions.

These are IntReg, FloatReg, FloatRegBits, and MiscReg. These have been
supplanted by the global types RegVal and FloatRegVal.

Change-Id: I956abfc7b439b083403e1a0d01e0bb35020bde44
Reviewed-on: https://gem5-review.googlesource.com/c/13627
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agoarch: cpu: Stop passing around misc registers by reference.
Gabe Black [Fri, 19 Oct 2018 00:34:08 +0000 (17:34 -0700)]
arch: cpu: Stop passing around misc registers by reference.

These values are all basic integers (specifically uint64_t now), and
so passing them by const & is actually less efficient since there's a
extra level of indirection and an extra value, and the same sized value
(a 64 bit pointer vs. a 64 bit int) is being passed around.

Change-Id: Ie9956b8dc4c225068ab1afaba233ec2b42b76da3
Reviewed-on: https://gem5-review.googlesource.com/c/13626
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agoarm: Get rid of some register type definitions.
Gabe Black [Sat, 13 Oct 2018 08:25:30 +0000 (01:25 -0700)]
arm: Get rid of some register type definitions.

These are IntReg, FloatReg, FloatRegBits, and MiscReg. These have been
supplanted by the global types RegVal and FloatRegVal.

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

5 years agoarm: dev: Replace ArmISA::MiscReg with RegVal in the GIC v3 model.
Gabe Black [Mon, 21 Jan 2019 21:14:55 +0000 (13:14 -0800)]
arm: dev: Replace ArmISA::MiscReg with RegVal in the GIC v3 model.

Other dev code was already switched over. This code was written before
the switch over (or unaware of it), and checked in after.

Change-Id: Ibb9e9e4300d01cc46e4dae668274debc2a4989ba
Reviewed-on: https://gem5-review.googlesource.com/c/15755
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoarch-arm: implement the GDB XML target description for ARM
Ciro Santilli [Fri, 21 Dec 2018 14:25:24 +0000 (14:25 +0000)]
arch-arm: implement the GDB XML target description for ARM

The supported registers are essentially the same as before this patch,
but it is now trivial to make new registers visible in future commits.

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

5 years agoext: import GDB XML target description files for arm
Ciro Santilli [Fri, 21 Dec 2018 14:24:36 +0000 (14:24 +0000)]
ext: import GDB XML target description files for arm

The XML files were copied from the binutils-gdb source tree under
gdb/features at tag gdb-8.2-release Those XML files have a different
copyright header than the rest of binutils-gdb which allows them to be
copied into non-GPL projects.

Change-Id: I49bdeaad91ceb284c73cc0b861906ce09e44ca1d
Reviewed-on: https://gem5-review.googlesource.com/c/15256
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
5 years agoscons: add helpers to access GDB XML description files
Ciro Santilli [Fri, 21 Dec 2018 14:22:30 +0000 (14:22 +0000)]
scons: add helpers to access GDB XML description files

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

5 years agoscons: allow embedding arbitrary blobs into the gem5 executable
Ciro Santilli [Mon, 19 Nov 2018 15:25:43 +0000 (15:25 +0000)]
scons: allow embedding arbitrary blobs into the gem5 executable

The initial motivation for this is to embed the GDB XML target
description files into the executable.

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

5 years agobase: add support for GDB's XML architecture definition
Ciro Santilli [Mon, 19 Nov 2018 15:25:44 +0000 (15:25 +0000)]
base: add support for GDB's XML architecture definition

This is done by implementing the Xfer:features:read packet of the GDB
remote protocol.

Before this commit, gem5 used the defaults of the GDB client.

With this commit, gem5 can inform the client which registers it knows
about. This allows in particular to support new registers which an older
GDB client does not yet know about.

The XML is not implemented in this commit for any arch, and falls back
almost exactly to previous behaviour. The only change is that now gem5
replies to the Supported: request which the GDB clients sends at the
beginning of the transaction with an empty feature list containing only
the mandatory PacketSize= argument.

Since the feature list does not contain qXfer:features:read, the GDB
client knows that the gem5 server does support the XML format and uses
its default registers as before.

Change-Id: I5185f28b00e9b9cc8245f4b4262cc324c3d298c1
Reviewed-on: https://gem5-review.googlesource.com/c/15137
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoarch-arm: Move AArch32 IMPLEMENTATION DEFINED registers
Giacomo Travaglini [Thu, 25 Oct 2018 10:14:47 +0000 (11:14 +0100)]
arch-arm: Move AArch32 IMPLEMENTATION DEFINED registers

Moving AArch32 instruction accessing IMPLEMENTATION DEFINED registers
from pseudo.[cc/hh] to misc.[cc/hh] in order to symmetrically match
with AArch64 implementation.

Change-Id: I27b0d65925d7965589b765269ae54129426e4c88
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15735
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agomem: Add tryTiming suppport to CommMonitor
Sascha Bischoff [Wed, 14 Nov 2018 16:31:53 +0000 (16:31 +0000)]
mem: Add tryTiming suppport to CommMonitor

The CommMonitor did not support tryTiming, which resulted in gem5
panicing if the CommMonitor was used.

With this change, we update the CommMonitor pass through the
tryTiming() calls.

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

5 years agosim-se add readv and modifies writev
Brandon Potter [Wed, 18 Apr 2018 19:02:34 +0000 (15:02 -0400)]
sim-se add readv and modifies writev

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

5 years agosim-se: add ability to get/set sock metadata
Brandon Potter [Wed, 18 Apr 2018 19:00:14 +0000 (15:00 -0400)]
sim-se: add ability to get/set sock metadata

Add getsockopt, getsockname, setsockname, and getpeername
system calls.

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

5 years agosim-se: add syscalls related to polling
Brandon Potter [Wed, 18 Apr 2018 18:57:57 +0000 (14:57 -0400)]
sim-se: add syscalls related to polling

Fix poll so that it will use the syscall retry capability
instead of causing a blocking call.

Add the accept and wait4 system calls.

Add polling to read to remove deadlocks that occur in the
event queue that are caused by blocking system calls.

Modify the write system call to return an error number in
case of error.

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

5 years agosim-se: add calls for network transmissions
Brandon Potter [Wed, 18 Apr 2018 18:55:30 +0000 (14:55 -0400)]
sim-se: add calls for network transmissions

Add recvfrom, sendto, recvmsg, and sendmsg system calls.

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

5 years agosim-se: add socket-based functionality
Brandon Potter [Wed, 18 Apr 2018 18:48:19 +0000 (14:48 -0400)]
sim-se: add socket-based functionality

Add socket, socketpair, bind, list, connect and shutdown
system calls.

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

5 years agobase: Fix unitialized storage
Daniel R. Carvalho [Tue, 15 Jan 2019 10:51:46 +0000 (11:51 +0100)]
base: Fix unitialized storage

The bitunion is not being initialized on constructor to avoid
performance overhead, and that generated a maybe-unitialized
error when a sub-class was being copied before assigned in
serialize's parseParam() in some compilers.

This patch adds zero-initialization to the problematic variable
to appease the compiler.

Change-Id: I90fa6aa356b3e14ec25e3294b17ed10f429a9a38
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/15635
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agotests: Fix tests/main.py so it can be run from anywhere.
Gabe Black [Wed, 16 Jan 2019 22:58:11 +0000 (14:58 -0800)]
tests: Fix tests/main.py so it can be run from anywhere.

tests/main.py was trying to find paths relative to itself using the
string __name__ (which was __main__) when it should have been using the
string __file__ which holds the name of the file being executed.

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

5 years agomem: Allow inserts in the begining of a packet queue
Nikos Nikoleris [Tue, 4 Dec 2018 15:52:17 +0000 (15:52 +0000)]
mem: Allow inserts in the begining of a packet queue

A packet queue keeps track of packets that are scheduled to be sent at
a specified time. Packets are sorted such that the packet with the
earliest scheduled time is at the front of the list (unless there are
other ordering requirements). Previouly, the implemented algorithm
didn't allow packets to be placed at the front of the queue resulting
in uneccessary delays. This change fixes the implementation of
schedSendTiming.

Change-Id: Ic74abec7c3f4c12dbf67b5ab26a8d4232e18e19e
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15556
Reviewed-by: Bradley Wang <radwang@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem: Determine if a packet queue forces ordering at construction
Nikos Nikoleris [Tue, 27 Nov 2018 16:55:50 +0000 (16:55 +0000)]
mem: Determine if a packet queue forces ordering at construction

A packet queue is typically used to hold on to packets that are
schedules to be sent in the future or when they need to queue behind
younger packets that have been sent out yet. Due to memory order
requirements, some MemObjects need to maintain the order for packet
(mostly responses) that reference the same cache block.

Prior to this patch the ordering requirements where determined when
the packet was scheduled to be sent. This patch moves the parameter to
the constructor.

Change-Id: Ieb4d94e86bc7514f5036b313ec23ea47dd653164
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15555
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu-o3: Make the smtCommitPolicy a Param.ScopedEnum
Nikos Nikoleris [Thu, 3 Jan 2019 19:01:04 +0000 (19:01 +0000)]
cpu-o3: Make the smtCommitPolicy a Param.ScopedEnum

The smtCommitPolicy is a parameter in the o3 cpu that can have 3
different values. Previously this setting was done through a string
and a parser function would turn it into a c++ enum value. This
changeset turns the string into a python Param.ScopedEnum.

Change-Id: I3625f2c08a1ae0c3b0dce7a641c6ae1ce3fd79a5
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15400
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu-o3: Make the smtROBPolicy a Param.ScopedEnum
Nikos Nikoleris [Thu, 3 Jan 2019 18:48:51 +0000 (18:48 +0000)]
cpu-o3: Make the smtROBPolicy a Param.ScopedEnum

The smtROBPolicy is a parameter in the o3 cpu that can have 3
different values. Previously this setting was done through a string
and a parser function would turn it into a c++ enum value. This
changeset turns the string into a python Param.ScopedEnum.

Change-Id: Ie104d055dbbc6e44997ae0c1470de714239be5a3
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15399
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu-o3: Make the smtIQPolicy a Param.ScopedEnum
Nikos Nikoleris [Thu, 3 Jan 2019 17:54:09 +0000 (17:54 +0000)]
cpu-o3: Make the smtIQPolicy a Param.ScopedEnum

The smtIQPolicy is a parameter in the o3 cpu that can have 3
different values. Previously this setting was done through a string
and a parser function would turn it into a c++ enum value. This
changeset turns the string into a python Param.ScopedEnum.

Change-Id: Ieecf0a19427dd250b0d5ae3d531ab46a37326ae5
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15398
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu-o3: Make the smtLSQPolicy a Param.ScopedEnum
Nikos Nikoleris [Mon, 24 Dec 2018 09:04:16 +0000 (09:04 +0000)]
cpu-o3: Make the smtLSQPolicy a Param.ScopedEnum

The smtLSQPolicy is a parameter in the o3 cpu that can have 3
different values. Previously this setting was done through a string
and a parser function would turn it into a c++ enum value. This
changeset turns the string into a python Param.ScopedEnum.

Change-Id: I82041b88bd914c5dc660058d9e3998e3114e7c35
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15397
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu-o3: Make the smtFetchPolicy a Param.ScopedEnum
Nikos Nikoleris [Thu, 3 Jan 2019 17:45:56 +0000 (17:45 +0000)]
cpu-o3: Make the smtFetchPolicy a Param.ScopedEnum

The smtFetchPolicy is a parameter in the o3 cpu that can have 5
different values. Previously this setting was done through a string
and a parser function would turn it into a c++ enum value. This
changeset turns the string into a python Param.ScopedEnum.

Change-Id: Iafb4b4b27587541185ea912e5ed581bce09695f5
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15396
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

5 years agopython: Add support for scoped enums
Nikos Nikoleris [Mon, 24 Dec 2018 08:59:53 +0000 (08:59 +0000)]
python: Add support for scoped enums

At the moment gem5 has support for enum params that either generate a
unscoped within the Enums namespace or a struct encapsulated enum. The
Enums namespace is getting quite big and some params have the same
names which results in collisions. This change adds support for the
scoped enums.

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