Commit Graph

18570 Commits

Author SHA1 Message Date
Gabe Black
a00a6f953f cpu: Stop using NumVecElemPerVecReg.
Use the register classes regName method, or if necessary, the ratio
between the size of the vector register file and the vector element
register file.

Change-Id: Ibf63ce2b3cc3e3cc3261e5a9b8dcbfdc0af5035b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49164
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-01 18:47:17 +00:00
Giacomo Travaglini
0eba590d01 arch-arm: De-virtualize updateIntState
De-virtualize updateIntState and replace it with the new blockIntUpdate
in the MuxingKvmGic class.

The monolithic updateIntState is GicV2 specific and it is not compatible
with the more complex IRQ update logic in GicV3, which is delegating the
update to the destributor/redistributor/cpuinterface classes

Rather than stubbing the update function the MuxingKvmGic class, we
override the blockIntUpdate to return true in case a KVM gic is in use.
This is loosening the interface, not restricting any GIC implementation
to a specific update interface/design

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ib8d9c99b720c779a2255ac47ee2a655ff281581d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55609
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-01 10:42:57 +00:00
Giacomo Travaglini
4f833b539a arch-arm: Avoid Gic write side effect with blockIntUpdate
When trasferring the state between two GICs (essentially
writing architectural registers) an interrupt might be posted
by the model. We don't want this to happen as the GIC might
be in an inconsistent state. We therefore disable side effects
by relying on the blockIntUpdate method.

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I0e5a86551705254ebacb81b7b358470faad0230c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55608
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-01 10:42:57 +00:00
Giacomo Travaglini
05d733d0cd arch-arm: Generalize KVM Gic state copying logic
By moving the Gic state copying logic from the MuxingKvmGic to the
BaseGic we allow different Gic releases (e.g Gicv2, Gicv3) to override
the implementation accoding to their personal architectural state

It is also possible to use the same logic outside of the KVM
context

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I88d6fca69a9b61a889c5ec53221404b8396cc12d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55607
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-01 10:42:57 +00:00
Bobby R. Bruce
e1af2b71d4 tests: Fix gem5 stdlib NPB example test
'--maxinst' was replaced with '--ticks' for the
'configs/example/gem5_library/x86-npb-benchmarks.py' script. This test
was never updated and resulted in failure. This patch fixes the issue.

Change-Id: I5491d48e3d42c37f703600a3dea323146e5ff6d7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56223
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-29 01:36:17 +00:00
Alex Richardson
d5e734c540 arch-riscv: Fix (c.)addiw sign-extension behaviour
Previously calling a function with an INT_MAX argument would result in
the following (incorrectly extended) trace:
```
lui a1, 524288             : IntAlu :  D=0xffffffff80000000
c_addiw a1, -1             : IntAlu :  D=0xffffffff7fffffff
```
I noticed this due to a kernel assertion that checked the second argument
was bigger than the first. Since INT_MAX was incorrectly being extended to
0xffffffff7fffffff, the generated slt comparison instruction was returning
1 instead of the expected zero (which would have happened with 0x7fffffff).

The problem in the current addiw logic is that the immediate value is an
int64_t, so the 32-bit Rs1/Rc1 values are promoted to 64-bit for the
aritmetic operation, thereby making the current cast redundant.
Fix this by placing parens around the whole expression and truncating
that to 32 bits.

Change-Id: I7b18a8101b1c2614b9f056004e6a7f87b66b64c9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56103
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-28 10:39:09 +00:00
Giacomo Travaglini
7129e2559e mem-ruby: Fix -Werror=unused-variable from recent ruby patch
One of the recent ruby patches [1] adopted iteration over an
unordered_map via structured binding.  As of now it is not possible to
ignore one of the unpacked variables, and, if unused, a warning might be
triggered by some compilers.

With this patch we are fixing the building error by using range-based
for loops without structured binding

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/55723

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I882158cc2aeccc58d30318f29470505c53baf3e2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56104
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
2022-01-28 09:05:22 +00:00
Gabriel Busnot
8a7fcd340f mem-ruby: Add missing CHI transition SD_RSC + *_Stale->BUSY_BLKD
Related JIRA: https://gem5.atlassian.net/browse/GEM5-1180

