Commit Graph

22137 Commits

Author SHA1 Message Date
Erin Le
b9a19625ce stdlib: add SE mode to X86Board
This commit adds SE mode to X86Board. X86DemoBoard was also modified,
as functions that were previously needed to add SE mode to
X86DemoBoard were removed.
2024-10-22 15:01:27 -07:00
Erin (Jianghua) Le
f01d68bf96 stdlib, configs: Add RiscvDemoBoard (#1490)
This PR adds a RiscvDemoBoard that can be used with both SE and FS
mode.This was tested using the workloads riscv-matrix-multiply-run for
SE and riscv-ubuntu-20.04-boot for FS. Two example config scripts have
also been added.
2024-10-22 10:13:22 -07:00
Giacomo Travaglini
3a14a73982 arch-arm: Add support of AArch32 VRINTN/X/A/Z/M/P instructions. (#1655)
Add decoder and function of AArch32 VRINTN, VRINTX, VRINTA, VRINTZ,
VRINTM, and VRINTP (Advanced SIMD) instructions. Support both 16-bit and
32-bit variants.

Add vfpFPRint in vfp.hh to perform the behavior of round-to-integer.

Only support A32 encoding.

Change-Id: Icb9b6f71edf16ea14a439e15c480351cd8e1eb88
2024-10-22 18:37:30 +02:00
Nicholas Mosier
faf764e668 arch-x86: break 32/64-bit LEA's input dependency on prior dest value (#1683)
Fix #1682. Treat LEA as a BigLdStOp. BigLdStOps (as well as other Big*
x86 uops) do not have input dependencies on 32-/64-bit destinations. LEA
will still have input dependencies on 16-bit destinations. (LEA cannot
have an 8-bit destination.)

Change-Id: I5d0678e6bd79bfd6064941a89c6fe290750543c9
2024-10-22 09:34:30 -07:00
Giacomo Travaglini
0f75c39d30 arch-arm: Implement AT as standalone instructions (#1697)
Moving the address translation logic outside of the ISA::setMiscReg will
allow it to return and potentially invoke a fault
upon execution of the AT instruction. This change affects AArch64 mode
only
2024-10-22 17:25:16 +02:00
Harry Chiang
fce42880b9 dev: move dprint of reg name before register read/write (#1684)
Originally, the debug print for read/write to specific register name
will happen after reg.read() and reg.write(). However, there might be
other debug print or warning inside reg.read(), reg.write() which would
be confusing if this debug log happen after all other debug print inside
reg.read(), reg.write().

Creating this commit to change the order.
2024-10-22 10:12:38 +01:00
Matthew Poremba
16217f843f mem-ruby: Fix issues in protocols due to multi-RubySystem (#1690)
Starting with https://github.com/gem5/gem5/pull/1453 , some Ruby
structures require a block size be set
and other require a pointer to the Ruby system. This fixes some cases
which were not covered by the per-checkin tests but seen in daily+
tests. In particular:

 - WriteMasks and PerfectCacheMemory must explicitly set a block size.
 - NetDest and RubyProxyPort require RubySystem pointer.
 - Classes inheriting Message now have a setRubySystem collecting all
   objects that need a RubySystem pointer and this should be called in
   the constructor of the Message.

This commit makes sure all of these happen. This should fix daily
arm_boot_tests and daily learning_gem5 tests.
2024-10-21 12:30:03 -07:00
Bobby R. Bruce
2c679bfa04 tests: Fix replacement_policies tests' refs (#1695)
At some point 'system' -> 'board' in the stdlib code the replacement
policy tests used. Due to this the output is slightly different meaning
the refs need updated.

This was causing the Daily Tests to fail.
2024-10-21 12:28:29 -07:00
Junshi Wang
abf939f880 arch-arm: Improve implementation of AT instructions
Move AT instructions out of setMiscReg.

Modification includes:

- Add template for AT instructions in misc64.isa.
- Add decoder and execution of AT instruction in aarch64.isa and
data64.isa.
- Add AtOp64 and AtOp64Hub to perform the behavior of AT instructions.

Change-Id: I7e8b802421f7335203edb9f8d748ad8669954b8c
2024-10-21 17:32:15 +01:00
Junshi Wang
91c5218f91 arch-arm: Add WnR into the AnnotationIDs.
To force WnR to 1 when cache maintainance and address translation
instruction.

Change-Id: Id8608f655eacb5e3c2eba36da0a31e883c55a641
2024-10-21 17:32:15 +01:00
Bobby R. Bruce
b705629b83 learning-gem5: Add ruby_system param set to RubyPortProxy (#1686)
This missing parameter causing the Learning gem5 tests to fail.

**Note:** We need to update the website's learning gem5 examples to
reflect this change.
2024-10-20 13:04:47 -07:00
Bobby R. Bruce
db47d20371 mem-ruby,misc: Remove redundant assignment (#1685)
This caused a warning to be thrown in Clang 19.
2024-10-20 13:02:53 -07:00
Bobby R. Bruce
644ad3cdb0 misc,tests: Fix incorrect date assignment in Actions 2024-10-18 14:59:16 -07:00
Mahesh Madhav
3e83f3ce4f scons,misc: Portable debug flag generation (#1666)
Modifies union construction in the debug directory so output is more
amenable to alternative compilers. Verified that this change produces
code that builds with clang, gcc, msvc, nvhpc, aocc, icc, openxl, and
cray hpc.

These were the kinds of errors seen in MSVC, which this patch fixes.
```
debug/Decoder.hh(24): error C2461: 'gem5::debug::unions::Decoder': constructor syntax missing formal parameters
debug/Decoder.hh(31): error C7624: Type name 'gem5::debug::unions::Decoder' cannot appear on the right side of a class member access expression
```
2024-10-18 14:39:09 -07:00
Bobby R. Bruce
b836a3f239 tests: update input sizes for pannotia tests (#1631)
This PR addresses comments from #1584 

- removed tests using the same binary multiple times. Each binary is
tested once with one graph
- Updated the input sizes as per the comments in the above mentioned PR
2024-10-18 13:42:30 -07:00
Bobby R. Bruce
ddaf70b64f Merge branch 'develop' into update-pannotia-tests 2024-10-18 13:40:59 -07:00
Giacomo Travaglini
2e271459d0 mem-cache: Implementation of SMS prefetcher (#1454)
This PR adds the SMS prefetcher described in [this
](https://web.eecs.umich.edu/~twenisch/papers/isca06.pdf) paper.
This work was done in collaboration with @Setu-Gupta, and @xmlizhao

On branch sms
Changes to be committed:
modified: src/mem/cache/prefetch/Prefetcher.py
modified: src/mem/cache/prefetch/SConscript
new file: src/mem/cache/prefetch/sms.cc
new file: src/mem/cache/prefetch/sms.hh

Change-Id: I68d3bb6cf07385177d0f776fb958f652cfc41489
2024-10-18 19:15:57 +02:00
Harshil Patel
ae56a31b21 tests: Download only the resources used in ponnotia tests 2024-10-18 17:12:43 +00:00
handsomeliu-google
3fc6cc7763 sim: Make SignalSinkPort::set virtual (#1679)
We are implementing derived classes of SignalSinkPort that does some
additional logic after it's triggered (set() invoked by SignalSourcePort
peer), and before executing the callback that a device provides (in
onChange_). The logic is like additional logging, or providing debugging
features. However, set() itself directly calls the onChange_ callback.

Making the set() virtual could provide the flexibility to achieve this
feature.
2024-10-18 05:41:05 -07:00
Pranith
ae0cee66ed systemc: Disable 'overloaded-virtual' warn for clang (#1662)
We need to extend the warning disable even for clang compiler.

Fixes #1658
2024-10-18 05:40:10 -07:00
Harshil Patel
946bf83b75 arch-arm: Add arm demo board (#1478)
This demo board is a preset arm board, that can be used to run example
gem5 simulations. This board doesnt simulate any known hardware.

The board will be used to run benchmarks such as gapbs and npb to
collect stats. The plan is to show these stats on the gem5 resources
website to provide more details about the resources.
2024-10-18 05:36:31 -07:00
Bobby R. Bruce
cb5d14f753 arch-riscv: Implement Zcmp instructions (#1432)
1. Implement Zcmp(cm.push, cm.pop, cm.popret, cm.popretz, cm.mva01s,
cm.mvsa01) instructions

2. The Zcd instructions overlap the Zcmp and Zcmt instruction. This
option is used to enable/disable Zcd extension, implies enable Zcmp/Zcmt
extension. If Zcd is enable, the Zcmp and Zcmt is disabled. Otherwise,
Zcmp and Zcmt is enabled.

Spec: https://github.com/riscv/riscv-isa-manual/blob/main/src/zc.adoc
2024-10-18 05:33:55 -07:00
Harshil Patel
7591f2a843 tests: Fix compiler tests (#1678)
- This change updates syntax of constructors of Template Classes from
`class<T>()` to `class()`

- Initializes coherence to 0 in `src/mem/cache_blk.hh`

The above changes are made to solve the errors when compiling gem5 in
gcc 14
2024-10-17 11:19:46 -07:00
Bobby R. Bruce
d454e421d2 stdlib,arch-x86: Update X86Demoboard (#1618)
This commit modifies X86DemoBoard so it has numbers more similar to that
of RiscvDemoBoard and ArmDemoBoard. It also adds SE mode to
X86DemoBoard. Note that the changes here depend on the changes in PR
1579.

**Note**: This PR was created so @BobbyRBruce could add his commits to
#1600

---------

Co-authored-by: Erin Le <ejle@ucdavis.edu>
2024-10-17 10:29:17 -07:00
Bobby R. Bruce
0341c5a502 SE script and tests for risc-v's vector extension (#1542)
This two commits add the SE config and test script, respectively, to run
the rvv tests mentioned in #1246.
2024-10-17 10:26:30 -07:00
Jason Lowe-Power
f55a4ce989 arch-x86,arch-arm: Remove static variables in decoders (#1643)
There were a number of variables in the arm and x86 decoders that are
static (e.g., the decode cache). It's a bit interesting that this
doesn't cause problems with multiple cores since each core has its own
decoder.

However, this causes segfaults if you run different cores on different
*host* threads. We are experimenting with running gem5 with multiple
host thread (i.e., in parallel), and removing these static variables
resolves the segfault.

This change also adds const to any other static variables to ensure that
they cannot be modified.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-10-17 08:17:34 -07:00
Abhishek Shailendra Singh
cf3427f87b mem-cache: refactored the code 2024-10-17 17:13:37 +02:00
pre-commit-ci[bot]
bd939821c8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-17 17:13:37 +02:00
Abhishek Shailendra Singh
3eabd02801 mem-cache: This commit adds sms prefetcher
Change-Id: I68d3bb6cf07385177d0f776fb958f652cfc41489
2024-10-17 17:13:37 +02:00
Roger Chang
a6421e4404 arch-riscv: Add IsDelayedCommit for each zcmp micro instructions 2024-10-17 13:29:38 +08:00
Roger Chang
28b112e2a6 arch-riscv: Implement Zcmp
Implement instructions:
cm.push
cm.pop
cm.popret
cm.popretz
cm.mva01s
cm.mvsa01

Spec: https://github.com/riscv/riscv-isa-manual/blob/main/src/zc.adoc#zcmp

Change-Id: I2921c4bdb0c654858a237386056ebb2aed643a5a
2024-10-17 13:29:38 +08:00
Roger Chang
aa782cffee arch-riscv: Add enable_Zcd options to RiscvISA
The Zcd instructions overlap the Zcmp and Zcmt instruction

This option is used to enable/disable Zcd extension, implies enable
Zcmp/Zcmt extension. If Zcd is enable, the Zcmp and Zcmt is disabled.
Otherwise, Zcmp and Zcmt is enabled.

Spec: https://github.com/riscv/riscv-isa-manual/blob/main/src/zc.adoc#zc-overview

Change-Id: I3788eb6539e13a210c9946efc43ca1fef4639560
2024-10-17 13:29:38 +08:00
Matthew Poremba
deb8f983a1 arch-vega: Fix multi-dword setElem in PackedReg (#1664)
There are two issues related to setting an element in PackedReg where
the element spans multiple dwords. First, the mask value is wrong and is
clobbering both dwords. Second, a portion of the value is shifted out of
the narrower input type.

Fix this by using the correct mask to clear the bits where the value
will be placed and use a larger data type to shift the value into place.
2024-10-14 10:19:52 -07:00
Ivana Mitrovic
20965f571b stdlib: Extend AbstractBoard pre_instantiation functionality (#1497)
* Deprecates the setting of FS/SE mode via the `Simulator` module.
* Moved the creation of the `Root` object from the `Simulator` to the
board.
* Moved the setting of `sim_quantum` from the `Simulator` to the
processor.
* Allows for easier development of boards which support both SE and FS
mode simulation by moving board setup function calls to occur after the
set_workload function is call which sets a boards stats `is_fs` status.
2024-10-14 10:12:41 -07:00
Leon
652a72d122 arch-riscv: Add support for riscv hardware probing syscall (#1525)
This PR adds the support for riscv hardware probing syscall described in
[this](https://docs.kernel.org/arch/riscv/hwprobe.html). The
implementation logic refers to [linux
kernel](https://github.com/torvalds/linux/blob/master/arch/riscv/kernel/sys_hwprobe.c)
and
[qemu](https://github.com/qemu/qemu/blob/master/linux-user/syscall.c).
And passed the [RISC-V hwprobe
exmaple](https://github.com/cyyself/hwprobe) test.

Hope to be merged. Thanks.

Change-Id: Iab714974f0551fc451e0d6846c75a7153809a308

Co-authored-by: Zhibo Hong <hongzhibo@bytedance.com>
2024-10-14 10:00:48 -07:00
Matthew Poremba
1edeeda881 dev: Make unknown PCI device writes a warning (#1657)
This pops up in kernel 6.8.0. The device it is trying to write is
currently unknown but does not cause problems ignoring the device,
therefore change the panic to a warning and responding to the request
with the default PCI latency.

Change-Id: I4c1229753a75a94a255d8cfd411ac7311283366b
2024-10-14 08:51:05 -07:00
Saúl Adserias
f4ffe5f815 tests: add rvv-intrinsic-tests script and config
Change-Id: Ia3fa67bb2a2603dd5cbf665504f85a8b969c2a5e
2024-10-11 17:42:51 +02:00
Saúl Adserias
a35f146ba2 configs: add example RVV SE parametrized config
Change-Id: I0776c5751da8b80340166ab518593686d141a4dd
2024-10-11 17:32:09 +02:00
Bobby R. Bruce
a8f88abfb1 misc: Add 'ext' & 'tests' to vscode pythin extraPaths (#1652)
'ext' is set as a Python source path for gem5, like 'src/python'. It
helps vscode users to have vscode aware of this to better analytics and
reduce warnings (most comminly "unable to resolve import).

'tests' isn't in the Python source path when compiling gem5 but it is
when running `tests/main.py`. Though somewhat unideal as is lets vscode
think files in 'src' can import from files in 'test', adding this helps
vscode Python analytics parse the test files which reduces warnings and
aids in betters navigation of the testing code. This is particularly
helpful given the complexity of the testlib testing infrastructure.
2024-10-10 10:18:14 -07:00
Bobby R. Bruce
65ba2dcae5 tests: Refactor downloading of pannotia tests (#1653)
With this patch the pannotia tests now:

1. Download the resources to 'gpu-pannotia' in the
'tests/gem5/resources' directory. This is where other test resources are
store.
2. Download thr USA-road-d.NY.gr dataset from Google cloud bucket in a
decompressed state.
2. Avoid re-download the resources if they are already present on the
host machine.
2024-10-10 10:17:32 -07:00
Erin (Jianghua) Le
6195b33960 util-docker,tests: Add compiler tests & Dockerfiles for GCC 14 (#1646)
This commit adds gcc 14 to the compiler tests and Dockerfiles.
2024-10-10 10:17:03 -07:00
Bobby R. Bruce
c1c5147e53 tests,misc: Remove edited from PR Action trigger list (#1654)
`edited` is what forces a re-run of our tests when the PR title is
updated and other minor metadata stuff. I believe all changes to the
code are covered by the remainder. `synchronize` is means the PR is
triggered with the when the this PR is from (in this case my forked gem5
repo) is synced with the PR branch here. This covers the vast majority
of cases we care about. `opended` covers for the case where the PR is
created and `ready_for_review` for when something moves out of a draft.
2024-10-10 10:13:56 -07:00
Jason Lowe-Power
3f42ab4ca9 stdlib,ruby: Enable resetting version numbers (#1649)
Ruby requires each machine type to have a continuous set of version
numbers starting at 0. We were hiding this from users/developers by
using a Python class variable in the stdlib. Unfortunately, with
multiple ruby systems this doesn't work anymore.

As a stop-gap this change adds "resetting" these versions to the
beginning of `incorporate_caches`. It would be better to fix this in the
C++ code (and assign these numbers in C++ probably via the RubySystem),
but that's a bigger change than is needed right now.

---------

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-10 09:53:40 -07:00
Pranith
50f652a2ee Implement BTB using the cache library (#1537)
This enables the BTB to be associative and use various replacement
policies.
2024-10-10 17:05:22 +01:00
Junshi Wang
7df35187a0 arch-arm: Add support of AArch32 VRINTN/X/A/Z/M/P instructions.
Add decoder and function of AArch32 VRINTN, VRINTX, VRINTA, VRINTZ,
VRINTM, and VRINTP (Advanced SIMD) instructions. Support both 16-bit and
32-bit variants.

Add vfpFPRint in vfp.hh to perform the behavior of round-to-integer.

Only support A32 encoding.

Change-Id: Icb9b6f71edf16ea14a439e15c480351cd8e1eb88
2024-10-10 12:08:15 +01:00
Giacomo Travaglini
1c8ab47a54 arch-arm: Add support of AArch32 VCVTA/P/N/M instructions. (#1533)
Add decoder and function of AArch32 VCVTA, VCVTP, VCVTN and VCVTM
instructions. Support both 16-bit and 32-bit variants.

Only support A32 encoding.

Change-Id: I6ece0e1b779f9a7cc9d709894a49a7fdcda28373
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-10 11:58:37 +02:00
Erin (Jianghua) Le
feeb3b2d67 cpu: fix simInsts and simOps not resetting (#1615)
This PR fixes the bug where simInsts and simOps don't reset when
m5.stats.reset() is called. The stats hostInstRate and hostOpRate are
affected by this change as well, as they depend on simInsts and simOps
respectively.

This is related to issue 1443 linked
[here](https://github.com/gem5/gem5/issues/1443).
2024-10-09 19:49:43 -07:00
Bobby R. Bruce
3443788013 misc: Add "src/python" to vscode Python Analysis Paths (#1647)
This allows vscode to resolve python imported from "src/python".
Warnings regarding these imports are numerous and the issue stops users
of vscode to utilizubg features like navigating the codebase though "Go
to Definition" queries on imported classes/functions.
2024-10-09 14:46:54 -07:00
Bobby R. Bruce
965da9ea79 misc: pre-commit autoupdate (#1642)
<!--pre-commit.ci start-->
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 →
v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v5.0.0)
- [github.com/PyCQA/isort: 5.11.5 →
5.13.2](https://github.com/PyCQA/isort/compare/5.11.5...5.13.2)
- [github.com/psf/black: 23.9.1 →
24.10.0](https://github.com/psf/black/compare/23.9.1...24.10.0)
- [github.com/asottile/pyupgrade: v3.14.0 →
v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.14.0...v3.17.0)
<!--pre-commit.ci end-->
2024-10-09 14:46:20 -07:00
Jason Lowe-Power
f03dddb458 Use board get_mem_ports consistently (#1509)
Previously, whether the board object or the memory_system returned
the memory ports was not consistent in the cache_hierarchies

This commit makes it consistently use the board. Note: the board
is a better place so it can customize the ports (e.g., add I/O
components or other things.

This commit also makes the arm board consistent with the other
boards and removes the specialized `get_mem_ports` that was not
used.
2024-10-09 13:21:28 -07:00