gem5.git
5 years agocpu: Add a memory access predicate
Giacomo Gabrielli [Tue, 23 Oct 2018 12:51:52 +0000 (13:51 +0100)]
cpu: Add a memory access predicate

This changeset introduces a new predicate to guard memory accesses.
The most immediate use for this is to allow proper handling of
predicated-false vector contiguous loads and predicated-false
micro-ops of vector gather loads (added in separate changesets).

Change-Id: Ice6894fe150faec2f2f7ab796a00c99ac843810a
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17991
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bradley Wang <radwang@ucdavis.edu>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agoconfig, sim-se: bugfix for 54c77aa0
Brandon Potter [Thu, 9 May 2019 20:09:01 +0000 (16:09 -0400)]
config, sim-se: bugfix for 54c77aa0

The NULL ISA does not have some members for the options
class which are referenced by the FileSystemConfig
code.

Create default values for the members so that the
simulation does not fail during the configuration phase.

Change-Id: Ie65bf0e5550c964eae42d1df4c36c2c5bc4ea703
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18748
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfigs: Fix FileSystemConfig import
Daniel R. Carvalho [Wed, 8 May 2019 17:58:41 +0000 (19:58 +0200)]
configs: Fix FileSystemConfig import

Add source to FileSystemConfig import

Change-Id: I2cd70a332244cbdc58b1b7c06d589b4339f6e19a
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18709
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agotests: Fix import scope of test
Daniel R. Carvalho [Wed, 8 May 2019 17:17:26 +0000 (19:17 +0200)]
tests: Fix import scope of test

Add missing scope delimiters to Alpha tester

Change-Id: Ib6796864c0dc8fc3108d9d2a7c2f770d2122889a
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18708
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-ruby: Fix MOESI_CMP_directory blocked line handling
Tiago Muck [Thu, 24 Jan 2019 21:03:21 +0000 (15:03 -0600)]
mem-ruby: Fix MOESI_CMP_directory blocked line handling

Using recycle in the L2 controllers to put messages back into the buffer
may lead to starvation when there are many L1 requests for the same line.
This can easily trigger the deadlock detection mechanism in configurations
with many cores (16+). Replacing recycle by stall_and_wait for L1
requests avoids this issue. wakeUpBuffers calls were added to all
transitions from transient to stable states.

Change-Id: I28b8aeacc48919ccf38e69653cd9205a4153514b
Signed-off-by: Tiago Muck <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17568
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Remove writebacks packet list
Daniel R. Carvalho [Thu, 18 Apr 2019 13:53:21 +0000 (15:53 +0200)]
mem-cache: Remove writebacks packet list

Previously all atomic writebacks concerned a single block,
therefore, when a block was evicted, no other block would be
pending eviction. With sector tags (and compression),
however, a single replacement can generate many evictions.

This can cause problems, since a writeback that evicts a block
may evict blocks in the lower cache. If one of these conflict
with one of the blocks pending eviction in the higher level, the
snoop must inform it to the lower level. Since atomic mode does
not have a writebuffer, this kind of conflict wouldn't be noticed.

Therefore, instead of evicting multiple blocks at once, we
do it one by one.

Change-Id: I2fc2f9eb0f26248ddf91adbe987d158f5a2e592b
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18209
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Handle data expansion
Daniel R. Carvalho [Wed, 8 Aug 2018 15:27:22 +0000 (17:27 +0200)]
mem-cache: Handle data expansion

When a block in compressed form is overwriten, it may change
its size. If the new compressed size is bigger, and the total
size becomes bigger than the block size, one or more blocks
will have to be evicted. This is called data expansion, or
fat writes.

This change assumes that a first level cache cannot have a
compressor, since otherwise data expansion should have been
handled for atomic operations and writes. As such, data
expansions should only be seen on writebacks. As writebacks
are forwarded to the next level when failed, there should
be no data expansions when servicing misses either.

This patch adds the functionality to handle data expansions
by evicting the co-allocated blocks to make room for an
expanded block.

Change-Id: I0bd77bf6446bfae336889940b2f75d6f0c87e533
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12087
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Add co-allocation function to compressed tags
Daniel R. Carvalho [Tue, 19 Jun 2018 15:31:26 +0000 (17:31 +0200)]
mem-cache: Add co-allocation function to compressed tags

Implement a co-allocation function in compressed tags, so
that compressed blocks can be co-allocated in a superblock.
Co-allocation is possible when compression ratio (CR) blocks
that share a superblock tag can be compressed to up to (100/CR)%
of their size.

Change-Id: I937cc1fcbb488e70309cb5478c12db65f1b4b23f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11411
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Add compression and decompression calls
Daniel R. Carvalho [Tue, 19 Jun 2018 15:08:35 +0000 (17:08 +0200)]
mem-cache: Add compression and decompression calls

Add a compressor to the base cache class and compress within
block allocation and decompress on writebacks.

This change does not implement data expansion (fat writes) yet,
nor it adds the compression latency to the block write time.

Change-Id: Ie36db65f7487c9b05ec4aedebc2c7651b4cb4821
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11410
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Create BDI Compressor
Daniel R. Carvalho [Wed, 13 Jun 2018 14:39:38 +0000 (16:39 +0200)]
mem-cache: Create BDI Compressor

Implement Base-Delta-Immediate compression, as described in
'Base-Delta-Immediate Compression: Practical Data Compression
for On-Chip Caches'

Change-Id: I7980c340ab53a086b748f4b2108de4adc775fac8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11412
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Add compression stats
Daniel R. Carvalho [Tue, 29 May 2018 15:30:29 +0000 (17:30 +0200)]
mem-cache: Add compression stats

Add compression statistics to the compressors. It tracks
the number of blocks that can fit into a certain power
of two size, and the number of decompressions.

For example, if a block is compressed to 100 bits, it will
belong to the 128-bits compression size. Although it could
also fit bigger sizes, they are not taken into account for
the stats (i.e., the 100-bit compression will fit only the
128-bits size, not 256 or higher).

We save stats for compressions that fail (i.e., compressed
size is bigger than original cache line size).

Change-Id: Idab71a40a660e33259908ccd880e42a880b5ee06
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11103
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Create cache compressor
Daniel R. Carvalho [Wed, 13 Jun 2018 12:36:38 +0000 (14:36 +0200)]
mem-cache: Create cache compressor

Create basic template for cache compressors. A basic compressor
must implement a compression and a decompression method.