Change-Id: Ife83bebcaa48345633fce0a0de08394e30c1a796
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56083
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Tiago Muck <tiago.muck@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-28 07:01:14 +00:00
Bobby R. Bruce
7c0c23b2da tests: Use clang-11 for the Kokoro compilation test
We support up to clang-11 which includes some additional checks. It's
better to catch these during the Kokoro/quick tests than during the
nightly compilation tests.

Change-Id: I8076f296875448d39416fecc947f71230ce2ddf7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56003
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-27 19:15:15 +00:00
Adrián Herrera Arcila
0e3c97569f scons: protobuf builder, support source paths
Before this patch, the protobuf builder would search for dependencies
only at the build directory. This works if the importing .proto file
imports paths relative to the build directory, but it results in a build
failure if imports are done relative to the source directory of the
importing file.

This patch adds the source directory of the importing file to the set of
paths searched for dependencies, which solves this issue.

Change-Id: I7debd467485a5087276ac005ac08ab01b32cb02e
Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55963
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-26 08:01:50 +00:00
Adrián Herrera Arcila
0ba36d8a2e scons: protobuf scanner, support source paths
Before this patch, the protobuf scanner would detect implicit
dependencies only if the import statement used a path relative to the
build directory. A path with a different format would result in a build
failure.

This is inconvenient because it impedes .proto files within a source
directory to import each other relative to that source.

Moreover, this is critical for EXTRAS directories with .proto files,
because the paths are forced to include the EXTRAS directory itself.

After this patch, the protobuf scanner uses the Classic scanner from
SCons to also detect implicit dependencies in the source path of the
importing .proto file. Regex management is also delegated to the Classic
scanner.

Change-Id: I1ad466813ef44947f3da07371805cb6376e392f0
Signed-off-by: Adrián Herrera Arcila <adrian.herrera@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55903
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-26 08:01:39 +00:00
Gabriel Busnot
748b613c94 mem-ruby: Fix switch storage in SimpleNetwork
In SimpleNetwork, switches were assigned an index depending on their
position in params().routers. But switches are also referenced by their
router_id parameter in other locations of the ruby network system (e.g.,
src and dst node parameter in links). If the router_id does not match the
position in SimpleNetwork::m_switches, the network initialization might
fail or implement a different topology from what the user intended. This
patch fixes this issue by storing switches in a map instead of a vector.

Change-Id: I398f950ad404efbf9516ea9bbced598970a2bc24
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55723
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-26 06:43:27 +00:00
Tiago Muck
85a1d43c10 mem-ruby: additional SimpleNetwork stats
Additional stats allow more detailed monitoring of switch bandwidth
and stalls.

Also cleaned up previous Throttle stats to match new stat API.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I56604f315024f19df5f89c6f6ea1e3aa0ea185ea
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41865
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:37:46 +00:00
Tiago Mück
9c8f79310f mem-ruby: add priorities in SimpleNetwork routing
Configurations can specify a routing priority for message buffers.
This priority is used by SimpleNetwork when checking for messages
in the routers' input ports. Higher priority ports are always checked
first.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I7e2b35e2cae63086a76def1145f9b4b56220a2ba
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41864
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:37:46 +00:00
Tiago Mück
b476d7c1d3 mem-ruby: fine tunning SimpleNetwork buffers
If physical_vnets_channels is set we adjust the link buffer sizes and
the max_dequeue_rate in order to achieve the expected maximum throughput
assuming a fully pipelined link, i.e., throughput of 1 msg per cycle
per channel (assuming the channels width matches the protocol
logical message size, otherwise maximum throughput may be smaller).

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: Id99ab745ed54686d8ffcc630d622fb07ac0fc352
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41863
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:37:46 +00:00
Tiago Mück
986e7b90d3 mem-ruby: int/ext SimpleNetwork routing latency
One now may specify separate routing latencies for internal and
external links using the router's int_routing_latency and
ext_routing_latency, respectively.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I5532668bf23fc61d02b978bfd9479023a6ce2b16
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41861
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:37:46 +00:00
Tiago Mück
ac278e44f9 mem-ruby: fix SimpleNetwork WeightBased routing
Individual link weights are propagated to the routing algorithms and
WeightBased routing now uses this information to select the output
link when multiple routing options exist.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I86a4deb610a1b94abf745e9ef249961fb52e9800
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41860
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:37:46 +00:00
Tiago Mück
f748fbe7e1 mem-ruby: refactor SimpleNetwork buffers
This removes the int_link_buffers param from SimpleNetwork. Internal
link buffers are now created as children of SimpleIntLink objects.
This results in a cleaner configuration and simplifies some code in
SimpleNetwork.cc.

