Commit Graph

22325 Commits

Author SHA1 Message Date
Bobby R. Bruce
d5d7880840 util-docker: Add qemu-riscv-env Dockerfile (#1731) 2024-10-29 17:19:43 -07:00
Bobby R. Bruce
d8e7c91127 mem-ruby: Remove unused variables/mark [maybe unused] (#1650)
PR gem5#1453 left some unused variables in the ruby code that triggered
"unused variable" warnings found comiling ALL/gem5.opt to use the CHI
protocol. These have been removed.
2024-10-29 14:31:20 -07:00
Matthew Poremba
1442a4dccd mem-ruby: Re-enable assign with implicit_ctor structures (#1694)
In #1453, an `implicit_ctor` option was added for SLICC structures. This
was done to allow statements such as `NetDest tmp;` which now require a
non-default constructor without modifying every protocol. The new
`implicit_ctor` option converts the statement `NetDest tmp;` in SLICC to
`NetDest tmp(<implicit_ctor>);` in C++. This is problematic when doing
something like `NetDest tmp := getMachines(...);` which gets converted
to `NetDest tmp(<implicit_ctor) = getMachines(...);` as the constructor
doesn't return an object. Before #1453 NetDest had a default constructor
so there we no difference between a local variable definition and local
variable assignment.

This commit fixes this issue by checking in the LocalVariableAST if the
local variable is part of an assignment or not. If it is not part of an
assignment, the implicit_ctor is used. Otherwise, the assignment is
printed to the generated code.

Note that this is not done anywhere in the public code but should be
allowed for folks writing their own Ruby protocols who might otherwise
be confused why a simple assignment presents a compile error.
2024-10-29 08:53:14 -07:00
Matt Sinclair
853f2ea012 configs,scons: Update scripts and build_opts to make GPU-FS simulations more configurable (#1693)
This PR adds support for command line arguments in GPU-FS runs to allow
the user to configure several parts of the GPU. It also increases the
bits per set in the build_opts/VEGA_X86 file to enable GPU-FS
simulations to use 64 directories or more.
2024-10-28 17:19:18 -05:00
Erin Le
11dd2c6c09 stdlib: address requested changes to X86, Riscv boards
This commit addresses the requested changes. An additional
comment is added for clarification, the exception type is
changed, and a few of the error messages have been
modified.
2024-10-28 15:00:19 -07:00
Marleson Graf
7bddc764cc mem-ruby: Prevent LL/SC livelock in MESI protocols (#1384) (#1399)
Fix #1384.

MESI_Two_Level and MESI_Three_Level protocols are susceptible to LL/SC
livelocks when simulating boards with high core count.

This fix is based on MOESI_CMP_directory's implementation of locked
states, but tailors the solution to only apply it when a Load-Linked is
initiated.

There are two new states to act as locked states and stall any messages
leading to eviction:
* LLSC_E: equivalent to E state, go to E after timeout.
* LLSC_M: equivalent to M state, go to M after timeout.

The main new event is Load_Linked, which is very similar (in behavior)
to a Store, reusing several transient states. When a controller receives
the exclusive data, it differentiates a Load_Linked from a Store by
checking a new field added to the TBE: 'isLoadLinked'. It triggers a
different event when it is a Load_Linked, which in turn causes the
transition to one of the locked states.

The entire mechanism can be turned off by setting 'use_llsc_lock' to
false, and the amount of time to keep locked is defined by
'llsc_lock_timeout_latency'.

Change-Id: I13f415b6b7890d51d01f23001047d2363467a814
2024-10-28 09:57:10 -07:00
Bobby R. Bruce
dde1c7d3a1 util-docker: Add RISCV to Ubuntu all-deps Docker platforms (#1716)
I have re-implemented building this image to target RISC-V in addition
to X86 and ARM. I have found it makes for quite a good cross compilation
tool.
2024-10-26 21:17:40 -07:00
Giacomo Travaglini
c9f94f4e06 arch-arm: Replace translateAtomic with translateFunctional in AT (#1713)
A previous PR mistakenly [1] replaced translateFunctional with
translateAtomic. This commit is reverting that

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

Change-Id: I945c3fe59cea36732d9f30109b950d4114aa8fad

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-25 09:15:52 -07:00
Harshil Patel
c91af552d4 tests: move weekly gpu tests to have separate jobs (#1698) 2024-10-24 04:02:23 -07:00
Bobby R. Bruce
709f2c7695 mem-ruby,tests: Add CHI with ISA tests (#1651) 2024-10-23 15:12:37 -07:00
Bobby R. Bruce
35db93ada4 arch-riscv: Fix the bug of vsetivli frequently flushing the pipeline (#1526)
This PR fix the bug of vsetivli frequently flushing the pipeline.

Here are two pictures of the pipeline illustrate this phenomenon.


![20240830-200208](https://github.com/user-attachments/assets/532a1a8e-8acd-483f-b9a0-c25dadbe76b4)

![20240830-200213](https://github.com/user-attachments/assets/9354a6ad-4024-4afb-be6f-01f08dc9610c)

The vsetivli(0x00013334.0) instruction in the first picture flushes the
pipeline every time it is executed. This is due to vsetivli being
incorrectly flagged as a 'DirectControl' instruction. The branch
predictor cannot predict it correctly.

The second picture is the pipeline after fixing the bug.

Change-Id: I5bede47919c06cea86fa23a81624b502fbdc1159
2024-10-23 08:32:56 -07:00
Zhibo Hong
089d780c76 arch-riscv: Fix the bug of vsetivli frequently flushing the pipeline
Change-Id: I5bede47919c06cea86fa23a81624b502fbdc1159
2024-10-23 17:24:43 +08:00
Erin Le
7b7f5ef34a stdlib: add SE mode to RiscvBoard
This commit adds SE mode to RiscvBoard. RiscvDemoBoard has also
been modified as adding SE mode to RiscvBoard made the
overridden functions in RiscvDemoBoard obsolete.
2024-10-22 16:31:01 -07:00
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
Nagendra-KJ
d0a9945d47 scons: Changed bits per set for VEGA_X86 to 128
Change-Id: I03fbb3000a13cf11fb751367677a7f1735f64ec9
2024-10-20 11:53:31 -05:00
Nagendra-KJ
a443b5cbb8 configs: Added command line arguments to gpufs config scripts
This commit adds command line arguments to the scripts that GPU-FS mode
uses.

Change-Id: I5514e77e699b9144461bbd2be6e267e7d44a6fb2
2024-10-20 11:53:21 -05: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
Giacomo Travaglini
c974bca123 arch-arm: Implement the L2 TLB as a 5-way set associative
Change-Id: I65d7a384f6d54989cec3c431090c35285011849f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:15 +01:00
Giacomo Travaglini
7f826ffbaa arch-arm: Use the AssociativeCache in the ArmTLB
With this commit we replace the TlbEntry storage within the TLB from an
array of entries with a custom hardcoded FA indexing policy and LRU
replacement, into the flexible SetAssociative cache.

Change-Id: Ia74ff6962ac8195802b51dcc0caa516965f0ce37
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
ab6354a9cc arch-arm: Rename TlbEntry::Lookup into TlbEntry::KeyType
KeyType definition is required if we want to store the TlbEntry
within an AssociativeCache. We could add an alias and keep the
Lookup name but this will just create extra confusion

Change-Id: Ib0b7c9529498f0f6f15ddd0e7cf3cec52966e8df
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
c83321b843 arch-arm: Define a SetAssociative indexing policy for the TLB
Change-Id: I8149ddc4ecf7ac3b8b7e8e1cf7eb4932fd99c34a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
376530ef72 arch-arm: Add isValid method to the TlbEntry
Change-Id: I93b183ad0768e8afc94bb3f21387c21cdc9cc78b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
3f18cada53 arch-arm: Add insert method to the TlbEntry
Change-Id: I664b03b61e4540025c6cebaa4a7298297565c76b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
c6cca14b74 arch-arm: Add invalidate method to the TlbEntry
This is needed for compliance with the AssociativeCache
container. It will call the invalidate method when
invalidating the TLB entry

Change-Id: Idb1bc40b5aea8c475146700c81ab79d9980f745d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
ce8a98d657 arch-arm: Generate Lookup from TlbEntry
Change-Id: I355d190acfeb3cd829647b962548c82dd0013f8d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
fda8eeace4 arch-arm: Keep track of observed page sizes in the TLB
With this commit we record the page sizes of all valid
TLB entries in a TLB.

We update the set conservatively, therefore allowing
false positives but not false negatives.

This information will be used when doing a page size based
lookup. At the moment we don't strictly need it as we
iterate over all TLB entries (the TLB implements a fully
associative cache) and if we find multiple matches, it means
we have stored some partial translations.

The existing logic is prioritizing complete translations
over partial translations and among the latter, late stage
translations over early stage (with the idea to minimize
the number of walks).

The "iterate once over the entire TLB and record all matches"
won't work well when we shift from a fully associative
TLB into a set associative. With the introduction of the
aforementioned set, we can do page size based lookups,
so we can explicitly lookup the TLB for a specific page size
therefore looking into the appropriate set for a match

Change-Id: If77853373792d6a5ec84cf1909ee5eb567f3d0e4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
da3919a6f4 arch-arm: Add pagesize field to the Lookup data structure
Change-Id: Ibc2c80cbf3cfd98f24440e8e6ddf4dbb7e4e26d6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
1eed6e9769 arch-arm: Make TlbEntry a ReplaceableEntry
Change-Id: I3b8169bfb620ea36f6bbe63c38b71184285b55c2
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
94ffe5f233 arch-arm: Replace TLB,TLBVerbose usage in ArmMMU
Some ISAs (like Arm) have moved most of the translation logic into
the MMU and use the TLB simply as translation storage. It makes
sense to use the MMU debug flag for that logic and reduce the
scope of the TLB flag to TLB insertion/hits/misses

Change-Id: I2a164545c711d83d3e87075b0cb5c279eed274c9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
58bc790a09 arch-arm: Do not include tlb.hh in mmu.hh
This commit is moving some MMU methods definition in the
source file from the header to avoid including tlb.hh

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I8fb1aeccd9c38c48b09583b4dc5d152acd09c3e6
2024-10-18 14:30:14 +01:00
Giacomo Travaglini
08c66a0b6a arch-arm: Avoid unnecessary include of faults.hh
Remove unused include from self_debug.hh

Change-Id: Ic675a277ebb2ff4a319e9a7cfe2bea4af850609e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-18 14:25:39 +01:00
Giacomo Travaglini
0f1436ba5f arch-arm: DomainType is not specific to the TlbEntry
Change-Id: I626c79973fcd60b1be36a965923999a1c9a9bc54
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-18 14:25:39 +01:00
Giacomo Travaglini
d3cdd2dc17 arch-arm: TranMethod is not specific to the ArmFault
It is a simple enum to distinguish between short and big
descriptors. By moving it away from the ArmFault we can
avoid including fault.hh from mmu.hh

Change-Id: Ib556b577c62f5ea3e4c8c9e0d4560a3e99c96778
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-10-18 14:25:39 +01: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