Commit Graph

22075 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
7661116b00 misc: [pre-commit.ci] pre-commit autoupdate
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)
2024-10-09 07:03:42 -07:00
Matthew Poremba
4f7b3ed827 mem-ruby: Remove static methods from RubySystem (#1453)
There are several parts to this PR to work towards #1349 .

(1) Make RubySystem::getBlockSizeBytes non-static by providing ways to
access the block size or passing the block size explicitly to classes.

The main changes are:
 - DataBlocks must be explicitly allocated. A default ctor still exists
   to avoid needing to heavily modify SLICC. The size can be set using a
   realloc function, operator=, or copy ctor. This is handled completely
   transparently meaning no protocol or config changes are required.
 - WriteMask now requires block size to be set. This is also handled
   transparently by modifying the SLICC parser to identify WriteMask
   types and call setBlockSize().
 - AbstractCacheEntry and TBE classes now require block size to be set.
   This is handled transparently by modifying the SLICC parser to
   identify these classes and call initBlockSize() which calls
   setBlockSize() for any DataBlock or WriteMask.
 - All AbstractControllers now have a pointer to RubySystem. This is
   assigned in SLICC generated code and requires no changes to protocol
   or configs.
 - The Ruby Message class now requires block size in all constructors.
   This is added to the argument list automatically by the SLICC parser.
   
(2) Relax dependence on common functions in
src/mem/ruby/common/Address.hh
so that RubySystem::getBlockSizeBits is no longer static. Many classes
already have a way to get block size from the previous commit, so they
simply multiple by 8 to get the number of bits. For handling SLICC and
reducing the number of changes, define makeCacheLine, getOffset, etc. in
RubyPort and AbstractController. The only protocol changes required are
to change any "RubySystem::foo()" calls with "m_ruby_system->foo()".

For classes which do not have a way to get access to block size but
still used makeLineAddress, getOffset, etc., the block size must be
passed to that class. This requires some changes to the SimObject
interface for two commonly used classes: DirectoryMemory and
RubyPrefecther, resulting in user-facing API changes

User-facing API changes:
 - DirectoryMemory and RubyPrefetcher now require the cache line size as
   a non-optional argument.
 - RubySequencer SimObjects now require RubySystem as a non-optional
   argument.
 - TesterThread in the GPU ruby tester now requires the cache line size
   as a non-optional argument.

(3) Removes static member variables in RubySystem which control
randomization, cooldown, and warmup. These are mostly used by the Ruby
Network. The network classes are modified to take these former static
variables as parameters which are passed to the corresponding method
(e.g., enqueue, delayHead, etc.) rather than needing a RubySystem object
at all.

Change-Id: Ia63c2ad5cf0bf9d1cbdffba5d3a679bb4d3b1220

(4) There are two major SLICC generated static methods:
getNumControllers()
on each cache controller which returns the number of controllers created
by the configs at run time and the functions which access this method,
which are MachineType_base_count and MachineType_base_number. These need
to be removed to create multiple RubySystem objects otherwise NetDest,
version value, and other objects are incorrect.

To remove the static requirement, MachineType_base_count and
MachineType_base_number are moved to RubySystem. Any class which needs
to call these methods must now have a pointer to a RubySystem. To enable
that, several changes are made:
 - RubyRequest and Message now require a RubySystem pointer in the
   constructor. The pointer is passed to fields in the Message class
   which require a RubySystem pointer (e.g., NetDest). SLICC is modified
   to do this automatically.
 - SLICC structures may now optionally take an "implicit constructor"
   which can be used to call a non-default constructor for locally
   defined variables (e.g., temporary variables within SLICC actions). A
   statement such as "NetDest bcast_dest;" in SLICC will implicitly
   append a call to the NetDest constructor taking RubySystem, for
   example.
 - RubySystem gets passed to Ruby network objects (Network, Topology).
2024-10-08 08:14:50 -07:00
Giacomo Travaglini
4a3e2633d2 cpu-o3: Add Matrix OpDesc to the O3 Default FU (#1640)
There was a bug exposed by a recent PR [1] where until recently the O3
CPU was executing an instruction even if it did not have the required
functional unit in the FU pool.

We are adding the matrix descriptors to the Default FU pool in the O3
cpu so that no panic is encountered upon executing of a matrix
instruction

[1]: https://github.com/gem5/gem5/pull/1516

Change-Id: I04250255a2cbb2ee6f3ef204b62bc2c1ee2d4d2c

Reviewed-by: Richard Cooper <richard.cooper@arm.com>

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-08 10:23:14 +01:00
Giacomo Travaglini
440999e447 cpu-o3: Add Crypto OpDesc to the O3 Default FU (#1639)
There was a bug exposed by a recent PR [1] where until recently the O3
CPU was executing an instruction even if it did not have the required
functional unit in the FU pool.

We are adding the crypto descriptors to the Default FU pool in the O3
cpu so that no panic is encountered upon executing of a crypto
instruction

[1]: https://github.com/gem5/gem5/pull/1516

Change-Id: Ifaf2f8e4780dfb8ba825a99a02dd587f011dbd23

Reviewed-by: Richard Cooper <richard.cooper@arm.com>

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-08 10:22:25 +01:00
Bobby R. Bruce
3fc21da13c learning-gem5,tests: Update learning-gem5 Ruby Test ref (#1635)
The Daily tests have been failing as the learning-gem5 Ruby test now
exits at tick 9831 instead of tick 9981.

**Note**: The cause of this change is currently unknown. I'm not sure if
this is symptomatic of something bigger but for now I only observe this
bug failure and this patch at least silences the error.
2024-10-07 14:40:45 -07:00
Jason Lowe-Power
6ff3821c9d arch-riscv: Enable clone3 syscall in riscv64 (#1620)
The clone3 syscall, implemented in commit 87e774c, is currently only
handled for x86-64 in gem5 SE mode. Clone3 is employed by modern glibc
versions instead of clone for processes/threads generation (e.g. issue
#1204). This commit enables the clone3 syscall in riscv64 by adding the
corresponding handler call, as well as its arguments struct.
2024-10-07 13:45:34 -07:00
Erin (Jianghua) Le
1ee924a067 python: clarify SimObject error message (#1625)
This adds more detail to the error message that is thrown when an orphan
node is instantiated.
2024-10-07 13:45:03 -07:00
Matthew Poremba
f5858fe81f dev-amdgpu: Deprecate rom and mmio trace params (#1633)
The ROM field was originally intended as a future alternate way to load
VBIOS without the ROM being on the disk image. This code path is never
taken for the devices gem5 supports and there is no gem5 implementation.
Deprecate the rom_binary field for this reason.

Similarly, MMIO traces were only used for Vega10. Deprecate this as
Vega10 is now deprecated. The MMIO trace reader is kept as it may still
be useful in the future. It is still the primary way to handle devies
which have graphics capability. None of the devices supported by gem5
have graphics now that Vega10 is deprecated.
2024-10-07 07:12:07 -07:00
Bobby R. Bruce
5db68114df misc,tests: Change Github Action caches to just be date-based
Hashing the `src` directory is too costly, with some runners reaching
timeout. Also, as we only have 10GB of cache it makes sense to have
more course grained caching
2024-10-07 00:53:08 -07:00
Bobby R. Bruce
6a24b69a97 misc,tests: Increase Weekly and Daily GPU test timeout (#1628)
The Weekly GPU tests are failing due to a timeout, but I found the
testing timeout was set to 5 hours, and we have been frequently close to
reaching this but have recently changed the test enough to consistently
go over.

 The main two things that appear to have caused this are:

~~1. Moving the X86_VEGA compilation into the same step as the running
of the tests.~~ (I take this back, the timeout is per-job, it shouldn't
matter how stuff is deivided among steps in the job. However, keeping it
separate does no harm and merging the two steps did coincide with
failures occurring. I'll play it safe for now_.
2. Reducing the number of threads per GitHub Actions runner, thus
slowing job execution.

In addition, we've added more tests to this weekly GPU suite, though I
don't believe we have got to running these tests yet. The timeout
appears to always have been triggered before this.

This PR increases the timeout to 3 days and moves the compilation into a
separate step.

**Update: Same changes done for Daily tests too as it appears to be the
same problem.
2024-10-04 07:41:17 -07:00
Bobby R. Bruce
d49d0272ff misc,tests: Create Daily GPU Test timeout 2024-10-04 07:36:46 -07:00
Bobby R. Bruce
866b51a1cc misc,tests: Increase Weekly GPU test timeout
The Weekly GPU tests are failing due to a timeout but I found the testing
timeout was set to 5 hours and  we have been frequently close to reaching this
but have recently changes the test enought o consistently go over.

 The main two things that appear to have caused this are:

1. Moving the X86_VEGA compilation into the the same step as the running of
   the tests.
2. Reducing the number of threads per GitHub Actions runner, thus slowing
   job execution.

In addition we've added more tests to this weekly GPU suite though I don't
believe have got to running these tests yet. The timeout appears to
always been triggered before this.

This PR increases the timout to 3 days and moves the compilation into a
seperate step.
2024-10-04 06:12:13 -07:00
Bobby R. Bruce
7117b1399b util-docker: Fix gpu dpcker images (#1627)
Two faults:

1. You can't give description the docker-bake file for single platform
builds. They must be in the Dockerfile..
2. The gpu docker image def in docker-bake.hcl was not overriding the
"common" setttings as previously thought. This was causing builds to
something build the wrong platform and vairous other weird bugs. This
has been fixed in this patch.
2024-10-04 02:37:16 -07:00
Yu-Cheng Chang
5b5f7afc1b arch-riscv: Implement CLINT reset feature (#1617)
When reset, registers are change
msip: cleared to zero
mtimecmp: unknown state, cloud be origin values or change to any values
mtime: cleared to zero

Spec:
https://github.com/riscv/riscv-aclint/blob/main/riscv-aclint.adoc
https://sifive.cdn.prismic.io/sifive/1a82e600-1f93-4f41-b2d8-86ed8b16acba_fu740-c000-manual-v1p6.pdf

Change-Id: I3c50b41eb765ad9cd7a8a03c427bd0011195de5c
2024-10-03 13:22:27 -07:00
Matthew Poremba
24504c9a3e dev-amdgpu: Use GPU specific cache line size (#1621)
Invalidate requests align to system cache line size. This causes
problems if the GPU cache hierarchy's cache line size is different than
the system as the unlaigned requests never return, leading to deadlock
on deferred dispatch.

This commit uses the cache line size from the GPU memory manager and
makes the cache line size there non-optional.

Tested with multiple RubySystems where CPU side was 64B and GPU side was
128B cache lines.
2024-10-03 08:47:08 -07:00
Tommaso Marinelli
242c0e9693 arch-riscv: Add more syscall placeholders 2024-10-03 03:25:39 +02:00
Matthew Poremba
c8c75959ad configs: Deprecate Vega10 (#1619)
Vega10 is no longer officially supported by ROCm and ROCm is starting to
use some packet types not supported. These were originally kept to allow
users to use older disk images with newer gem5. Going forward the gem5
version and gem5-resources releases will be required to be the same to
prevent lingering old configs.

As a replacement for vega10*.py, mi300.py or mi200.py should be used.
HIP examples, cookbook, and rodinia configs can be replaced with the
standard flow of building / obtaining the GPU application and running
using mi300.py or mi200.py as they do not require any input options and
therefore do not require changes to the disk image.
2024-10-02 14:18:41 -07:00
Tommaso Marinelli (imec)
be49bf89c0 arch-riscv: Enable clone3 syscall in riscv64
The clone3 syscall, implemented in commit 87e774c, is currently only
handled for x86-64 in gem5. Clone3 is employed by modern glibc versions
instead of clone for processes/threads generation (e.g. issue #1204).
This commit enables the clone3 syscall in riscv64 by adding the
corresponding handler call, as well as its arguments struct.
2024-10-02 18:23:27 +02:00
Giacomo Travaglini
bdd10069b1 arch-arm: Add recursive reduce in Neon instruction. (#1616)
FMAXV, FMINV, FMAXNMV, FMINNMV and ADDV instructions perform recursive
reduction. Different reduction methods lie to different result when
handle NaN values.

Reuse the template of `twoRegAcrossInstX`. Add one more option
`recursive` for recursive reduction.

Change-Id: I69e690ce7668baee818542d3ea463f7a5f269a69
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-02 12:41:53 +02:00
Bobby R. Bruce
c9408828a1 misc,tests: Revert "Test docker runners vs self-hosted"
This reverts commit 0792d94b6f.
2024-10-01 16:03:57 -07:00
LYC
93313b3daa arch-riscv: fix viota (#1559)
This commit fixs a bug in the viota instuction.

The two different instructions can be referenced to the same
StaticInstPtr because the decoder behaves as shown in [the section of
the
code](https://github.com/gem5/gem5/blob/stable/src/arch/riscv/decoder.cc#L98-L100).

So every first micro-op should reset the cnt variable in the macro-op.

Change-Id: Id311a05cfed41b01e16fd7256d9baa166aee49da

Co-authored-by: Jack Yung-Chen Lin <jack622@andestech.com>
2024-10-01 11:23:27 -07:00
Erin (Jianghua) Le
d5dfe03eb1 stdlib: Add warning message for set_workload being called twice (#1571)
This commit adds a warning message for when set_workload is called
twice, as users typically do not mean to do this.
2024-10-01 11:22:07 -07:00
Erin (Jianghua) Le
c10feed524 tests, configs, util, mem, python, systemc: Change base 10 units to base 2 (#1605)
This commit changes metric units (e.g. kB, MB, and GB) to binary units
(KiB, MiB, GiB) in various files. This PR covers files that were missed
by a previous PR that also made these changes.
2024-10-01 11:18:05 -07:00
Kaustav Goswami
d57208c615 arch-x86,stdlib: added MADT entries on the X86Board (#1574)
This change adds MADT entries to the X86Board. Previously, the kernel in
full-system mode was complaining about a `ACPI BIOS Error (bug): Invalid
table length 0x24 in RSDT/XSDT (20190816/tbutils-291)`. This patch fixes
the invalid length and initializes all the tables correctly.

Signed-off-by: Kaustav Goswami <kggoswami@ucdavis.edu>
2024-10-01 11:14:09 -07:00
Bobby R. Bruce
0792d94b6f misc,tests: Test docker runners vs self-hosted 2024-10-01 08:53:31 -07:00
Bobby R. Bruce
34f6bc4501 misc,tests: Fix caching in daily tests 2024-10-01 08:18:55 -07:00
Junshi Wang
a25d9a126f arch-arm: Add recursive reduce in Neon instruction.
FMAXV, FMINV, FMAXNMV, FMINNMV and ADDV instructions perform recursive
reduction. Different reduction methods lie to different result when
handle NaN values.

Reuse the template of `twoRegAcrossInstX`. Add one more option
`recursive` for recursive reduction.

Change-Id: I69e690ce7668baee818542d3ea463f7a5f269a69
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-09-30 16:31:35 +01:00
Giacomo Travaglini
8381e1c5d3 mem-cache: Helper functions to allow dynamic configuration of partitioning policies (#1609)
This PR is doing a simple refactoring of some partitioning policies. It
moves existing functionalities
within PP methods so that they can be called multiple times throughout
the simulation.
Therefore allowing a dynamic adjustment of the partitioning scheme
2024-09-27 00:01:18 +02:00
Bobby R. Bruce
277b5be4dd arch-arm: Add a method to determine External Abort (#1610)
- Add `isExternalAbort()` in `AbortFault<T>` to determine external
abort.
- Add `virtual isExternalAbort()` in `ArmFault` so the method can be
used in base class.
- Set iss.ea by `isExternalAbort()`
2024-09-26 14:41:33 -07:00
Erin (Jianghua) Le
e987c60a4c tests: Add Pannotia GPU Tests (#1584)
This PR adds the Pannotia GPU tests.
2024-09-26 14:39:39 -07:00
Bobby R. Bruce
054790ad47 ext: Fix GCC v13+ comp of systemc due to problematic overloaded-virtual warn (#1576)
Fixes #1121 in line with the following suggesting:

https://github.com/gem5/gem5/issues/1121#issuecomment-2352743409
2024-09-26 14:32:20 -07:00
Bobby R. Bruce
a240ff8d32 misc,tests: Fix caching in daily tests 2024-09-26 11:12:52 -07:00
Bobby R. Bruce
e3fd7dcaec misc,tests: Remove cache store from dramsys test 2024-09-26 11:10:32 -07:00
Ivana Mitrovic
6bb1c9638c util: Update gem5-resources-manager (#1604)
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.4
to 43.0.1.
2024-09-26 10:09:38 -07:00
Junshi Wang
a4bacb9823 arch-arm: Add a method to determine External Abort.
- Add `isExternalAbort()` in `AbortFault<T>` to determine external abort.
- Add `virtual isExternalAbort()` in `ArmFault` so the method can be
used in base class.
- Set iss.ea by `isExternalAbort()`.

Change-Id: I01c22dc46958ab424b389af96d3c3b6243cbc671
2024-09-26 14:05:09 +01:00
Junshi Wang
9a7a661c66 arch-arm: Set tranMethod for external Data Abort.
The External Data Abort may not set TranMethod, and it leads to assert
error.

- Make `ArmFault::update` virtual.
- Implement override `update` in `AbortFault<T>` to set TranMethod.

Change-Id: I49e18799df8420b214b6059ffa756a13edf343d5
2024-09-26 14:04:17 +01:00
Giacomo Travaglini
b232204b49 mem-cache: Allow dynamic configuration of the Way pp
Change-Id: I1ba9266b24ebc9563f9380fcf155cdc436b2e376
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-09-26 10:21:46 +01:00
Giacomo Travaglini
fdcfc28cf4 mem-cache: Allow dynamic configuration of MaxCapacity pp
This will allow gem5 to configure the maximum capacity of a
partition dynamically during simulation, rather than
having it statically defined at construction time

Change-Id: Ib55c9990a6bc2930abaf2438c13337acc643520f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-09-26 10:21:21 +01:00
Giacomo Travaglini
3100418fb1 mem-cache: Store totalBlockCount directly in MaxCapacity pp
In this way we actually need to store one unsigned integer instead of
two. We also won't need to recompute the total number of cache blocks
whenever we will adapt this policy to be dynamically modified

Change-Id: Ia8cf906539d1891b6cdb821f2a74628127dc68c6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-09-26 10:20:57 +01:00
Ronchi1997
e17875b7c7 misc: Correctly display build information (#1603)
See: #1591

Co-authored-by: Ronchi <ronchi@qq.com>
2024-09-25 14:23:51 -07:00
aperais
36264938db misc: Make random gen portable across compilers. (#1580)
Replace std::uniform_*_distribution by custom code
to make random number generation in gem5 portable across
compilers.

Of note, FP random number generation was not uniformly
distributed, and this PR does not fix that issue.

Thanks to Chandana S. Deshpande (deshpande.s.chandana@gmail.com)
for uncovering the issue.

Co-authored-by: Arthur Perais <arthur.perais@univ-grenoble-alpes.fr>
2024-09-25 07:31:00 -07:00
Saúl
d1ce4fb6c7 arch-riscv: add VLEN/ELEN as class attributes for all vec insts (#1538)
This refactor attempts to homogenize all riscv's vector (macro/micro)
instruction classes so that ELEN and VLEN are guaranteed to be a class
attribute. Since both are constant, all instructions will get it on the
decoding process passed through to their vector base class.

This allows the removal of VLEN in the PC state and also in some
constructor default parameters (solves issue #1207).

Change-Id: I6f0471004335f49b00b015c37e95dc7f9569e303
2024-09-24 14:32:37 -07:00
Yu-Cheng Chang
e9ea18000d arch-riscv: Move static GDB methods to RemoteGDB virtual methods (#1590)
Move getRvType & getPrivilegeModeSet static methods into
RiscvISA::RemoteGDB virtual methods allows the derived
RiscvISA::RemoteGDB to override it without change a lot of methods in
base methods

Change-Id: I3cbb9cf1fdee4a298e903bb4a0a5683c042b749d
2024-09-24 07:46:56 -07:00
Bobby R. Bruce
2fc44a50f8 gpu-compute: Fix '64kB' to '64KiB' in gpu-compute (#1594)
64kB, in these cases, will cast to 64KiB regardless. To improve
readability and understanding of these objects, this patch changes there
SI Prefix (kB -> KiB).
2024-09-23 15:25:43 -07:00
Bobby R. Bruce
d74d550af4 misc,tests: Improve daily cache handling. 2024-09-23 14:20:29 -07:00
Bobby R. Bruce
6af68bcf81 tests,misc: Update weekly/daily caches 2024-09-23 13:16:01 -07:00
Bobby R. Bruce
5214c8b0cb misc, tests: Add missing build/ALL cache in daily-tests.yaml 2024-09-23 12:05:42 -07:00
Bobby R. Bruce
162ea1fa74 tests,misc: Add caching to daily and weekly test workflows 2024-09-23 12:01:57 -07:00
Bobby R. Bruce
1a637e6d94 tests: test_requires.py moved to very-long and drop risv
This test required a lot of compilation for what it does. It is now moed
to very-long/weekly and riscv has been dropped as arm and x86 are
sufficient.
2024-09-23 11:34:14 -07:00
Bobby R. Bruce
87daf94c0e tests: 'NULL_MI' -> 'NULL' in test_replacement_policies.py
NULL already compiled to include the MI protocol. This explicit
declaration causes compilation of another binary which is not required.
2024-09-23 11:34:14 -07:00