Change-Id: I83dc4d2b8d2bc5ed9f760c938edfa4ebdd6b8583
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11100
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem-cache: Add block size to findVictim
Daniel R. Carvalho [Fri, 15 Jun 2018 14:10:25 +0000 (16:10 +0200)]
mem-cache: Add block size to findVictim

Add block size to findVictim. For standard caches it
will not be used. Compressed caches, however, need to
know the size of the compressed block to decide whether
a block is co-allocatable or not.

Change-Id: Id07f79763687b29f75d707c080fa9bd978a408aa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11198
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Mohammad Seyedzadeh <sm.seyedzade@gmail.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem-cache: Add compression data to CompressionBlk
Daniel R. Carvalho [Fri, 30 Mar 2018 13:09:51 +0000 (15:09 +0200)]
mem-cache: Add compression data to CompressionBlk

Add a compression bit, decompression latency and compressed
block size and their respective getters and setters.

Change-Id: Ia9d8656552d60e8d4e85fe5379dd75fc5adb0abe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11102
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem-cache: Create CacheComp debug flag
Daniel R. Carvalho [Tue, 29 May 2018 15:42:34 +0000 (17:42 +0200)]
mem-cache: Create CacheComp debug flag

Create a debug flag for cache compression.

Change-Id: Id4b8e86d658d3aa550906ee0f8da3b54f4cdab7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/11104
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-cache: Stub compression framework
Daniel R. Carvalho [Tue, 29 May 2018 08:11:35 +0000 (10:11 +0200)]
mem-cache: Stub compression framework

Create a stub of a compression framework where we can have
multiple data blocks per tag entry. Only consecutive blocks
can share a tag as of now.

For each tag entry there can be multiple data blocks. We have
the same number of tags a conventional cache would have, but
we instantiate the maximum number of data blocks (according to
the compression ratio) per tag, to virtually implement
compression without increasing the complexity of the simulator.

Change-Id: I549940c7afb2f744ab293ff8bb283967e7551a11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/10763
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agox86: Mark translation as delayed in case of a hw page table walk
Gabor Dozsa [Tue, 30 Apr 2019 09:20:40 +0000 (10:20 +0100)]
x86: Mark translation as delayed in case of a hw page table walk

This information is used by the LSQ in the O3 cpu (since commit
"51becd2... cpu-o3: O3 LSQ Generalisation")

Change-Id: I35fe7e2f8428641d863af0e79e28b0b259fb0b00
Signed-off-by: Gabor Dozsa <gabor.dozsa@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18508
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: correct statfs inclusion on !linux host
Andrea Mondelli [Sat, 4 May 2019 13:43:24 +0000 (09:43 -0400)]
sim-se: correct statfs inclusion on !linux host

- Added missing header
- Fixed typo on __linux__ macro conditional
- s/ifdef/if defined/g for consistency

Change-Id: I83b69856e5ec8b23b707642c0e14216cf62db31e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18668
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-riscv: Implement MHARTID CSR
Alec Roelke [Sun, 3 Mar 2019 20:13:51 +0000 (15:13 -0500)]
arch-riscv: Implement MHARTID CSR

This patch implements the MHARTID CSR by intercepting attempts to access
it, similar to the way accesses to the performance counters are
intercepted, to return the thread's context ID.

Change-Id: Ie14a31036fbe0e49fb3347ac0c3c508d9427a10d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/16988
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: fix a few bugs/warns from GCC 6
Joe Gross [Wed, 18 Apr 2018 21:59:50 +0000 (17:59 -0400)]
sim-se: fix a few bugs/warns from GCC 6

Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12126
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

5 years agosim-se: add eventfd system call
Brandon Potter [Wed, 18 Apr 2018 21:39:26 +0000 (17:39 -0400)]
sim-se: add eventfd system call

Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12125
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>

5 years agomem-cache: Mark block as dirty after a SWPrefetchEXResp
Nikos Nikoleris [Thu, 7 Mar 2019 11:48:01 +0000 (11:48 +0000)]
mem-cache: Mark block as dirty after a SWPrefetchEXResp

This is a workaround for a bug introduced from the change:
59e3585a8 arch-arm: We add PRFM PST instruction for arm
which can cause deadlocks in the memory system.

The design of the classic memory system in gem5 makes the folloing two
assumptions:
* A cache that fetches a block with an intention to modify it, becomes
  the point of ordering and therefore commits to respond to any snoop
  requests [1].
* A cache that fetches an exclusive copy of the block, does so with
  the intention to modify it [2]. Immediately after it receives the
  block, it will write to it and mark it as dirty. As the point of
  ordering, it responds to any outstanding snoops.

The current implementation of prefetch exclusive request breaks the
second assumption. A cache can fetch an exclusive block without an
immediate intention to modify it. If the block is not modified, it
will not be marked as dirty. However, the cache has committed to
respond to outstanding snoops, and if the block is clean it
won't. This can result in deadlocks where a snoop gets stuck waiting
for responses.

One solution (implemented by this patch) is to unconditionally mark
the block dirty when filling due to a prefetch exclusive request.
This makes the PrefetchExReq behave like a WriteReq. However, as it
may mark as dirty a clean block, it creates the requirement for an
uncessary WritebackDirty in the future. In practice, this shouldn't be
a big problem unless the application is unnecessarily using prefetch
exclusive instructions.

Other solutions, would require deeper changes to the design of the
memory system to handle this properly.

[1]: When a cache commits to respond, it "informs" the xbar/PoC (point
of coherence) and the other caches of its intention to respond. As a
result the request will not be send to the main memory.
[2]: In fact the assumption is that in the needsWritable MSHR there is
at least one WriteReq before any snoops from other caches.

Change-Id: I378d3c0dadf25fc52e430b67102347b44d2f18ea
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17729
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-riscv,isa: Fix for compressed jump (c_j) imm
Avishai Tvila [Thu, 4 Apr 2019 20:20:24 +0000 (13:20 -0700)]
arch-riscv,isa: Fix for compressed jump (c_j) imm

c_j(al) has a special format, called CJ.
The jump offset format is instbits[12:2] --> offset[11|4|9:8|10|6|7|3:1|5]
Currently in decoder.isa, c_j format is JOp, the imm and branchTarget are incorrect
In the execute section (decoder.isa:228), the imm fields is ignored and the offset is calculated correctlly.
As a result, we get decoder flush for each c_j instance
I've added CJOp format in compressed.isa, and use it in execute section.
In addition, c_j is mappped to jal zero, cj_imm, and actually is neither indirect control nor a function call
I fixed the flags accordently.
I'll fix all IsRet, IsCall and IsIndirectControl flags for rest of (c_)jal(r) in my next commit.
I ran coremark -O0 before my fix and I got 37.7% branch miss-rate, after the fix the branch miss-rate is <13%

