Commit Graph

21947 Commits

Author SHA1 Message Date
Erin Le
e1db67c4bd configs, dev, learning-gem5, python, tests: more clarification
This commit contains the rest of the base 2 vs base 10 cache/memory
size clarifications. It also changes the warning message to use
warn(). With these changes, the warning message should now no
longer show up during a fresh compilation of gem5.

Change-Id: Ia63f841bdf045b76473437f41548fab27dc19631
2024-08-23 18:02:42 -07:00
Erin Le
28453a0e3e python: add warning message for conversion from base 10 to base 2
This commit adds a warning message for when cache or memory sizes
will be automatically converted from metric units (e.g. kB) to
binary units (e.g. KiB).

Change-Id: I4ddf199ff2f00c78bbcb147e04bd88c496fa16ae
2024-08-23 18:02:42 -07:00
Erin Le
70c8081107 stdlib: Clarify power of 2 vs power of 10
This commit changes files in src/python/gem5 so that memory and
cache sizes use "KiB", "MiB", and "GiB" instead of "KB", etc. This
makes the codebase more consistent, as gem5 will automatically
convert memory and cache sizes that are in metric units (KB) to
binary units (KiB).

Change-Id: If5b1e908ddcff7182b71e789229a3ba1fa6ad1f1
2024-08-23 18:02:42 -07:00
Giacomo Travaglini
fec28e466e base, mem-cache: Make the AssociativeCache more generic (#1446)
This PR implements #1429. It mainly achieve so with the following
changes

1) The IndexingPolicy is now a templated SimObject to make its APIs work
with different data types.
As an example, look at the getPossibleEntries, which is requiring an
Addr object whereas we want to be able to call the method with different
keys depending on the Tag
2) The AssociativeCache extracts type information from the Entry
template parameter.
This means any AssociativeCache entry will have to define the following
types:

KeyType = This is the data type used for lookups (in its simplest case,
it is Addr)
IndexingPolicy = This is the base indexing policy SimObject

As an example, the PR is also reworking the TaggedEntry to be
AssociativeCache compliant. This
ultimately allows us to remove the weird overloading of cache querying
methods with the secure flag, and to
remove the AssociativeSet which was providing such weird interface.
As mentioned in the [base, mem-cache: Rewrite TaggedEntry
code](7ee9790464)
commit, further cleanup is needed. TaggedEntry
is really a misleading name as its sole difference with the CacheEntry
(which is also tagged) is the presence of
the secure bit. A better name should be chosen.
2024-08-23 21:07:43 +01:00
Giacomo Travaglini
c52f77a1d7 mem-cache: Remove IP dependency from TaggedEntry
We don't store a pointer to the indexing policy anymore.
Instead, we register a tag extractor callback when we
construct the TaggedEntry

Change-Id: I79dbc1bc5c5ce90d350e83451f513c05da9f0d61
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
b6d34db216 base, mem-cache: Remove IP dependency from the CacheEntry
We don't store a pointer to the indexing policy anymore.
Instead, we register a tag extractor callback when we
construct the CacheEntry

Change-Id: I06dc58e2f67e01f3f9bcd9f0c641505d3aec82ff
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
4030e39c9a mem-cache: Remove AssociativeSet data type
As detailed by a previous commit, AssociativeSet is not needed anymore.
The class is effectively the same as AssociativeCache

Change-Id: I24bfb98fbf0826c0a2ea6ede585576286f093318
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
ee9814499d base, mem-cache: Rewrite TaggedEntry code
The only difference between the TaggedEntry and the newly defined
CacheEntry is the presence of the secure flag in the first case.  The
need to tag a cache entry according to the security bit required the
overloading of the matching methods in the TaggedEntry class to take
security into account (See matchTag [1]), and the persistance after
PR #745 of the AssociativeSet class which is basically identical
to its AssociativeCache superclass, only it overrides its virtual
method to match the tag according to the secure bit as well.

The introduction of the KeyType parameter in the previous commit
will smoothe the differences and help unifying the interface.

