Commit Graph

22257 Commits

Author SHA1 Message Date
Mahyar Samani
2fca39cec7 dev-amdgpu: Separating gpu_memory from gpu_cache.
This change separates the instantiation of gpu memory from
instantiatiing the gpu cache. Prior to this change, the gpu
cache instantiated the memories for the gpu by receiving number
of channels as a parameter. With this change, the gpu memory
should be constructed outside the gpu, without being added as a
child to any other object, and passed to the constructor of
the gpu.
2024-12-02 08:33:12 -08:00
Mahyar Samani
1948155fb2 stdlib: AbstractMemorySystem.get_mem_interfaces.
This change adds a new method to AbstractMemorySystem to allow
getting its objects of the class MemInterface. This is useful
when certain other classes require a list of MemInterface objects
to create physical memory. In addition, ChanneledMemory and
HighBandwidthMemory implement this function.
2024-12-02 08:33:12 -08:00
Maryam Babaie
c0c0955178 dev-amdgpu: Adding support for avs extended states and features. 2024-12-02 08:33:12 -08:00
Matthew Poremba
2105dc47a9 stdlib: Add viper board, viper cache, and gpu components
Adds GPU_VIPER protocol related caches to stdlib components: CorePair
cache, TCP, SQC, TCC, Directory, and DMA controllers. Adds GPU related
components in a new components/devices/gpus/ directory. Adds prebuilt
GPU and CPU cache hierarchies, GPU and CPU network classes, and a board
overriding the X86Board to provide helper methods for disk image root,
the complex kernel parameter list, and method to provide functionality
to the current GPUFS scripts to load in applications and handle loading
the GPU driver.

The new GPU components can be used as follows:
 - Create a GPU device *before* the CPU cache hierarchy is created.
 - Add the GPU's CPU-side DMA controllers to the list of CPU cache
   controllers.
 - Use GPU device method to connect to an AbstractBoard.

Each GPU components has it's own RubySystem, PCI device ID, and address
ranges for VBIOS and legacy PCI BARs. Therefore, in theory, multiple
GPUs can be created. This requires PR #1453 .

An example of using this board is added to configs/example/gem5_library
under x86-mi300x-gpu.py. It is designed to work with the disk image,
kernel, and applications provided in the gem5-resources repository.

Change-Id: Ie65ffcfee5e311d9492de935d6d0631260645cd3
2024-12-02 08:33:12 -08:00
Giacomo Travaglini
44b8f5f422 tests: Write unit-tests for ruby using the CHI-TLM library
This commit is adding two python files:

* ruby_mem_test.py is the canonical gem5 configuration script,
and it is an adaptation of the existing ruby_mem_test.py [1].
The main difference is the use of the TlmController as a
cache controller, and the use of TlmGenerator instead of
the MemTest memory tester. The config is minimally setting up
the system. The extent of the testing is specified in the second
python file:

* read_shared_unit.py: "unit-test" for the CHI ReadShared request
The file should be passed to the ruby_mem_test.py as cmdline
argument:

build/ARM/gem5.opt <>/ruby_mem_test.py <>/read_shared_unit.py

This is a simple testing file. We should ideally generate separate
test files for separate transactions/scenarios.
The test file can have whatever for inside, it only needs to comply
to the minimal interface required by the ruby_mem_test.py, which is
to define the following function:

def test_all(generator):

[1]: https://github.com/gem5/gem5/blob/stable/\
    configs/example/ruby_mem_test.py

Change-Id: I767ede9b8572f3eafe677c84da45fd904d77e319
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-12-02 08:33:11 -08:00
Giacomo Travaglini
706cb4195f mem-ruby: Add a CHI-TLM transaction Generator for testing
This commit is building over the CHI-TLM wrapping introduced
by the previous commit and it is adding a CHI traffic generator
as a SimObject.
This will get the python objects as input and it will forward
them to the TlmController to convert them into ruby CHI
messages

Change-Id: Ia67094c9bb880e37b24184313df546ecbaa3289f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-12-02 08:33:11 -08:00
Giacomo Travaglini
786e539fa4 mem-ruby: Wrap the CHI-TLM library with pybind11
This commit is wrapping the external AMBA CHI-TLM with pybind11
so that it will be possible to use its data structures/functions
from python.

More specifically we will be able to instantiate a ARM::CHI::Payload
and ARM::CHI::Phase from a gem5 config, with the end goal of being
able to configure a CHI transaction from python