Change-Id: I608d5894a78a1ebefe36f21e21aaea68b42bccfc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17808
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
5 years agodev: StreamID generation in DMA device
Giacomo Travaglini [Mon, 28 Jan 2019 12:37:51 +0000 (12:37 +0000)]
dev: StreamID generation in DMA device

This patch is adding a StreamID tag to any DMA Packet. StreamIDs are
tags which are used by IOMMUs to distinguish between different
devices/functions.

For PCI devices for example, the RID (Pci Bus number, Pci Device
number, Pci Function number) could be stored in the Packet streamID
field.

For the DmaDevice base class, a simple pair of (Sub)StreamIDs has been
provided.  This is basically attaching a fixed (decided at python config
time) streamID per device.  If a derived device wants to implement a
more elaborate packet tagger (for example if it wants to have more than
one streamID), it needs to pass a different StreamID and SubstreamID to
the DmaPort interface (like dmaAction).

Change-Id: Ia17cf00437f7d3eb79211c1374134b174f90de59
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/public/gem5/+/16749
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agotests: There is no architecture called "timing".
Gabe Black [Wed, 1 May 2019 23:39:38 +0000 (16:39 -0700)]
tests: There is no architecture called "timing".

I'm sure that's supposed to be "x86". By switching it over, the x86
regression tests became runnable again.

Change-Id: I9505703a0be71047ef3dd312ae83e76c2b32fdb5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18568
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Store a PhysProxy port in Gicv3Redist
Giacomo Travaglini [Wed, 1 May 2019 09:59:22 +0000 (10:59 +0100)]
dev-arm: Store a PhysProxy port in Gicv3Redist

This spares us from retrieving the TC pointer every time we want to
write/read to memory (LPIs)

Change-Id: Iad76b5e69188fa0ac5c6777a3b2664b0fc66b12f
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/public/gem5/+/18600
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Add named variable for GICD_TYPER.IDBits
Giacomo Travaglini [Tue, 30 Apr 2019 16:16:19 +0000 (17:16 +0100)]
dev-arm: Add named variable for GICD_TYPER.IDBits

This could be used by other GICv3 components to query the maximum
number of implemented interrupt identifiers

Change-Id: I132e50de331aea22523260bcefba7e961b53eccd
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/public/gem5/+/18599
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Read correct version of ICC_BPR register
Giacomo Travaglini [Sat, 27 Apr 2019 18:37:25 +0000 (19:37 +0100)]
dev-arm: Read correct version of ICC_BPR register

Some methods like groupPriorityMask check for the value of binary point
registers. Those registers have a minimum value.  Writing to those
register is taking this into account, but the problem with the minimum
value arises when the value is checked before sw is writing to them.
In this case the minimum value won't be considered if the read is
directly forwarded to the ISA class.

Change-Id: Id432a37f1634b02bc478d65c52ffb88323d4bb77
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/public/gem5/+/18598
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Get a Gicv3Redistributor ptr from phys address
Giacomo Travaglini [Fri, 26 Apr 2019 10:24:17 +0000 (11:24 +0100)]
dev-arm: Get a Gicv3Redistributor ptr from phys address

The patch is adding the following method to Gicv3:

* Gicv3::getRedistributorByAddr
This will be needed by the ITS when trying to select the target
redistributor after decoding the collection table entry (RDBase).

Change-Id: I40e2c155f2fdc8ca6d3c20ff7a27702e02499f20
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/public/gem5/+/18597
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Add several LPI methods in Gicv3Redistributor
Giacomo Travaglini [Mon, 15 Apr 2019 15:42:43 +0000 (16:42 +0100)]
dev-arm: Add several LPI methods in Gicv3Redistributor

Refactoring the existing in code in smaller methods will be crucial when
adding the ITS module, which is a client for the redistributor class and
which will require it to take different actions depending on the command
it receives from software.

List of methods:

* read/writeEntryLPI
Reading/Writing a byte from the LPI pending table

* isPendingLPI
Checks if the pINTID LPI is set. Knowing if an LPI is set is needed by
the MOVI command, which is transfering the pending state from one
redistributor to the other only if the LPI is pending.

Change-Id: If14b1c28ff7f2aa20b12dcd822bf6a490cbe0270
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/public/gem5/+/18596
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Take LPIs into account when interacting with CPUIF regs
Giacomo Travaglini [Thu, 25 Apr 2019 09:43:48 +0000 (10:43 +0100)]
dev-arm: Take LPIs into account when interacting with CPUIF regs

Previous code was not handling LPIs when it came to
activation/deactivation of interrupts.

Change-Id: Ie38f83c66afdc42132679d7e2e5823990f1710d0
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/public/gem5/+/18595
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Fix GICv3 LPIs priority value
Giacomo Travaglini [Thu, 25 Apr 2019 09:45:58 +0000 (10:45 +0100)]
dev-arm: Fix GICv3 LPIs priority value

Priority bits in the LPI configuration table entry are only the MSBits
([7:2]) and need to be shifted in order to get the real LPI priority
value.

Change-Id: Id04dd4fa9113a32712c73a7094df498de3c0d2b5
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/public/gem5/+/18594
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Disable LPI Configuration Table caching
Giacomo Travaglini [Thu, 25 Apr 2019 15:31:55 +0000 (16:31 +0100)]
dev-arm: Disable LPI Configuration Table caching

This is done since caching is not done correctly, and we don't care for
now about performance degradations since the redistributor is using
PhysProxy ports.
Caching will make sense once the magical accesses will be replaced by
real atomic/timing transactions.

Change-Id: Iafe2a7843210111efc82c265bd0d5ec3cd9abb5a
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/public/gem5/+/18593
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Check EnableLPIs before checking for pending LPIs
Giacomo Travaglini [Fri, 26 Apr 2019 12:21:59 +0000 (13:21 +0100)]
dev-arm: Check EnableLPIs before checking for pending LPIs

Before reading the tables, GICR_PENDBASER and GICR_PROPBASER need to be
properly set, and those will have a consistent value only once sw
enables LPIs.

Change-Id: Ifb87944a491045e7a13ce7a280c555cb0c1e47f4
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/public/gem5/+/18592
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: GICv3 LPI tables are using physical addresses
Giacomo Travaglini [Tue, 23 Apr 2019 16:06:23 +0000 (17:06 +0100)]
dev-arm: GICv3 LPI tables are using physical addresses