Rather than overloading and overriding to account for a different
signature, we embody the difference in the KeyType class. A
CacheEntry will match with KeyType = Addr,
whereas a TaggedEntry will use the following lookup type proposed in this
patch:

struct KeyType {
    Addr address;
    bool secure;
}

This patch is partly reverting the changes in #745 which were
reimplementing TaggedEntry on top of the CacheEntry. Instead
we keep them separate as the plan is to allow different
entry types with templatization rather than polymorphism.

As a final note, I believe a separate commit will have to
change the naming of our entries; the CacheEntry should
probably be renamed into TaggedEntry and the current TaggedEntry
into something that reflect the presence of the security bit
alongside the traditional address tag

[1]: https://github.com/gem5/gem5/blob/stable/\
    src/mem/cache/tags/tagged_entry.hh#L81

Change-Id: Ifc104c8d0c1d64509f612d87b80d442e0764f7ca
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
1c57195d7f base: Do not require an AssociativeCache to store a CacheEntry
As long as the AssociativeCache Entry parameter satisfies the
interface it should be fine. We enforce the bare minimum of having
a replaceable entry.
Doing otherwise will restrict our capability to have a generic cache
with generic tags

Change-Id: I23e32b7540fea6b6e5894aca3d91538e81214932
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
8c81479193 base: Extract KeyType type in the AssociativeCache from Entry
The KeyType data type is the type of the lookup and the cache extracts
it from the Entry template parameter

Change-Id: I147d7c2503abc11becfeebe6336e7f90989ad4e8
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
4a2e015ff8 base: Extract IP type in the AssociativeCache from Entry
This commit is making the AssociativeCache indexing policy
a type extracted from the Entry template parameter

Change-Id: Ic9fb6ccb1b3549aaa250901e91ae3c300b92103e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
4814fedef0 base, mem-cache: Do not expose tags to the AssociativeCache
Exposing the tag of a cache entry through the associative
cache APIs makes it hard to generalize the cache for
structured tags. Ultimately the tag should be a property
of the cache entry and any tag extraction logic (if needed)
should reside there. In this we can reuse the associative
cache for different Entry params, each one bearing a different
representation of a tag

Change-Id: I51b4526be64683614e01d763b1656e5be23a611b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
31d967b453 base, mem-cache: Templatize the BaseIndexingPolicy
Change-Id: I4a7a0effd0100371afbd31c51d8ac643049dbdb1
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
9661ca7708 mem-cache: Simplify generation of stride prefetcher table
Some compilers (gcc version 12.3.0) will start complaining when perfect
forwarding the StrideEntry argument constructed with an extra parameter
(see later patches).
Using a pointer seems to fix the gcc bug.

The commit is also changing the signature of findTable and allocateContext
so that a reference rather than a pointer is return. In this way we don't
deal with the hack of returning a raw ptr from a unique_ptr

Change-Id: Idd451208aae80bbfae76110c859e93084bcb2635
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Giacomo Travaglini
58aa0cfbe5 mem-cache: Rewrite explicit fully associative lookup
The code is already assuming a fully associative cache.  Rather than
calling getPossibleEntries with a random value and therefore needlessly
passing a vector of pointers, we use the AssociativeCache iterator to
loop over the cache entries