Change-Id: I9587b445c21df44161fa3d9e09fc2651541b38bd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-12-02 08:33:11 -08:00
Giacomo Travaglini
b795d28ee8 mem-ruby: Add a CHI-TLM CacheController
This commit is extending the previously defined CHIGenericController
to implement a CacheController which acts as a bridge between the
AMBA TLM 2.0 implementation of CHI [1][2] with the gem5 (ruby) one.

In other words it translates AMBA CHI transactions into ruby
messages (which are then forwarded to the MessageQueues)
and viceversa.

ARM::CHI::Payload,         CHIRequestMsg
                     <-->  CHIDataMsg
ARM::CHI::Phase            CHIResponseMsg
                           CHIDataMsg

[1]: https://developer.arm.com/documentation/101459/latest
[2]: https://developer.arm.com/Architectures/AMBA#Downloads

Change-Id: I6f35e7b4ade4d0de1b5e5d2dbf73ce796a9f9fb6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-12-02 08:33:11 -08:00
Giacomo Travaglini
76541929c9 configs: Instantiate RNFs and MN via callbacks
This commit allows top level configs making use of the Ruby module
to define node generation callbacks.
The config_ruby function will check the system object for two
factory methods

1) _rnf_gen, if defined, will be called to generate RNFs
2) _mn_gen, if defined, will be called to generate MNs

Change-Id: I9daeece646e7cdb2d3bfefa761a9650562f8eb4b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-12-02 08:33:11 -08:00
Tiago Mück
390c2b67e4 mem-ruby: Implement a CHI generic controller
Component implementing a generic controller that allow classic caches
interaction with Ruby/CHI.
The CHIGenericController provides an interface to send/receive CHI
messages to/from the interconnect. This is implement in C++ rather then
SLICC. This controller is seen as a MachineType:Cache by the CHI
implementation in SLICC.

Change-Id: I3afc4363f4290095c2f7428c8487bccd932e0300
2024-12-02 08:33:11 -08:00
Tiago Mück
488c6fc246 mem-ruby: add CHI missing valid SnpRespData type
Change-Id: I49c24e8b99932f8ae88511bb7a08a94f59ce7d29
2024-12-02 08:33:11 -08:00
Tiago Mück
bc52d886a8 mem-ruby: add CHI SnpRespData_SD_Fwded_SC message
This snoop reponse is not generated internally by the SLICC
implementation, but is required for compatibility with classic caches
which may remain in SD state while returning SC data upon receiving
a converted SnpShared.