Change-Id: I439112f318720ae74c43a374fd3a524c607b3a23
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/public/gem5/+/18591
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Fix GICv3 LPI loop
Giacomo Travaglini [Tue, 23 Apr 2019 16:38:54 +0000 (17:38 +0100)]
dev-arm: Fix GICv3 LPI loop

Loop was mistakenly increasing the upper bound of the iteration rather
than the index variable itself.

Change-Id: I0a5a7bc189bc0954a8a6d9581032c2ed902030da
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/public/gem5/+/18590
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Fix Bitwise operation in GICv3
Giacomo Travaglini [Tue, 23 Apr 2019 15:08:14 +0000 (16:08 +0100)]
dev-arm: Fix Bitwise operation in GICv3

GICv3 LPI code is wrongly using the xor operator (^) in order to
evaluate powers of two.

Change-Id: Ib1131fd5940d334967a3741f8fd15d86625be356
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/public/gem5/+/18589
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agotests: Add missing kernels to system creation
Daniel R. Carvalho [Wed, 1 May 2019 20:53:29 +0000 (22:53 +0200)]
tests: Add missing kernels to system creation

Change 149c1fc2d070a8ce073263880ecf2ccf7535e569 removed the
default value of the kernels, and fs tests rely on those.

Change-Id: I6d83420af5881ab59c2d223a9915f363dd8a1c69
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18528
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch: Stop using TheISA within the ISAs.
Gabe Black [Tue, 30 Apr 2019 00:12:08 +0000 (17:12 -0700)]
arch: Stop using TheISA within the ISAs.

We know for sure what the ISA is, so there's no need for the
indirection.

Change-Id: I73ff04c50890d40a4c7f40caeee746b68b846cb3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18488
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agox86: Get rid of some unnecessary TheISA-es in x86.
Gabe Black [Mon, 29 Apr 2019 23:32:37 +0000 (16:32 -0700)]
x86: Get rid of some unnecessary TheISA-es in x86.

The X86ISA namespace is already available.

Change-Id: I5774968fdfb30b01eba52cdec5e6ef2c75cb66e4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18471
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosparc: Move translation constants from isa_traits.hh into tlb.hh.
Gabe Black [Mon, 29 Apr 2019 23:28:58 +0000 (16:28 -0700)]
sparc: Move translation constants from isa_traits.hh into tlb.hh.

These aren't used outside of SPARC. Also get rid of some unused
constants.

Change-Id: Icfe119f88189348245a6f225a61e62dfa93ea951
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18470
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosparc: Move the interrupt types out of isa_traits.hh into interrupts.hh.
Gabe Black [Mon, 29 Apr 2019 23:20:45 +0000 (16:20 -0700)]
sparc: Move the interrupt types out of isa_traits.hh into interrupts.hh.

Those types aren't generic or used outside of SPARC.

Change-Id: I9bb154920a9625f12388c3d295dc933ab51fadde
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18469
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch: Remove the mt.hh switching header.
Gabe Black [Mon, 29 Apr 2019 23:05:12 +0000 (16:05 -0700)]
arch: Remove the mt.hh switching header.

This header was only useful in MIPS and is only used internally within
MIPS. It doesn't need to be a switching header file.

Change-Id: Id7005f73b95e122f9ab83b3b657cae3391682f26
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18468
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agocpu: alpha: Delete all occurrances of the simPalCheck function.
Gabe Black [Sun, 28 Apr 2019 04:07:54 +0000 (21:07 -0700)]
cpu: alpha: Delete all occurrances of the simPalCheck function.

This is now handled within the ISA description.

Change-Id: Ie409bb46d102e59d4eb41408d9196fe235626d32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18434
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoalpha: Implement simPalCheck within the ISA description.
Gabe Black [Sun, 28 Apr 2019 04:00:41 +0000 (21:00 -0700)]
alpha: Implement simPalCheck within the ISA description.