Change-Id: Ic99cbd39ee9f12eef9091d9d62ca24d0c3e61300
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-23 12:15:10 +01:00
Harshil Patel
1773001dd6 resources: update filtering of resources by gem5 versions (#1475)
- Updated search query so that resources that are not compatible with
the gem5 version are still downloaded and used but a warning is thrown
instead of returning an error.
2024-08-22 09:42:34 -07:00
Bobby R. Bruce
30866376d3 tests,gpu-compute: Fix gpu tests (#1496) 2024-08-22 05:49:26 -07:00
Bobby R. Bruce
6057de452b tests,gpu-compute: Fix incorrect options handling
Change-Id: Ica845ad7c4a49fe2636df3bf184220a33557bc5e
2024-08-22 05:49:07 -07:00
Bobby R. Bruce
0a188850fe tests,gpu-compute: Fix artifact upload for GPU tests
actions/upload-artifact@v4 does not understand periods in artifact
names.

Change-Id: Ia272f9dcf9cb2213fb78b1814007921232395914
2024-08-22 05:49:07 -07:00
Bobby R. Bruce
868e287e71 stdlib: Give user's disk_device priority when setting root val (#1467)
In `get_default_kernel_root_val()`, now prioiritizes the explicit
disk_device passed from the user over the default implemented by the
board.

Also adjusts syntax for selecting this value in
`set_kernel_disk_workload()` for consistency.

It seems that the common use case for setting `disk_device` is that
there is a mismatch between where the disk image is mounted and where
the board expects it by default. In this case, it also seems common that
the root partition will be on this explicit device as well.

In cases where this is not true, explicit kernel arguments can be used
to define the distinct disk device apart from the root. However, this
seems less common than the above so, in that case, it would be easier to
tie these together.
2024-08-22 03:38:56 -07:00
Setu
f6010439fe mem: Fixed implementation of Best Offset Prefetcher (#1403)
This PR fixes the issues with the implementation of the Best Offset
Prefetcher described in issue #1402

On branch bop
Changes to be committed:
	modified:   src/mem/cache/prefetch/bop.cc
	modified:   src/mem/cache/prefetch/bop.hh

---------

Co-authored-by: Setu Gupta <setu.gupta.2020@gamil.com>
Co-authored-by: Abhishek Shailendra Singh <abs218@leigh.edu>
Co-authored-by: Setu Gupta <setu.gupta@partner.samsung.com>
2024-08-21 09:54:20 -07:00
Noah Krim
dfa4bbd7a4 Merge branch 'develop' into fix-kernel-workload-root-val 2024-08-20 15:12:10 -07:00
Bobby R. Bruce
e7442036a5 tests,gpu-compute: Fix Daily/Weekly GPU tests failures (#1485)
Without specifying the "gem5/gpu" directory, this test attempted to run
the entire test suite. This caused the daily and weekly tests to fail.
This change fixes this.
2024-08-20 14:18:51 -07:00
Ali Nezhadi Khelejani
1512eddd43 misc: Update on-create.sh (#1477)
After merging the old personal gem5 repository with the stable version
v24, I tried to run the project inside the `.devcontainer` environment.
During the image build process, I encountered the following error:

```sh
[7683 ms] Start: Run in container: /bin/sh -c ./.devcontainer/on-create.sh
fatal: detected dubious ownership in repository at '/workspaces/gem5'
To add an exception for this directory, call:

        git config --global --add safe.directory /workspaces/gem5
[7724 ms] onCreateCommand failed with exit code 128. Skipping any further user-provided commands.
```
This error occurred due to an ownership permission problem, which I
resolved by adding the following line.
2024-08-20 11:15:33 -07:00
Bobby R. Bruce
0857442e44 util-docker: Cleanup, refactor, better document Dockerfiles (#1292)
* Removes the "docker-compose.yaml" in favor of "docker-bake.hcl". This
uses the `docker buildx` tool which has the advantage of enabling
multi-platformm builds where desired. By default all images are built
targeting `linux/arm64`, `linux/amd64` and `linux/riscv64` as targets
with the exception of the GPU images where only `linux/amd64` makes
sense.
* Remove unused/older Docker build targets (these can easily be re-added
but they were not regularly built or have any current usage).
* Update "README.md" to better describe these Dockerfiles and how they
are built.
* Simplify GCC and Clang compiler images. Each uses the Ubuntu 24.04 All
Deps image as a base then specialized the compiler on top.
* To simply things, all compiler versions are built from 24.04. This
means **narrowing the supported versions from GCC v10 to v14 and Clang
v14 to v18**.
* Fix some bugs in the "docker-bake.hcl" thus ensuring all targets may
be built from it.
* Cleanup the systemc and sst images: reducing their size and building
them off the common 24.04 ubuntu base image.
2024-08-20 09:45:47 -07:00
Noah Krim
cb79596036 Merge branch 'develop' into fix-kernel-workload-root-val 2024-08-19 12:40:03 -07:00
Harshil Patel
ce4c2c6495 dev,arch-x86: Added softstrobe mode to intel8254 timer (#1447)
This PR should fix the #1195
2024-08-19 12:21:31 -07:00
Bobby R. Bruce
7413d3217c docs,misc: RELEASE-NOTES.md updates for v24.1 (#1460) 2024-08-19 10:58:29 -07:00
Bobby R. Bruce
f600db4a98 gpu-compute,tests: Move GPU tests to testlib (#1270)
A new host tag `gcn_gpu` has been added. This allows for selection of
those GPU tests which depend upon the gcn-gpu docker image to run.

In addition to this, the square GPU tests has been moved to the CI
tests. This ensures some GPU code is compiled and run on every PR.
2024-08-19 10:58:06 -07:00
Yangyu Chen
b0d81ec8a2 arch-riscv: fix GDB breakpoint issue for RV32 (#1470)
Since PR #1316, we use sign-extend for all address generation, including
PC, to match the ISA specification for modifiable XLEN. However, when we
set a breakpoint using remote GDB, our address is not sign-extended.
This causes the breakpoint to be set at the wrong address, as specified
in Issue #1463. This PR fixes the issue by sign-extending the address
when setting a breakpoint. This also matches the RISC-V ISA
Specification that "must sign-extend results to fill the entire widest
supported XLEN in the destination register."

Change-Id: I9b493bf8ad5b1ef45a9728bb40fc5e38250fe9c3

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
2024-08-19 10:25:39 -07:00
Bobby R. Bruce
cad4307951 util-docker: Re-add env variables to SST
Change-Id: I653baeb69f8be1501766b57337f6643e00d7dd60
2024-08-19 10:08:20 -07:00
Yu-Cheng Chang
aa4fe362a5 arch-riscv: Sign-extend the address in newPCState (#1471)
From #1316, creating the new PCState should sign-extend the address to
avoid wrong address issue.

Change-Id: I884b4e3708f5f1cc49cfd44d51bec5a2b63cc47a
2024-08-19 08:21:42 -07:00
Giacomo Travaglini
280871245b arch-arm: Redirect VHE for ZCR_EL1 (#1472)
Change-Id: Iff83d25257065503dc02728461823bc9985dbab3

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-08-16 22:49:49 +01:00
Noah Krim
eca0059654 stdlib: Give user's disk_device priority when setting root val
In `get_default_kernel_root_val()`, now prioiritizes
the explicit disk_device passed from the user over the
default implemented by the board.

Also adjusts syntax for selecting this value in
`set_kernel_disk_workload()` for consistency.

Change-Id: Icddcf438f5b96c2288c3cc608782f191df2c394e
2024-08-15 13:34:03 -07:00
Bobby R. Bruce
646df63e56 misc: Fix typos in util/dockerfiles/README.md
Change-Id: I5488301543bfff21279b6c0b1aae841574efee95

Co-authored-by: Harshil Patel <harshilp2107@gmail.com>
2024-08-15 10:45:53 -07:00
Alexander Richardson
646f994efb arch-arm: Fix incorrect operation of VRINT* instructions (#1325)
After a lot of debugging and comparing traces I noticed that vrintp was
giving different results from QEMU. An input of 0x3f800000 (1.0) was
being passed to the fplib helpers as (uint32_t)1 which has a completely
different floating-point interpretation and the result was therefore
completely wrong.

I've fixed this as well as all remaining implicit float-to-int
conversions in the ARM instruction execution. There are more
-W(implicit-)float-conversion warnings in the other executors, but for
now this fixes the issue I was seeing.

Change-Id: Ifdeee745ca155d7f4504ac4c54235ac431acdeb9
2024-08-15 11:01:48 +01:00
Bobby R. Bruce
0c26ee5f71 util-docker: Replace gem5 v24.0 clone with wget
This is more efficient.

Change-Id: Idd57343183a8667425dbc036ad0c7c18581898f5
2024-08-14 14:08:44 -07:00
Setu
629bf84e10 mem: Stride Prefetcher Fix (#1449)
This PR fixes the issues mentioned in #1448.

**Note that this contribution is the result of a joint collaboration
with @AbhishekUoR**

This PR introduces the following 4 changes:
1. It changes the addresses which are used to compute the stride to
cache line aligned addresses (the current version uses word aligned
addresses)
2. It correctly returns if the stride does not match (as opposed to
issuing prefetches using the new stride incorrectly)
3. It returns if the new stride is 0, indicating multiple reads from the
same cache line.
4. It removes code which is no longer necessary after the addition of
changes number 1 and 3.

Change-Id: Ic346d0e15df6d07e2b93289c8d6b89b4c2f45a34

---------

Co-authored-by: Abhishek Shailendra Singh <abs218@leigh.edu>
2024-08-14 07:16:10 -07:00
Bobby R. Bruce
dcb04a72fc util-docker,tests: Remove Ubuntu 20.04 Docker
Change-Id: I1d4bbebaa4b6f064b5f40a95d066bbf092cf103f
2024-08-13 16:15:49 -07:00
Bobby R. Bruce
9f93c8ac9c util-docker: Revert docker image tag to 'latest'
Change-Id: Iafe92716725e6b3cecfeba57098c3a7efaf73d97
2024-08-13 16:13:33 -07:00
Bobby R. Bruce
59455daa85 util-docker: Fix correct common platform comment
Change-Id: Ifc703b47b1e59522ba01f4c2b59a4863779eefb1
2024-08-13 16:12:45 -07:00
Bobby R. Bruce
8b61490df1 util-docker: Update dockerfiles README
Change-Id: I39bca04b3770bd51203944d69d0fbecff85055f8
2024-08-13 16:09:08 -07:00
Bobby R. Bruce
bef452ce72 misc,tests: Update supported GCC and Clang compilers
- GCC: v10 to v14
- Clang: v14 to v18

Change-Id: I6cd1686ffff0f08686a231b6b4936da343d53831
2024-08-13 16:09:06 -07:00
Bobby R. Bruce
b68c2ef37f util-docker: Add vim to 24.04-all-deps Ubuntu Docker
Change-Id: I898a0fddcdcf8a876fcbbe11795e858395ad9740
2024-08-13 16:08:05 -07:00
Bobby R. Bruce
3875dcdfd7 util-docker: Update the sst Dockerfile
1. Builds on top of the Ubuntu 24.04 all-deps image.
2. Unify the download, build, install, and cleanup steps.

Change-Id: I4c2bf8e571dfd228f7df8372cda0f428de59af51
2024-08-13 16:08:05 -07:00
Bobby R. Bruce
2c0c933a3a util-docker: Cleanup the systemc docker
1. Uses the ubuntu-24.04_all-deps as the base image.
2. Unifies the build and cleanup into a single step, thus reducing the
   size of the image.

Change-Id: I63b5dad2af0e8b1f6be8ad1f28321c743f36b2dc
2024-08-13 16:08:05 -07:00
Bobby R. Bruce
58aad68329 util-docker: Order targets in docker-bake
This improves readbility. The targets order matches that in the default
group.

Change-Id: I1102aeb48bc256df9b58032a327ec663e5733a98
2024-08-13 16:08:03 -07:00
Bobby R. Bruce
9978b4ea4c util-docker: Add 'devcontainer' to default bake group
Change-Id: I4b245cabd6e384cab780bd22b0f8b40d9819b92b
2024-08-13 16:07:22 -07:00
Bobby R. Bruce
4956c475f4 util-docker: Set the GPU Docker images to build only to x86
These images won't work and make no sense compiling to any platform
other than X86. These are used in SE mode simulations where the host
platform matters.

Change-Id: I47405e930bf511fabcbc93d0b08ee2fb2c556869
2024-08-13 16:07:22 -07:00
Bobby R. Bruce
c1a562083d util-docker: Set 'pull' to 'always'
This ensures the a `docker pull` command is always run before building.

Change-Id: If1a66b9b426d5843459e0308a64f13a11c0c6ed2
2024-08-13 16:07:21 -07:00