setup_buffers is also split between Switch.setup_buffers and
SimpleIntLink.setup_buffers for clarity.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I68ad36ec0e682b8d5600c2950bcb56debe186af3
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41859
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:37:46 +00:00
Giacomo Travaglini
d657c28279 arch-arm: Add a reverse map MiscRegIndex -> MiscRegNum64
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I63cdcdfca610cfd37a03769e077388a193510bc7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55606
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:28:55 +00:00
Giacomo Travaglini
8f199c9b7c arch-arm: Reimplement decodeAArch64SysReg using new decode map
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ief6c9d666b01248ea4e01414f575a5c5758618ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55605
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:28:55 +00:00
Giacomo Travaglini
167fb09aaf arch-arm: Generate a decode map for AArch64 MiscRegs
The map is translating AArch64 system register numbers
(op0, op1, crn, crm, op2) into a MiscRegIndex

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I359f5d97b248ffafa9cf461d98339175fdf9688f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55604
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:28:55 +00:00
Giacomo Travaglini
b982437b6e arch-arm: Define MiscRegNum64 data structure
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ia635bc068751edd9305a6e493e38e1a49aa64c4d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55603
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 16:28:55 +00:00
Hoa Nguyen
329ec5e201 stdlib: Remove final decorator from abstract board
@typing.final was not introduced until python3.8.

Change-Id: I65a5f4b5655d2ad80f7b566f9cea8e2371b3be62
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55863
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 09:07:25 +00:00
Franklin He
0544944b47 systemc: Fixed ctor ordering for sc_fifo.hh
This fixes a constructor ordering issue and lets the
headers compile with `-Wreorder` enabled

Test: Compiled SystemC headers with `-Wreorder`
Change-Id: I88703b464f8940dd973c2102f1cd0da757b17985
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55664
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-25 08:59:56 +00:00
Gabe Black
d9e973b6f5 dev: Clean up the IDE disk and controller classes a little.
Fix some style issues, and replace some if () panics with panic_ifs.

Change-Id: Ic4fae016520e43d32f435bf3fc0ec37df25ca02a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55583
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-24 22:49:50 +00:00
Gabe Black
c537d9ad10 arch-arm,cpu: Add a class for ops for vec reg elements.
This lets a caller print the name of a register in a friendly way
without having to know how many elements go with each vector register.

Change-Id: I85598c078c604f1bebdba797308102482639c209
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49163
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-24 22:18:17 +00:00
Tiago Mück
c3880c2c46 mem-ruby: refactored SimpleNetwork routing
The routing algorithm is encapsulated in a separate SimObject to allow
user to implement different routing strategies. The default
implementation (WeightBased) maintains the original behavior.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I5c8927f358b8b04b2da55e59679c2f629c7cd2f9
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41858
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-24 19:09:26 +00:00
Gabe Black
528d184ac7 misc: Linearlize VecElem indexing.
These registers used to be accessed with a two dimensional index, with
one dimension specifying the register, and the second index specifying
the element within that register. This change linearizes that index down
to one dimension, where the elements of each register are laid out one
after the other in sequence.

Change-Id: I41110f57b505679a327108369db61c826d24922e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49148
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-21 23:05:47 +00:00
Luming Wang
73267e67c4 arch-riscv: reduced lr/sc implementation
In gem5::RiscvISA::ISA, handleLocked* functions maintain an address
stack(i.e. locked_addrs) to check whether each SC matches the most
recent LR. However, there are some problems with this implementation.

First, the elements in the stack may only be popped when the
handleLockedSnoop function is invoked. In other cases, the elements
in the stack will not be popped even if the SC and LR match. This
makes the `locked_addrs` get bigger and bigger as gem5 runs.

Second, LR/SC does not always match. For example, in Linux's __cmpxchg[1],
after executing LR, if the value read is not equal to the old value,
the subsequent SC is skipped. For gem5's current implementation, this
would cause the address to be pushed into `locked_addrs` every time
__cmpxchg is failed. But these addresses are never popped. This also
makes the `locked_addrs` get bigger and bigger.