Change-Id: I5270b29c8863c7afd8abc39b3c7978b95330c183
2024-12-02 08:33:10 -08:00
Tiago Mück
f37dfc090d mem-ruby: sequencer prints panic pkts
Change-Id: I9cd780597c4680513d9cbeb8dda2e13f2a1faf56
2024-12-02 08:33:09 -08:00
Bobby R. Bruce
85c00a2ebc misc: Fix types in RELEASE_NOTES.md 2024-11-19 15:28:40 -08:00
Bobby R. Bruce
2d8a2eab70 misc: Revert bad merge
Merge 78db0e2 was bad and cause problems. This commit reverts it.
2024-11-19 15:02:02 -08:00
Saúl
c54132bdd9 arch-riscv: fix reg dep autoref on vslide with vcpy micro (#1782)
Vector slide instructions can have the same register group as source and
destination.
Because we are pinning the destination this will provoke an
auto-reference in the dependency graph.

The solution is to use the `vcpy` micro. This way we use the `vtmp`
register group as source and pin the destination without issues.
2024-11-19 11:18:45 -08:00
Erin (Jianghua) Le
75c4003a7e python: modify comment for ExitEvent.WORKEND (#1790)
This PR modifies the documentation for ExitEvent.WORKEND in simulator.py
so it is more consistent.
2024-11-19 11:17:59 -08:00
Bobby R. Bruce
5f01a03bde arch-arm,misc: Fix build errors (#1789)
1. Add missing override to `print` function.
2. Change `TlbEntry` to struct in `ArmISA` class.

This was found attempting to compile gem5 on MacOS (Apple Silicon) with
clang v19.
2024-11-19 11:14:54 -08:00
Bobby R. Bruce
9b5f2db157 misc: Include build_opts updates in RELEASE_NOTES 2024-11-19 11:04:03 -08:00
Erin Le
82c8642954 tests: remove protocol=None, add print statement back in
This commit removes the `protocol=None` argument in various
gem5_verify_config()s because protocol is set to None by
default. Also, two print statements that were taken out in
previous commits were put back in with different function calls.
2024-11-19 11:02:15 -08:00
Erin Le
bcfa988a67 tests, scons: Fix Testlib test failures
This commit changes the fs/linux/arm and learning_gem5 tests as
they were previously failing with the Ruby change. The
fs/linux/arm long tests require the addition of a new gem5 build,
ARM_X86, which builds the ARM and X86 ISAs with the
MESI_Two_Level cache hierarchy.
2024-11-19 11:00:37 -08:00
Erin Le
f29c2c2dcf scons: modify ALL build to have all Ruby protocols 2024-11-19 11:00:37 -08:00
Erin Le
cffc2e6144 tests: modify tests to use ALL build
This commit modifies a number of Testlib tests to use the ALL
build instead of a more specific build.
2024-11-19 11:00:37 -08:00
Erin Le
2ee40f1c11 mem-ruby: changes to MESIThreeLevel, MIExample, OctopiCache
This commit changes MESIThreeLevel, MIExample, and OctopiCache
so they work with this PR. It also adds MESIThreeLevel and
OctopiCache to the testlib tests.
2024-11-19 11:00:37 -08:00
Erin Le
8fe1228f3e scons, ext-testlib: rename NULL_All_Ruby to use all caps
This commit renames NULL_All_Ruby to NULL_ALL_RUBY and adds a
tag for this build for testlib. These changes were made so the
NULL_All_Ruby build could be used with testlib.
2024-11-19 11:00:37 -08:00
Erin Le
3535fd0449 tests: additional trusted_stats files
This commit adds trusted_stats.json files for CHIL1,
MESI_Three_Level, MIExample, and OctopiCache. These jsons are
used to verify the output of tests from test_memory_traffic_gen.py.
2024-11-19 11:00:37 -08:00
Jason Lowe-Power
6903420310 tests: Add more hierarchies to traffic gen tests
This adds all of the hierarchies supported in the standard library. We
can soon move to using a different build target and run all hierarchies!

Change-Id: Ic065a679ea34c3bb2f71b3b133806d240039fbb5
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 11:00:37 -08:00
Jason Lowe-Power
97542c1a4c mem-ruby,scons: Add scons option for multiple protocols
This change does many things, but they must all be atomically done.

**USER FACING CHANGE**: The Ruby protocols in Kconfig have changed names
(they are now the same case as the SLICC file names). So, after this
commit, your build configurations need to be updated. You can do so by
running `scons menuconfig <build dir>` and selecting the right ruby
options. Alternatively, if you're using a `build_opts` file, you can run
`scons defconfig build/<ISA> build_opts/<ISA>` which should update your
config correctly.

Detailed changes are described below.

Kconfig changes:

- Kconfig files in ruby now must all be declared in the ruby/Kconfig
  file
- All of the protocol names are changed to match their slicc file names
  including the case
- A new option is available called "Use multiple protocols" which should
  be selected if multiple protocols are selected. This is only used to
  set the PROTOCOL variable to "MULTIPLE" when in multiple mode.
- The PROTOCOL variable can now be "MULTIPLE" which means it will be
  ignored. If it's not "MULTIPLE" then it holds the "main" protocol,
  which is necessary for backwards compatibility with the Ruby.py files.

Ruby config changes:

To make this change backwards compatible with Ruby.py, this change adds
a new "protocol" config called MULTIPLE.py which is used to allow the
user to set a "--protocol" option on the command line. This is only
needed if you are using a gem5 binary with multiple protocols but need
to use Ruby.py.

stdlib changes:

- Make the coherence protocol file behave like the ISA file
- Add a function to get the coherence protocol from the `CacheHierarchy`
  like we do with the ISA in the `Processor`.
  - Use this function where `get_runtime_coherence_protocol` was used
- Update the requires code to work with the ne CoherenceProtocol
- Fix a typo in the AMD Hammer name and also add the missing MSI
  protocol

Scons changes:

- In Ruby we now gather up all of the protocols and build them all if
  there are multiple protocols
- There's some bending over backwards to tell the user if they are using
  an out of date gem5.build/config file and how to update it
- Note that multiple ruby protocols adds a significant amount of time to
  the build since we have to run slicc twice for each file.

build_opts:

- Update all files with new names
- Add a new NULL_All_Ruby that will be used for testing

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 11:00:34 -08:00
Jason Lowe-Power
9a904478eb mem-ruby: Use runtime protocol instead of #defines
This removes two #defines: PARTIAL_FUNC_READS and PROTOCOL_<protocol>.
Instead, update the code to use the runtime information about which
protocol we are using.

Change-Id: Icb6f10fc2d3fd59128c62f9f6e37b52ef2581b61
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:59 -08:00
Jason Lowe-Power
b7ce3040de mem-ruby: Add ProtocolInfo class
Add a ProtocolInfo class that is specialized (through inheritance) for
each protocol. This class currently has the protocol's name and any
protocol-specific options (partial_func_reads is the only one so far).
Note that the SLICC language has been updated so that you can specify
the options in the `protocol` statement in the `.slicc` file.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:59 -08:00
Jason Lowe-Power
4f53451073 mem-ruby,configs: Update AMD protos with new names
Update the MOESI_AMD_Base and GPU_VIPER configuration files with the new
full protocol-specific names for the controllers instead of the
deprecated names.

Note: If you have any files which use the `CntrlBase` base, you will
likely need to update the class names that you are inheriting from.

Change-Id: I623fea7dd4cd151f7b15fe7cb43f8a4c45492d89
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:59 -08:00
Jason Lowe-Power
d1ed308af8 stdlib,mem-ruby: Use protocol-spec. names
Update the standard library Ruby protocols to use the protocol-specific
class names instead of the deprecated general names.

Unfortunately, some code became duplicated between similar controllers.
I tried multiple inheritance, but it didn't work out for me. I think the
correct solution is to move some of the shared code down into the
generated python. That's out of the scope for these changes.

Change-Id: I3444bee3c2917dcbe92b600b85e60244129aad35
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:59 -08:00
Jason Lowe-Power
42fe5accea configs,mem-ruby: Procotol-spec. names in CHI
Use the protocol-specific controller names in CHI.

**Important**: This could change some scripts. As long as people use
CHI_config (likely), this shouldn't be a problem, but if you have a
different version of CHI_config.py locally, you will need to make the
following updates:

`Cache_Controller` -> `CHI_Cache_Controller`
`Memory_Controller` -> `CHI_Memory_Controller`

Website updates coming soon!

Change-Id: I7afdcede884ac5f9a9a76cc3d3dd35941e4e2faa
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:59 -08:00
Jason Lowe-Power
d56d561102 configs,mem-ruby: Protocol-spec. in learning gem5
Use protocol-specific names in Learning gem5 configs. Now, we should no
longer use the generic names for the controllers (it's deprecated). This
updates Learning gem5.

Website changes coming soon. (Hopefull before I push this...)

Change-Id: I18fc5b8bb0fef7c3b8b5cea8de4f73fc0f66a1b3
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
3ba16adeff scons: Change scons for multiple protocols in SLICC
This change is a step toward multiple protocols building at the same
time in scons. Add functions and use lists instead of single protocol.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
b925a6e57c mem-ruby: Update MachineType autogen file with all types
This change makes it so that the MachineType.cc/hh file are not unique
for each protocol. All of the machine types are now tracked.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
18401758aa mem-ruby: Rename SLICC SimObjs with compatibility
Rename all SLICC generated SimObjects to have the protocol in their
name. This will allow for two different protocols to have the same
machine names (e.g., L1Cache). For compatiblity, we check to see if the
current or main protocol that is built matches the SimObject's protocol
and export the backwards-compatible name.

Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
1a713e8c65 mem-ruby: Update HTML output to include protocol
Move the html output to be in a subdirectory with the protocol name.

Change-Id: I1510d2d5a531cc6db74d10a0478c23bc8a836a26
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
feb45c9cb9 mem-ruby: Move protocol files to subdir
Move all generated protocol-specific files to a subdirectory with the
protocol's name.

This change also updates SLICC to have separate variables for the
filename, c identifier and python identifier instead of just using
variations of the c identifier.

Change-Id: I62f69a4606b030ee23cb2d96493f3257a6923748
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
3a4465d908 mem-ruby: Use namespaces for protocol types
Wrap all protocol-specific types in `namespace <protocol>`. This will
facilitate compiling multiple protocols into one binary.

There is a one-time hack to the generated `MachineType.cc` file to use
the namespace for the protocol until we generalize the machine types.

Change-Id: I5947e8ac69afe6f7ed257d7c5980ad65e9338acf
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:58 -08:00
Jason Lowe-Power
1b84fbbeae mem-ruby: Use shared and per-protocol SLICC files
This changes extends SLICC to understand two different kinds of slicc
files: files that are protocol-specific and files that are shared or
included between different protocols.

Each declaration in SLICC can now be shared or not. If it is shared,
then we can take a different action in the code generation (e.g., wrap
in a namespace).

*Developer facing change*
Removes the RubySlicc_interfaces.slicc file from the SLICC includes of
every protocol.

Changes required: If you have a custom protocol, you will need to remove
the line `include "RubySlicc_interfaces.slicc" from your .slicc file.

Change-Id: Ia6c2dafe2b8fe86749a13d17daa885bddd166855
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:53:47 -08:00
Jason Lowe-Power
c0f67f7388 python: Expand Enum param type to be more Enum-like
This extends gem5's version of python enums to support an equal operator
and the hash operator so we can compare two instances of enums and add
these to sets/dicts/etc.

Change-Id: I4a785bf9570a54254ada1db684379ee77e67b192
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
2024-11-19 10:48:53 -08:00
studyztp
0d16c92341 cpu: add comments and change input type to list
Change inst_threshold param to inst_thresholds, which it is now
expecting a list of thresholds instead of one threshold.

Add more getter and setter functions:

addThreshold:
it is for adding new thresholds

getCounter:
it is for getting the current counter

getThresholds:
it returns the list of targeted thresholds

resetThresholds:
it clears all the targeted thresholds

Change-Id: I48d022effe7b315112ac150e6a4eaf5aab41c514
2024-11-18 11:24:26 -08:00
studyztp
627734e830 cpu: clear listeners list
Change-Id: Ie9d664df1b29a0ba62174046a7ab1fda6753bef4
2024-11-18 11:24:19 -08:00
studyztp
0b0a8431dc cpu: delete listener ptrs after removal
The listener pointer does not get deleted with the removeListener()
function call, so we need to make sure it is deleted in the
ProbeListenerObject.

Change-Id: I370f34651b889c8c00a378743e9c1c09fa1d775e
2024-11-18 11:24:11 -08:00
studyztp
9fede07f44 cpu: modified with review feedback
x86-global-inst-tracker.py:
- change the incorrect use of comment styly
- add more comments about the usage of the script and the purpose of
the script

src/cpu/probes/inst_tracker.cc:
- change the way of stopListening to use the manager function to remove
listeners. If in the future, the ProbeListner object does not call the
manager to remove itself in the destruction, then we should call it
here.
- fix stlying

src/cpu/probes/inst_tracker.hh:
- fix stlying

Change-Id: I6f3d745e15883a8a702593f72f984e0d4cc4c526
2024-11-18 11:24:04 -08:00
studyztp
6e39b737c8 cpu: add an example config script
Change-Id: Id24f60d43d61766526bd45086f9aeda02fe24822
2024-11-18 11:23:58 -08:00
studyztp
ddb29819ee cpu: reorder functions, add more debug flags and comments
Change-Id: I94bd4771130441a8e2e449a7527e87ba5c355236
2024-11-18 11:23:50 -08:00
studyztp
66d3f7c038 cpu: add GlobalInstTracker and LocalInstTracker
The GlobalInstTracker manages the global instruction counter and
responsible for triggering an exit event when the global instruction
counter reaches the defined threshold.

The LocalInstTracker listens to one core's retiredInsts probe point
and updates the GlobalInstTracker every time there is an instruction
committed.

The purpose of this instruction tracker is to raise an instruction
executed exit event with multi-core simulation.

Related discussion can be found:
https://github.com/gem5/gem5/issues/1087

Change-Id: Iab6fec57f14f28e590b035506282130ba8662706
2024-11-18 11:23:34 -08:00
aperais
b82ab5ac89 misc: Do not share the random number generator across components (#1534)
Component that require randomness should not share their randomness
source with other components to avoid simulation noise. For instance,
the branch predictor of one core should not impact the random
cache replacement policy of the cache of another core. This currently
happens as all components share a single random number generator.
    
This PR provides their own generators to relevant components, although
a couple components still use rand().
    
Change-Id: I3fb7226111c9194ee457af0f0f2b83f8c7b69d1e

Co-authored-by: Arthur Perais <arthur.perais@univ-grenoble-alpes.fr>
2024-11-18 01:37:12 -08:00