This doesn't need to be plumbed through generic interfaces. If the
function/instruction got more complex in the future (unlikely since
Alpha doesn't really see development these days), it could be moved to
a helper function defined within Alpha files.

Change-Id: Ib746fad7bb13c5cc9c6ee555c3a46ce686771c12
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18433
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agocpu: Remove hwrei from the generic interfaces.
Gabe Black [Sun, 28 Apr 2019 03:51:22 +0000 (20:51 -0700)]
cpu: Remove hwrei from the generic interfaces.

This mechanism is specific to Alpha and doesn't belong sprinkled around
the CPU's generic mechanisms.

Change-Id: I87904d1a08df2b03eb770205e2c4b94db25201a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18432
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: use DPRINTF_SYSCALL for ioctl/wait4
Alexandru Dutu [Wed, 18 Apr 2018 21:01:08 +0000 (17:01 -0400)]
sim-se: use DPRINTF_SYSCALL for ioctl/wait4

Change-Id: I4fbaf1a0653f13ae964a2574cc26bbaac2dc0686
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12124
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
5 years agosim-se: bugfix for 54c77aa055e
Brandon Potter [Mon, 29 Apr 2019 20:22:52 +0000 (16:22 -0400)]
sim-se: bugfix for 54c77aa055e

54c77aa055e introduced a bug which manifests as cyclical
dependency on a member initialization for the Process
class.

The current working directory (cwd) parameter is passed into
Process to initialize both the target and host versions of the
cwd. (The target and host versions may differ if the faux
filesystem is used.) The host cwd init invoked methods which
rely on the host cwd already being initialized. To avoid the
bug, the code will now rely on using the targets cwd version,
but will issue checks against the redirect paths.

Change-Id: I4ab644a3e00737dbf249f5d6faf20a26ceb04248
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18448
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch: cpu: Track kernel stats using the base ISA agnostic type.
Gabe Black [Sun, 28 Apr 2019 02:51:20 +0000 (19:51 -0700)]
arch: cpu: Track kernel stats using the base ISA agnostic type.

Then cast to the ISA specific type when necessary. This removes
(mostly) an ISA specific aspect to some of the interfaces. The ISA
specific version of the kernel stats still needs to be constructed and
stored in a few places which means that kernel_stats.hh still needs to
be a switching arch header, for instance.

In the future, I'd like to make the kernel its own object like the
Process objects in SE mode, and then it would be able to instantiate
and maintain its own stats.

Change-Id: I8309d49019124f6bea1482aaea5b5b34e8c97433
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18429
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agoalpha: Implement HWREI in the ISA.
Gabe Black [Sun, 28 Apr 2019 03:37:44 +0000 (20:37 -0700)]
alpha: Implement HWREI in the ISA.

This moves it out of generic interfaces and the CPU implementations.

Change-Id: I6767d6b26d0ae128b5bdad5830dce838be74e256
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18431
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoalpha: Add some control registers to the ISA operands list.
Gabe Black [Sun, 28 Apr 2019 03:37:13 +0000 (20:37 -0700)]
alpha: Add some control registers to the ISA operands list.

These will be used in the in-ISA HWREI implementation.

Change-Id: Ia9f7bf1aa2dbd764c878911c2cba680840397c62
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18430
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: add socket ioctls
Brandon Potter [Wed, 18 Apr 2018 20:57:46 +0000 (16:57 -0400)]
sim-se: add socket ioctls

The OpenMPI 1.8.2 runtime needs the ioctl code
included in this patch to issue socket operations
on the host machine.

Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12123
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agosystemc: Add a distinct async_request_update mechanism.
Gabe Black [Mon, 22 Apr 2019 22:24:40 +0000 (15:24 -0700)]
systemc: Add a distinct async_request_update mechanism.

This mechanism had just been plumbed into the regular request_update,
but that doesn't have any thread safety which is the whole point of
async_request_update. This new mechanism puts async update requests
into their own list which is checked any time normal updates happen.

The delta cycle which triggers those updates must happen through some
other means which will usually be ok. The exact timing of the update
is undefined, so it would be legal for it to either not be recognized
before the impending end of the simulation, or for it to get picked up
by subsequent activity. If there isn't subsequent activity but the
simulation also doesn't end, for instance if there are only gem5 events
left, then that update could be lost. That is an unresolved issue.

It would be nice to schedule a "ready" event if async updates were
added which would ensure they wouldn't starve. Unfortunately that
requires the event queue lock, and in practice it's been found that a
systemc process might block, effectively holding the event queue lock,
while it waits for some asyncrhonous update to give it something to do.
This effectively deadlocks the system since the update is blocked on
the lock the main thread holds, and the main thread is blocked waiting
for the update.

Change-Id: I580303db01673faafc2e63545b6a69b3327a521c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18288
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agocpu: Get rid of the (read|set)RegOtherThread methods.
Gabe Black [Sun, 28 Apr 2019 08:56:22 +0000 (08:56 +0000)]
cpu: Get rid of the (read|set)RegOtherThread methods.

These are implemented by MIPS internally now.

Change-Id: If7465e1666e51e1314968efb56a5a814e62ee2d1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18436
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomips: Implement readRegOtherThread and setRegOtherThread directly.
Gabe Black [Sun, 28 Apr 2019 08:22:40 +0000 (08:22 +0000)]
mips: Implement readRegOtherThread and setRegOtherThread directly.

These accessors can be implemented as helper functions within MIPS
without having to plumb them through a bunch of common interfaces.
There are a few problems with the way they were implemented which are
carried forward to this new implementation as well. That includes
hiding the register accesses from the ISA parser and therefore the
CPU's dependency tracking, potentially panicing or accessing a non
existent thread based on a possible set of input values, and modifying
register values even if an instruction is being executed speculatively.

Fixing these problems would be fairly involved and require changing how
dependencies are tracked in all the CPUs so that they can act across
threads, and also how registers are handled in the ISA description
itself.

The original implementation just punted on making this work in CPUs
other than the minor CPU (and potentially one or more CPU models that
were not and/or are not in the code base). Where as that implementation
might have paniced if these methods were called, this will attempt to
work, but may have incorrect behavior based on the limitations
described above. I'd consider this an acceptable tradeoff, at least for
the time being.

Change-Id: I94adceafb9812a8641c76ea3518c3285c31baf51
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18435
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agocpu: Include debug flags regardless of whether the ISA is null.
Gabe Black [Sun, 28 Apr 2019 02:11:26 +0000 (19:11 -0700)]
cpu: Include debug flags regardless of whether the ISA is null.

Whether debug flags are available has no interaction with what the ISA
is.

Change-Id: I71d9204f948618831796e6c7a4c16bbebfb1a4fb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18428
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: create Proc out files in out dir
Steve Reinhardt [Wed, 18 Apr 2018 20:41:32 +0000 (16:41 -0400)]
sim-se: create Proc out files in out dir

Redirected output files from Process objects were being
created in the current directory instead of in the
output directory.

Change-Id: Ieb6ab5556fbcc811f4f24910da247d4dcdbc71bd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12122
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Faults DebugFlag now printing inst opcode if available
Giacomo Travaglini [Thu, 14 Feb 2019 15:10:27 +0000 (15:10 +0000)]
arch-arm: Faults DebugFlag now printing inst opcode if available

This makes it easier to debug unimplemented instructions.

Change-Id: Iaaa288037326722f07251299fd68eacb2e295376
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/public/gem5/+/18396
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Report real instruction encoding when Undefined
Giacomo Travaglini [Wed, 13 Feb 2019 15:14:34 +0000 (15:14 +0000)]
arch-arm: Report real instruction encoding when Undefined

When dumping the opcode that caused an Undefined Instruction, we just
want to dump the real instruction encoding, and not the extended version
with metabits (like thumb, bigThumb etc). This was not appening when
panicking in SE mode.

The patch is also replacing custom masking in the Unknown(64) disassembler
in favour of ArmStaticInstruction::encoding() helper.

Change-Id: I9eb6fd145d02b4b07bb51f0bd89ca014d6d5a6de
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/public/gem5/+/18395
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch, sim: Simplify the AuxVector type.
Gabe Black [Thu, 25 Apr 2019 03:11:23 +0000 (20:11 -0700)]
arch, sim: Simplify the AuxVector type.

The AuxVector type has a bunch of accessors which just give access to
the underlying variables through references. We might as well just make
those members accessible directly.

Also, the AuxVector doesn't need to handle endianness flips itself. We
can tell the byteswap mechanism how to flip an AuxVector, and let it
handle that for us.

This gets rid of the entire .cc file which was complicated by trying
to both hide the ISA specific endianness translations, and instantiate
templated functions in a .cc.

Change-Id: I433cd61e73e0b067b6d628fba31be4a4ec1c4cf0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18373
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
5 years agomem: Remove the ISA specialized versions of port proxy's read/write.
Gabe Black [Thu, 25 Apr 2019 00:19:23 +0000 (17:19 -0700)]
mem: Remove the ISA specialized versions of port proxy's read/write.

These selected their behavior based on ifdefs and had to be disabled
when on the NULL ISA. The versions which take an explicit endianness
have been renamed to just read/write instead of readGtoH and writeHtoG
since the direction of the translation is obvious from context.

Change-Id: I6cfbfda6c4481962d442d3370534e50532d41814
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18372
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem: Minimize the use of MemObject.
Gabe Black [Tue, 23 Apr 2019 02:45:10 +0000 (19:45 -0700)]
mem: Minimize the use of MemObject.

MemObject doesn't provide anything beyond its base ClockedObject any
more, so this change removes it from most inheritance hierarchies.
Occasionally MemObject is replaced with SimObject when I was fairly
confident that the extra functionality of ClockedObject wasn't needed.

Change-Id: Ic014ab61e56402e62548e8c831eb16e26523fdce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18289
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agopython: Get rid of the VectorPort constructor.
Gabe Black [Tue, 16 Apr 2019 06:29:57 +0000 (23:29 -0700)]
python: Get rid of the VectorPort constructor.

The only thing it was doing beyond calling the parent Port __init__ was
to set isVec, and nobody actually looks at that value later.

Change-Id: I567cb583e6f02a6c18504b9bb20dd13b3c934822
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18175
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agopython: Replace the Master/Slave Ports with Request/Response ports.
Gabe Black [Tue, 16 Apr 2019 03:47:48 +0000 (20:47 -0700)]
python: Replace the Master/Slave Ports with Request/Response ports.

These are a little more descriptive and a little less potentially
offensive.

Change-Id: I84c30f783f0a4c242cb4f54ab272b6fdf1e9eec7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18174
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoarch-arm: updateMiscReg not setting isHyp in aarch64
Giacomo Travaglini [Mon, 1 Apr 2019 13:38:14 +0000 (14:38 +0100)]
arch-arm: updateMiscReg not setting isHyp in aarch64

The isHyp flag should be set for a TLB::NormalTran when in EL2.  This
was happening in aarch32 only, where the CPSR mode is checked, while
aarch64 was only using it for explicit EL2 translations, like for AT
instructions.

Change-Id: I54605811e9dde75b5cf8868190b0f4c2a8d46570
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/public/gem5/+/18394
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarm: Factor some repetition out of the ProcessInfo constructor.
Gabe Black [Thu, 25 Apr 2019 00:13:37 +0000 (17:13 -0700)]
arm: Factor some repetition out of the ProcessInfo constructor.

Change-Id: I34f952d1097886704d37304478de125a915b2615
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18371
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoarm: Fix some style issues in stacktrace.cc.
Gabe Black [Thu, 25 Apr 2019 00:08:18 +0000 (17:08 -0700)]
arm: Fix some style issues in stacktrace.cc.

De-indent the ArmISA namespace, and wrap some overly long lines.

Change-Id: Idc02b025bdfda483ddbd27d662e2314a5cbcb23c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18370
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agox86: Refactor the ProcessInfo constructor.
Gabe Black [Thu, 25 Apr 2019 00:04:16 +0000 (17:04 -0700)]
x86: Refactor the ProcessInfo constructor.

That function had a lot of repetition which is easily factored out
into its own function.

Change-Id: I3b7a522de2ba808856bb59df75b80efde6780e3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18369
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agoconfigs: faux-filesystem fix w/ ruby in se mode
David Hashe [Wed, 18 Apr 2018 20:40:28 +0000 (16:40 -0400)]
configs: faux-filesystem fix w/ ruby in se mode

These changes are needed so that the config scripts
can report cache hierarchy information to the faux
filesystem.

This is useful for the ROCm runtime when it reads
psuedofiles from the host filesytem from "/proc".

Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12121
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agox86: Fix some style issues in stacktrace.cc.
Gabe Black [Wed, 24 Apr 2019 23:55:57 +0000 (16:55 -0700)]
x86: Fix some style issues in stacktrace.cc.

De-indent the X86ISA namespace, and wrap some overly long lines.

Change-Id: I01a6b66a1cf721e16e4ed4dd1c3469ee112e9177
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18368
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: add a faux-filesystem
David Hashe [Wed, 18 Apr 2018 20:36:55 +0000 (16:36 -0400)]
sim-se: add a faux-filesystem

This change introduces the concept of a faux-filesystem.
The faux-filesystem creates a directory structure in m5out
(or whatever output dir the user specifies) where system calls
may be redirected.

This is useful to avoid non-determinism when reading files
with varying path names (e.g., variations from run-to-run if
the simulation is scheduled on a cluster where paths may change).

Also, this changeset allows circumventing host pseudofiles which
have information specific to the host processor (such as cache
hierarchy or processor information). Bypassing host pseudofiles
can be useful when executing runtimes in the absence of an
operating system kernel since runtimes may try to query standard
files (i.e. /proc or /sys) which are not relevant to an
application executing in syscall emulation mode.

Change-Id: I90821b3b403168b904a662fa98b85def1628621c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12119
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Remove un-needed hyp flag in TLBI operations
Giacomo Travaglini [Wed, 10 Apr 2019 14:45:30 +0000 (15:45 +0100)]
arch-arm: Remove un-needed hyp flag in TLBI operations

The hyp flag was probably a legacy pre-v8 flag distinguishing
invalidation targeting PL2 translation regime (hyp mode).
Since the introduction of target_el parameter, hyp boolean is not needed
anymore.  The patch works by setting the hyp flag in the flush* methods
in the TLB automatically by checking if target_el == EL2.

Change-Id: I798009e09ff24a383dea871e348188bae2685e8e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jan-Peter Larsson <jan-peter.larsson@arm.com>
Reviewed-by: Anouk Van Laer <anouk.vanlaer@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18389
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoarch-arm: Correct target EL field in TLBI operations
Giacomo Travaglini [Wed, 10 Apr 2019 13:26:47 +0000 (14:26 +0100)]
arch-arm: Correct target EL field in TLBI operations

Some TLB Invalidation operations affecting the EL2 translation regime
were marked as targeting EL1 instead of EL2

Change-Id: I77821eec7a409e9df6a6814855f9a375832ffe74
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jan-Peter Larsson <jan-peter.larsson@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18388
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Move GICv3 (Re)Ditributor address in Realview.py
Giacomo Travaglini [Tue, 16 Apr 2019 13:48:10 +0000 (14:48 +0100)]
dev-arm: Move GICv3 (Re)Ditributor address in Realview.py

Base addresses for GICv3's Distributor and Redistributors are
implementation defined: they depend on the platform rather than the
model. This patch is then moving dist_addr and redist_addr
initialization in Realview.py

Change-Id: I1246df500262f4d3d5a38e62d0240945f90941ee
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/public/gem5/+/18393
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Limit number of max PE in GICv3 to 128
Giacomo Travaglini [Fri, 5 Apr 2019 12:39:05 +0000 (13:39 +0100)]
dev-arm: Limit number of max PE in GICv3 to 128

This is needed since there is a problem in the memory layout of
VExpress_GEM5_V2 as it is: having 256KB pages is creating overlapping
regions when reserving space for 256 PEs.

GICv3 redistributors: 0x2c010000 - 0x30010000
PCI regions: 0x30000000 - 0x40000000

We fix this by cutting down the number of supported PEs to 128

Change-Id: I6e87f66a6150a441ccba298662b4548a4972dc40
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/public/gem5/+/18392
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Add GICv4 extension switch in GICv3
Giacomo Travaglini [Fri, 5 Apr 2019 12:12:08 +0000 (13:12 +0100)]
dev-arm: Add GICv4 extension switch in GICv3

This is currently used only for determining which is the correct
size of redistributors in memory (256KB in GICv4 and 128KB in GICv3)

Change-Id: I2c07005e97167fde03548313c9927176788f31dd
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/public/gem5/+/18391
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agodev-arm: Check for maximum number of supported PE in GICv3
Giacomo Travaglini [Fri, 5 Apr 2019 12:33:01 +0000 (13:33 +0100)]
dev-arm: Check for maximum number of supported PE in GICv3

This is currently set to 256

Change-Id: If7bb2847c22f29bfa0cb4ebf4a7984ee43ab4e29
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/public/gem5/+/18390
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfig: Add flag options to set the hardware prefetchers to use
Javier Bueno [Wed, 27 Mar 2019 13:19:52 +0000 (14:19 +0100)]
config: Add flag options to set the hardware prefetchers to use

This patch adds three flag options to set the prefetcher class of the
L1i cache, L1d cache and L2 cache.

Change-Id: I310fcd9c49f9554d98cd565a32bdb96a3e165486
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17709
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agocpu,mem: missing override specifier
Andrea Mondelli [Tue, 23 Apr 2019 17:36:19 +0000 (13:36 -0400)]
cpu,mem: missing override specifier

Change-Id: I731d3ef021596450ac307461f215760a148bb28a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18348
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosystemc: Use the new TLM socket types in the TLM bridge SimObjects.
Gabe Black [Tue, 16 Apr 2019 02:58:16 +0000 (19:58 -0700)]
systemc: Use the new TLM socket types in the TLM bridge SimObjects.

These are in the definition of the python version of the SimObjects.

Change-Id: Iadb143158815df68cf32cc254ad19f755ab4e78a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18173
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agosystemc: Add Port types for initiator and target sockets.
Gabe Black [Tue, 16 Apr 2019 02:56:40 +0000 (19:56 -0700)]
systemc: Add Port types for initiator and target sockets.

These make it clear that a port represents a TLM socket, what direction
it faces, and what its width is.

Change-Id: Idcbea2b9b053f1e0685e011bc2c7de2468fb25b2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18172
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agodev: Use the new Port role mechanism to make an EtherInt Port type.
Gabe Black [Tue, 16 Apr 2019 02:47:28 +0000 (19:47 -0700)]
dev: Use the new Port role mechanism to make an EtherInt Port type.

This type always uses the same "ETHERNET" role, and all connections are
symmetric and self compatible.

Change-Id: I1d060f8c098d52ae9f65c052f816bc813590ff9c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18171
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agopython: Generalize the Port.splice function.
Gabe Black [Tue, 16 Apr 2019 04:05:55 +0000 (21:05 -0700)]
python: Generalize the Port.splice function.

Now that the MASTER and SLAVE roles aren't special, the splice function
needs to be able to handle arbitrarily role-d peers.

Change-Id: I22a28b7cdcb93f7f370730b7e38b0e6d3500a6a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18170
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

5 years agopython: Generalize the dot_writer to handle non Master/Slave roles.
Gabe Black [Tue, 16 Apr 2019 05:10:37 +0000 (22:10 -0700)]
python: Generalize the dot_writer to handle non Master/Slave roles.

Change-Id: I6d93c28e754c0cacacdd5e8885c45bc861135e94
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18169
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agopython: Make Port roles a more generic concept.
Gabe Black [Tue, 16 Apr 2019 02:39:14 +0000 (19:39 -0700)]
python: Make Port roles a more generic concept.

A recent change got rid of the strict Master => Slave port relationship
which used to be checked in python and instead left the checking up to
C++. One major downside to this approach is that it was no longer
obvious in the configuration what was supposed to be connected to what,
and it still left the arbitrary and misleading MasterPort and SlavePort
types in the Ethernet devices which could now connect with each other
symmetrically but couldn't actually connect to an arbitrary
MasterPort/SlavePort.

This change exposes the base Port and VectorPort types, and makes them
accept a "role" parameter in __init__ which used to be set directly by
their subclasses. This role can be any string, and will be used later
to check for compatiblity and to give a hint as to what can be
connected to what in the SimObject definitions.

To make the checks work with arbitrary compatible pairs, the base Port
type now has a class method called compat() which accepts a pair of
roles which will become mutually compatible, ie any port with the first
role will be allowed to connect to any port with the second role, and
vice versa. To be self compatible, the same role should be passed in
for both parameters.

To maintain compatibility, the MasterPort and SlavePort types are
retained, but now they're nothing special and could have been set up
in any arbitrary SimObject .py file. The same is true for
MasterVectorPort and SlaveVectorPort.

Also, since we can no longer assume that all edges in the dot graph of
the config should start with a port with the MASTER role and end with
a port with the SLAVE role, Ports now track an is_source property which
says whether the arrow head should be surpressed at that end of the
edge representing the connection.

Change-Id: Ifcc6faab05e437ad87cd21f0ba613b09cf21c321
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18168
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

5 years agopython: fix tracing after Python 3 refactor
Ciro Santilli [Mon, 15 Apr 2019 13:08:49 +0000 (14:08 +0100)]
python: fix tracing after Python 3 refactor

gem5.opt --debug-flags ExecAll

was failing with:

ImportError: No module named defines

on Python 2.

Change-Id: I06959d6e0ccb7c661c7c749af3392632dac779f3
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18108
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agosim-se: Enhance clone for X86KvmCPU
Alexandru Dutu [Tue, 16 Apr 2019 03:36:36 +0000 (23:36 -0400)]
sim-se: Enhance clone for X86KvmCPU

This changeset enables clone to work with X86KvmCPU model, which
will allow running multi-threaded applications at near hardware
speeds. Even though the application is multi-threaded, the KvmCPU
model uses one event queue, therefore, only one hardware thread
will be used, through KVM, to simulate multiple application threads.

Change-Id: I2b2a7b1edb1c56eeb9c4fa0553cd236029cd53f8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18268
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Fix fix of replacement count
Daniel [Mon, 22 Apr 2019 09:32:22 +0000 (11:32 +0200)]
mem-cache: Fix fix of replacement count

Commit 7976b561de61b7523ca9a860154ad7ba701d12a7 tried fixing
replacement update when a single location can be associated to
multiple blocks.

Although the comment of the correct action was added, the proper
validation check was forgotten. This change adds that check and
moves doing the eviction to when there is a valid block.

Change-Id: I31d8bb914ccfd1849e9d97464d70a58a62f59533
Signed-off-by: Daniel <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18210
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agocpu: Eliminate the ProxyThreadContext class.
Gabe Black [Sun, 14 Apr 2019 03:49:20 +0000 (20:49 -0700)]
cpu: Eliminate the ProxyThreadContext class.

Replace it with direct inheritance from the ThreadContext class in the
SimpleThread class which was the only place it was used.

Also take the opportunity to use some specialized types instead of
ints, etc., add some consts, and fix some style issues.

Change-Id: I5d2cfa87b20dc43615e33e6755c9d016564e9c0e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18048
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agoconfigs: Use param to get number of processors
Po-Hao Su [Mon, 22 Apr 2019 08:23:18 +0000 (16:23 +0800)]
configs: Use param to get number of processors

Although the parameter np is the same as options.num_cpus. But we should
get the number of processors from the parameters of the function.

Change-Id: I3eb02d7c75ab35410b773b06001d1b145cdccd49
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18248
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
5 years agomem-cache: Fix increasing replacement count
Daniel R. Carvalho [Thu, 18 Apr 2019 12:54:18 +0000 (14:54 +0200)]
mem-cache: Fix increasing replacement count

Replacements should be increased when there is any evicted
block, which does not necessarily have to be the victim.

For example, assume a superblock contains 4 blocks, and both
A and C are stored compressed (belonging to SB_1). Then F,
from SB2 needs to make room by replacing SB1. If F map to
location 2, the number of replacements should be increased,
even though 2 had no valid blocks:

 Tag      Data          Tag     Data
|SB_1|--|A|X|C|X|  --> |SB_2| |X|F|X|X|
         1 2 3 4               1 2 3 4

Change-Id: I7b3735d28a35faa8d8fa613a1555bb258da65859
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18208
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

5 years agomem-cache: Remove blk_addr from Queue::trySatisfyFunctional
Daniel R. Carvalho [Mon, 11 Feb 2019 14:41:34 +0000 (15:41 +0100)]
mem-cache: Remove blk_addr from Queue::trySatisfyFunctional

The blk_addr is pkt->getBlockAddr(), and therefore can be
acquired internally, when needed, as long as the pkt is
provided.

Change-Id: I2780445d2a0cb9e27257961efc4f438cc19550e5
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17537
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Add match functions to QueueEntry
Daniel R. Carvalho [Thu, 24 Jan 2019 14:00:18 +0000 (15:00 +0100)]
mem-cache: Add match functions to QueueEntry

Having the caller decide the matching logic is error-prone, and
frequently ends up with the secure bit being forgotten. This
change adds matching functions to the QueueEntry to avoid this
problem.

As a side effect the signature of findPending has been changed.

Change-Id: I6e494a821c1e6e841ab103ec69632c0e1b269a08
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17530
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem: Add packet matching functions
Daniel R. Carvalho [Mon, 11 Feb 2019 13:19:57 +0000 (14:19 +0100)]
mem: Add packet matching functions

Add both block and non-block-aligned packet matching functions,
so that both address and secure bits are checked when checking
whether a packet matches a request.

Change-Id: Id0069befb925d112e06f250741cb47d9dfa249cc
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17533
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Move Target to QueueEntry
Daniel R. Carvalho [Wed, 30 Jan 2019 13:46:22 +0000 (14:46 +0100)]
mem-cache: Move Target to QueueEntry

WriteQueueEntry's target has 100% functionality overlap with MSHR's,
therefore make it base to MSHR::Target.

Change-Id: I48614e78179d708bd91bbe75a752e5a05146e8eb
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17534
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem-cache: Assert Entry inherits from QueueEntry in Queue
Daniel R. Carvalho [Thu, 24 Jan 2019 14:13:07 +0000 (15:13 +0100)]
mem-cache: Assert Entry inherits from QueueEntry in Queue

Queue has several assumptions regarding its template parameter,
so make sure they are fulfilled by forcing Entry to be derived
from QueueEntry.

Change-Id: I0203a62aec00c04ac89e9674d86a44a07f9f13ab
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17529
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem: Make DRAMCtrl::decodeAddr const
Daniel R. Carvalho [Tue, 12 Feb 2019 13:20:42 +0000 (14:20 +0100)]
mem: Make DRAMCtrl::decodeAddr const

DRAMCtrl's decodeAddr does not need to modify the packet it
receives, nor should it modify the contents of the class,
and therefore both the packet and the function are made const.

Change-Id: I577f48d9a43611ba54878a9a793cb7b4fbb326f4
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17540
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
5 years agomem: Allow packet to provide its own addr range
Daniel R. Carvalho [Fri, 8 Feb 2019 14:31:43 +0000 (15:31 +0100)]
mem: Allow packet to provide its own addr range

Add a getter to Packet to allow it to provide its own addr
range.

Change-Id: I2128ea3b71906502d10d9376b050a62407defd23
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17536
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

5 years agomem: missing override specifier
Andrea Mondelli [Tue, 16 Apr 2019 13:35:32 +0000 (09:35 -0400)]
mem: missing override specifier

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

5 years agomem: Teach SimpleMem to return a MemBackdoor when appropriate.
Gabe Black [Tue, 26 Mar 2019 01:08:27 +0000 (18:08 -0700)]
mem: Teach SimpleMem to return a MemBackdoor when appropriate.

If the back door SimpleMem inherits from AbstractMem has a pointer and
is hence valid, SimpleMem will return that pointer when asked.

Change-Id: I734daba48e4ae5b4ad8ac9a108e7b12b5e82803f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17669
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>