Third, existing emulator implementations (spike, qemu) do not use the
stack, but only record the last address accessed by LR. Afterward,
when executing SC, these implementations determine whether the address
accessed by SC is the same as the one recorded.

This patch modifies gem5's handleLocked* function by referring to
other existing RISC-V implementations. It eliminates `locked_addrs`
and simplifies the related code. Thus, it fixes the "memory leak"-like
error that can occur on `locked_addrs` when executing LR/SC.

Related links:
[1] Linux's cmpxchg implementation for RISC-V:
  + https://github.com/torvalds/linux/blob/master/arch/riscv/include/asm/cmpxchg.h
[2] spike lr/sc implementation:
  + https://github.com/riscv-software-src/riscv-isa-sim/blob/master/riscv/insns/sc_d.h
  + https://github.com/riscv-software-src/riscv-isa-sim/blob/master/riscv/insns/lr_d.h
  + https://github.com/riscv-software-src/riscv-isa-sim/blob/master/riscv/mmu.h
[3] rocket lr/sc implementation:
  + https://github.com/chipsalliance/rocket-chip/blob/master/src/main/scala/rocket/NBDcache.scala
[4] QEMU lr/sc implementation:
  + https://gitlab.com/qemu-project/qemu/-/blob/master/target/riscv/insn_trans/trans_rva.c.inc

Change-Id: Ic79444cace62e39b7fe9e01f665cb13e4d990d0a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55663
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-21 13:41:23 +00:00
Luming Wang
f67ff25f7b arch-riscv, dev: add VirtIO entropy device(VirtIORng) support
Systemd, which is used by many main stream Linux distributions,
will lead to slow boot if entropy is low. On X86 platforms,
this problem can be alleviated by enabling RDRAND instructions.
However, RISC-V doesn't have similar instructions. For QEMU/KVM,
this problem can be solved by passing randomness from the host
via virtio_rng. But gem5 doesn't have VirtIORng support now.

Some user report that the boot time of riscv-ubuntu-run.py is
too long. To alleviate this problem, this patch add VirtIORng
device support for gem5.

Change-Id: Id93b5703161701212fd6683837034cb0cff590c5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55483
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-21 01:18:31 +00:00
Matthew Poremba
faf3730559 arch-vega: Fix global 64-bit calcAddr with SGPR base
Global instruction address calculation when using an SGPR or SGPR pair
as a base address was being calculated incorrectly when 64-bit addresses
were to be generated.

From the ISA documentation, the SGPR should be read as 32-bit or 64-bit
depending on "ADDRESS_MODE." The VGPR-offset (computed from the lower
32-bits of vaddr) should always be 32-bits and the offset is 12 bits
from the instruction. This means the 32-bit mask should only be applied
to vaddr to get the VGPU-offset rather than the final sum.

The SGPR base format is being seen in more recent clang/ROCm versions to
avoid unnecessary copies of SGPRs into VGPRs to use VGPRs as the base
address.

Change-Id: I48910611fcfac5b62bc63496bbaabd6f6e53fe0d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55643
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 16:03:23 +00:00
Tiago Mück
286c23da52 mem-ruby: fixed SimpleNetwork starvation
The round-robing scheduling seed is shared across all ports and vnets
in the router and it's possible that, under certain heavy traffic
scenarios, the same port will always fill the input buffers before any
other port is checked.

This patch removes the round-robin scheduling. The port to be checked
first is always the one with the oldest message.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I918694d46faa0abd00ce9180bc98c58a9b5af0b5
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41857
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
2022-01-20 15:26:58 +00:00
Tiago Muck
72185e51b2 mem-ruby: SimpleNetwork router latencies
SimpleNetwork takes into account the network router latency parameter.
The latency may be set to zero. PerfectSwitch and Throttle events were
assigned different priorities to ensure they always execute in the same
order for zero-latency forwarding.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I6cae6a0fc22b25078c27a1e2f71744c08efd7753
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41856
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Tiago Muck
43232cdb9f mem-ruby: Optionally set Consumer ev. priority
JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I62dc6656bbed4e7f4d575a6a82ac254382294ed1
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41855
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Tiago Mück
da41d3eaa4 tests: extend ruby_mem_test
Replace ruby_mem_test by these tests which run different
configurations:

ruby_mem_test-garnet: use Garnet

ruby_mem_test-simple: use SimpleNetwork (same as original ruby_mem_test)

ruby_mem_test-simple-extra: use SimpleNetwork with
--simple-physical-channels option

ruby_mem_test-simple-extra-multicore: same as previous using 4 cores

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I7716cd222dd56ddbf06f53f92ec9b568ed5a182c
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41867
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Tiago Muck
bab3ce1661 configs,mem-ruby: SimpleNetwork physical channels
Setting the physical_vnets_channels parameter enables the emulation of
the bandwidth impact of having multiple physical channels for each
virtual network. This is implemented by computing bandwidth in a
per-vnet/channel basis within Throttle objects. The size of the
message buffers are also scaled according to this setting (when buffer
are not unlimited).

The physical_vnets_bandwidth can be used to override the channel width
set for each link and assign different widths for each virtual network.

The --simple-physical-channels option can be used with the generic
configuration scripts to automatically assign a single physical channel
to each virtual network defined in the protocol.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: Ia8c9ec8651405eac8710d3f4d67f637a8054a76b
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41854
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Tiago Mück
87cdf354be mem-ruby: dequeue rate limit for message buffers
The 'max_dequeue_rate' parameter limits the rate at which messages can
be dequeued in a single cycle. When set, 'isReady' returns false if
after max_dequeue_rate is reached.

This can be used to fine tune the performance of cache controllers.

For the record, other ways of achieving a similar effect could be:
1) Modifying the SLICC compiler to limit message consumption in the
   generated wakeup() function
2) Set the buffer size to max_dequeue_rate. This can potentially cut the
   the expected throughput in half. For instance if a producer can
   enqueue every cycle, and a consumer can dequeue every cycle, a
   message can only be actually enqueued every two (assuming
   buffer_size=1) since the buffer entries available after dequeue
   are only visible in the next cycle (even if the consumer executes
   before the producer).

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I3a446c7276b80a0e3f409b4fbab0ab65ff5c1f81
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41862
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Yu-hsin Wang
2fed34d099 fastmodel: Set simulation pause when breakpoint hit
The 7th parameter of breakpoint_set_code is dontStop. It seems the
fastmodel would prefetch something or do some evaluation ahead with the
flag set. This behavior prevents the instruction stepping feature of
gdb. The implementation of the feature is creating a breakpoint on the
next instruction and contining the simulation. Without stopping on the
breakpoint, it wouldn't invoke the breakpoint callback, since it may
evaulate the code we just want it to stop already. We should set the
dontStop to false to fix this issue.

Change-Id: Iaf8acd3235fa9625c1423ef34606e1fa5d0c531a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55484
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 01:16:20 +00:00
Yu-hsin Wang
52661838a4 ext: upgrade to googletest 1.11.x
Upgrade googletest to 1.11.x
upstream commit: 8306020a3e9eceafec65508868d7ab5c63bb41f7

sha1sum df8cdd26ee7cdf2a3d9c05a92d3630a96f406422 generated by command:
find . -type f ! -name SConscript ! -path "./.*" -print0 \
| sort -z | xargs -0 sha1sum | sha1sum

This upgrade is mainly for providing ConditionalMatcher support.

Change-Id: I27d971c02c59a3ad42c3002f1b4e1a8b18269c56
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55384
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-01-20 01:16:02 +00:00
Matthew Poremba
3ecd28a222 arch-vega: Update FLAT memory access helpers to support LDS
This patch ports the changes from a similar patch for arch-gcn3:
https://gem5-review.googlesource.com/c/public/gem5/+/48343. Vega already
has an helper function to send to the correct pipe depending on the
scope, however the initMem helpers currently always assume global scope.

In addition the MUBUF WBINVL1 instructions are updated similarly to the
GCN3 patch.

Change-Id: I612b9198cb56e226721a90e72bba64395c84ebcd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55465
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-18 15:20:10 +00:00
Matthew Poremba
ff17ecc177 arch-vega: Fix MUBUF out-of-bounds case 1
Ported from https://gem5-review.googlesource.com/c/public/gem5/+/51127:

This patch updates the out-of-bounds check to properly check
against the correct buffer_offset, which is different depending
on if the const_swizzle_enable is true or false.

Change-Id: I9757226e62c587b679cab2a42f3616a5dca97e60
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55464
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-18 15:20:10 +00:00
Matthew Poremba
0cb64ce9f0 arch-vega: Free dest registers in non-memory Load DS insts
Ported from https://gem5-review.googlesource.com/c/public/gem5/+/48019:

Certain DS insts are classfied as Loads, but don't actually go through
the memory pipeline. However, any instruction classified as a load
marks its destination registers as free in the memory pipeline.

Because these instructions didn't use the memory pipeline, they
never freed their destination registers, which led to a deadlock.

This patch explicitly calls the function used to free the destination
registers in the execute() method of those Load instructions that
don't use the memory pipeline.

Change-Id: I8231217a79661ca6acc837b2ab4931b946049a1a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55463
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-17 23:55:51 +00:00
Austin Harris
41ee8ec7d8 mem: implement x86 locked accesses in timing-mode classic cache
Add LockedRMW(Read|Write)(Req|Resp) commands.  In timing mode,
use a combination of clearing permission bits and leaving
an MSHR in place to prevent accesses & snoops from touching
a locked block between the read and write parts of an locked
RMW sequence.

Based on an old patch by Steve Reinhardt:
http://reviews.gem5.org/r/2691/index.html

Jira Issue: https://gem5.atlassian.net/browse/GEM5-1105

Change-Id: Ieadda4deb17667ca4a6282f87f6da2af3b011f66
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52303
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-17 15:15:24 +00:00
Gabe Black
ef4381aecc dev: Refactor how counters are set up in the 8254 timer.
Instead of dynamically allocating the channels, statically allocate them
in a std::array. Also name them "counters" instead of "counter" so that
that variable name can be used for an individual counter.

Change-Id: I49614e192c8201b708e71331e7f70182b47546c6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55284
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-01-16 03:43:58 +00:00
Gabe Black
6f843a918b sim,configs: Default m5ops_base to 0 (disabled) on x86.
This is already the default for other platforms. This is most important
when using KVM, where this mechanism is the only way to trigger pseudo
instructions, or in SE mode to also trigger system calls.

Change-Id: I0094e6814898ba397c7425e0fe76d84853bb17ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52498
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 23:17:31 +00:00
Gabe Black
d3a323a72c arch-x86: Make x86 respect m5op_base in SE mode.
In SE mode, we can reasonably hard code what virtual address the m5ops
show up at since that's private to the process, but we should respect
the external setting of what physical address to use.

Change-Id: I2ed9e5ba8c411e22e1d5163cf2ab875f9e2fe387
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52496
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 12:27:19 +00:00
Gabe Black
1b0852ed30 arch-x86: Bare metal workload.
Change-Id: I9ff6f5a9970cc7af2ba639be18f1881748074777
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45045
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 08:40:06 +00:00
Gabe Black
c2c4303a07 arch-x86: Use 16 bit modRM encoding if address size is 16 bit.
The modRM byte should be interpreted with 16 bit rules if the address
size is 16 bits, whether that's because the address size is that by
default, or because it was overridden. It should not be based on the
operand size in any case.

Change-Id: I8827abe1eea8905b0404f7402fb9531804d63fae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55503
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:59:41 +00:00
Gabe Black
69010fd0c9 arch-x86: Keep all the IOAPIC entries masked at startup.
There are two entities setting up the IOAPIC when the simulation is
started, the IOAPIC itsef, and the PC platform object. It's probably not
a good idea (and definitely confusing) to have this initialization
happening in two places.

For now at least, lets make the PC platform object mask the IOAPIC lines
at startup like the IOAPIC is doing. This will help prevent spurious
interrupts from being delivered to the CPU during startup.

Change-Id: I10f455d8e0fca28ddaf772c224a32c1f5f2dd37b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55452
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:59:25 +00:00
Gabe Black
c17d68f739 arch-x86: In the LVT in the local APIC, start with all entries masked.
This is what the APIC is supposed to look like when coming out of reset.

Change-Id: Ia9b6e13533692109849e729d9ad3b358f36e2e47
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55451
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:59:10 +00:00