Commit Graph

1502 Commits

Author SHA1 Message Date
Vishnu Ramadas
d463868f28 dev-amdgpu, gpu-compute, mem-ruby: Add support for writeback L2 in GPU (#1692)
Previously, GPU L2 caches could be configured in either writeback or
writethrough mode when used in an APU. However, in a CPU+dGPU system,
only writethrough worked. This is mainly because in CPU+dGPU system, the
CPU sends either PCI or SDMA requests to transfer data from the GPU
memory to CPU. When L2 cache is configured to be writeback, the dirty
data resides in L2 when CPU transfers data from GPU memory. This leads
to the wrong version being transferred. A similar issue also crops up
when the GPU command processor reads kernel information before kernel
dispatch, only to incorrect data. This PR contains a set of commits that
fix both these issues.
2024-11-05 10:45:46 -08: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
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
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
Yu-Cheng Chang
67edf64326 arch-riscv: Fix CLINT mtime reset handling (#1638)
The previous https://github.com/gem5/gem5/pull/1617 introduce the CLINT
reset feature. When reset, we changed the mtime to 0 and keep mtimecmp
unchanged by default, we also need to check mtime & mtimecmp regiter to
update the MTI signal. However, the mtime register will be incremented
to 1 by `raiseInterruptPin`.

In the PR, we introduced the interrupt ID for CLINT, the mtime will be
incremented only if received the RTC signal

---------

Co-authored-by: Jason Lowe-Power <jason@lowepower.com>
2024-10-08 08:51:20 -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
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
Bobby R. Bruce
f2f86a3e42 stdlib, python: Add warning message and clarify binary vs metric units (#1479)
This PR changes memory and cache sizes in various parts of the gem5
codebase to use binary units (e.g. KiB) instead of metric units (e.g.
kB). This makes the codebase more consistent, as gem5 automatically
converts memory and cache sizes that are in metric units to binary
units.

This PR also adds a warning message to let users know when an
auto-conversion from base 10 to base 2 units occurs.

There were a few places in configs and in the comments of various files
where I didn't change the metric units, as I couldn't figure out where
the parameters with those units were being used.
2024-09-17 17:32:27 +00:00
Matthew Poremba
21f1e54ecd dev-amdgpu: Implement UNMAP_QUEUES queue_sel==2
Unmap queues with queue_sel of 2 unmaps all queues while queue_sel of 3
unmaps all non-static queues. The implementation of 3 was actually
correct for 2. Static queues are queues which were mapped using a map
queues packet with a queue_type of 1 or 2.

This commit adds ability to mark a queue as static. When unmap queues
with queue_sel of 2 is sent, the existing code is now executed. With a
value of 3, we now check if the queue was marked static and do not
unmap it if marked.

Change-Id: I87d7cf78a0600c7baa516c01f42c294d3c4e90c5
2024-08-31 17:41:47 -07:00
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
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
Matthew Poremba
db0d5f19cf dev-amdgpu: Add cleanup events for SDMA
SDMA packets which use dmaVirtWrites call their completion event before
the write takes place in the Ruby protocol. This causes a use-after-free
issue corruption random memory locations leading to random errors. This
commit adds a cleanup event for each packet that uses DMA and sets the
cleanup latency as 10000 ticks. In atomic mode, the writes complete
exactly 2000 ticks after the completion event is called and therefore a
fixed latency can be used. This is not tested with timing mode, which
does not work with GPUFS at the moment, so a warning is added to give an
idea where to look in case the same issue occurs once timing mode is
supported.

Change-Id: I9ee2689f2becc46bb7794b18b31205f1606109d8
2024-08-07 14:37:49 -07:00
Matthew Poremba
0d0b68266c dev-amdgpu: Fix bad free in SDMA
The SDMA engine copies data in chunks. It currently uses the pointer
returned from new[] and manipulates it using pointer arithmetic. This
modified pointer is then passed to the completion function which deletes
the pointer. Since it is not the original pointer allocated by new[]
this triggers issues in ASAN.

Change-Id: I03ccf026633285e75005509445c62fcbda8eb978
2024-08-07 12:54:45 -07:00
Alexander Richardson
abbb94af8b dev-arm: Fix -Wdeprecated-copy warning (#1197)
Clang warns as follows: `warning: definition of implicit copy
constructor for 'TranslResult' is deprecated because it has a
user-declared copy assignment operator`

Change-Id: Ic701d8522aac75d569f4f513f54de91f76a17e48
2024-06-05 12:36:38 +01:00
Hoa Nguyen
40ef8f3afb dev: Remove an extra file in virtio (#1191)
`src/dev/virtio/VirtIORng 2.py` is identical to
`src/dev/virtio/VirtIORng.py`, and the former does not appear in any
build script.

Change-Id: I9c5f1b1a3809d1c7028b630c32310e540613e232

Signed-off-by: Hoa Nguyen <hn@hnpl.org>
2024-06-04 08:40:41 -07:00
Matthew Poremba
07f6b7c59c dev-amdgpu: Fix pending PCI RLC doorbell (#1157)
SDMA RLC queues do not currently remove their doorbell mapping. This can
cause issues re-registering the queue and prevents the pending doorbells
feature from working. In addition the data value of the doorbell (the
ring buffer rptr) is not saved, leading to UB when this workaround is
used.

This commit removes the doorbell mapping from the gpu device when the
SDMA engine unmaps an RLC queue and copies the next doorbell value to
the pending packet as was originally intended.

Change-Id: Ifd551450f439c065579afcf916f8ff192e7598ab
2024-05-29 07:15:46 -07:00
Harshil Patel
33cebe9376 dev: add reset wrap mode to mouse.cc (#1149)
This change fixes #1148 

I have only added an acknowledged return, as we dont ahve remote and
wrap mode so it can only be in stream mode.

Change-Id: I1882042d873ff0e9465c9491238554c8fbb9aa76
2024-05-21 10:55:03 -07:00
Matthew Poremba
8be5ce6fc9 dev-amdgpu,configs,gpu-compute: Add gfx942 version
This is the version for MI300. For the most part, it is the same as
MI200 with the exception of architected flat scratch (not yet
implemented in gem5) and therefore a new version enum is required.

Change-Id: Id18cd7b57c4eebd467c010a3f61e3117beb8d58a
2024-05-15 12:08:41 -07:00
Matthew Poremba
29f63f630b dev-amdgpu: Correct missing GART warning
SDMA ptePde packets are generating a warning that a GART address is
missing, causing a wrong address to be clobbered by the operation.

This commit fixes this by converting the GART address when the queue is
running in privledged mode, which is the only mode allowed to use GART
addresses. This removes the warnings and writes to the correct memory
region.

Change-Id: I64acac308db2431c5996b876bf4cda704f51cf25
2024-05-03 14:31:17 -07:00
Matthew Poremba
2703fb5699 gpu-compute: Fix valgrind memleak complaints
Fixes several memory leaks, mostly of small and medium severity. Fixes
mismatched new/new[] and delete/delete[] calls.

Change-Id: Iedafc409389bd94e45f330bc587d6d72d1971219
2024-05-03 14:29:31 -07:00
Bartek Gąsiorzewski
84cba2a8a8 dev: Fix interrupt logic in uart8250 (#1009)
Hi, we've noticed some issues with the Uart8250 device when using it as
the Linux console. Sometimes the Uart interrupt would remain constantly
posted, so Linux would continue to try and handle it, effectively
resulting in an infinite loop. With this patch, I'm no longer seeing any
issues, but my testing has been limited to configurations and workloads
we're interested in at Imagination, so please let me know if there's
some other tests I should run or if you notice any other issues.

This patch fixes several issues with interrupt posting and clearing in
the uart8250 device.

The "status" member variable and the console interrupt should be kept in
sync. However, in one code path in readIir, the interrupt bit was being
cleared in the status variable but not in the platform controller.

Additionally, in some code paths, the interrupts would be cleared in the
status variable and in the interrupt controller, but a future interrupt
would remain scheduled, causing a spurious interrupt and setting a bit
in status to 1.

These issues can confuse the kernel and result in an ininite interrupt
handling loop.

Another issue is related to the fact that there are two interrupt causes
(TX and RX) and both of them can be valid at the same time. When one of
them becomes no longer valid, we should check the status of the other
one before clearing the interrupt.

This patch addresses the issues listed above and refactors the interrupt
clearing logic to reduce repetition.
2024-04-17 11:27:39 -07:00
Matthew Poremba
7e2d8dee42 mem,gpu-compute: Implement GPU TCC directed invalidate (#1011)
The GPU device currently supports large BAR which means that the driver
can write directly to GPU memory over the PCI bus without using SDMA or
PM4 packets. The gem5 PCI interface only provides an atomic interface
for BAR reads/writes, which means the values cannot go through timing
mode Ruby caches. This causes bugs as the TCC cache is allowed to keep
clean data between kernels for performance reasons. If there is a BAR
write directly to memory bypassing the cache, the value in the cache is
stale and must be invalidated.

In this commit a TCC invalidate is generated for all writes over PCI
that go directly to GPU memory. This will also invalidate TCP along the
way if necessary. This currently relies on the driver synchonization
which only allows BAR writes in between kernels. Therefore, the cache
should only be in I or V state.

To handle a race condition between invalidates and launching the next
kernel, the invalidates return a response and the GPU command processor
will wait for all TCC invalidates to be complete before launching the
next kernel.

This fixes issues with stale data in nanoGPT and possibly PENNANT.
2024-04-15 13:18:01 -07:00
Giacomo Travaglini
bdcffdd0f0 dev-arm: Do not mark the MpamMSC as abstract (#1030)
This prevents its instantiation


Change-Id: I775a64904a01cf36e4cc1e0cd45765f03325c5ca

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-04-15 09:40:22 -07:00
Matthew Poremba
1d64669473 mem,gpu-compute: Implement GPU TCC directed invalidate
The GPU device currently supports large BAR which means that the driver
can write directly to GPU memory over the PCI bus without using SDMA or
PM4 packets. The gem5 PCI interface only provides an atomic interface
for BAR reads/writes, which means the values cannot go through timing
mode Ruby caches. This causes bugs as the TCC cache is allowed to keep
clean data between kernels for performance reasons. If there is a BAR
write directly to memory bypassing the cache, the value in the cache is
stale and must be invalidated.

In this commit a TCC invalidate is generated for all writes over PCI
that go directly to GPU memory. This will also invalidate TCP along the
way if necessary. This currently relies on the driver synchonization
which only allows BAR writes in between kernels. Therefore, the cache
should only be in I or V state.

To handle a race condition between invalidates and launching the next
kernel, the invalidates return a response and the GPU command processor
will wait for all TCC invalidates to be complete before launching the
next kernel.

This fixes issues with stale data in nanoGPT and possibly PENNANT.

Change-Id: I8e1290f842122682c271e5508a48037055bfbcdf
2024-04-10 11:35:25 -07:00
Bobby R. Bruce
3af15a535e mem-cache, configs, arch-arm: Handle partitioning policies through a PartitionManager (#966)
This PR is offloading some of the partitioning logic to the partitioning
manager, effectively changing
the partitioning interface. Rather than always relying on the
PartitionFieldExtention data structure to
convey partition IDs, we make it implementation defined by introducing
the partitioning manager abstraction.
We want user to be able to extract the partitionId more flexibly and
this requires using a SimObject.

Users can extend the PartitioningManager, overriding the
readPacketPartitionId, therefore providing their
own mean of injecting/extracting partitioning data from a packet
2024-04-08 16:05:17 -07:00
Giacomo Travaglini
bdb08a5b6c arch-arm, dev-arm: Fix typo in PartitionFieldExtention name
Rename PartitionFieldExtention into PartitionFieldExtension

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I8072adf78d81b94c5b8bc61a317c0238cf0a9fd9
2024-04-07 11:45:57 +01:00
Giacomo Travaglini
dd45e1c319 misc: Make PartitionFieldExtention private to Arm
The new ISA-agnostic interface is the PartitionManager.
We therefore make the PartitionFieldExtention private to the
Arm implementation of memory partitioning (FEAT_MPAM)

Any other partitioning implementation should override the
PartitionManager::readPacketPartitionID to provide a mean
for extracting partitioning data (partition_id) from the
incoming Packet.

With this commit we also define an MPAM MSC which is
supposed to be the partitioning manager for the
Memory System Component

Change-Id: I6959ace0c0cbca549dcc1aacd53dff223b5fe328
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-04-07 11:45:57 +01:00
Giacomo Travaglini
63706f04b5 dev: Remove duplicate virtio files (#976)
Remove the following files:
* src/dev/virtio/rng 2.cc
* src/dev/virtio/rng 2.hh

Which were a copy of rng.hh and rng.cc. Probably added to the repository
by accident. They were not compiled by scons


Change-Id: I9d1da19cc243c513ab7af887b1b6260d8e361b57

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-28 14:32:11 +00:00
Matthew Poremba
823b5a6eb8 dev-amdgpu: Support multiple CPs and MMIO AddrRanges
Currently gem5 assumes that there is only one command processor (CP)
which contains the PM4 packet processor. Some GPU devices have multiple
CPs which the driver tests individually during POST if they are used or
not. Therefore, these additional CPs need to be supported.

This commit allows for multiple PM4 packet processors which represent
multiple CPs. Each of these processors will have its own independent
MMIO address range. To more easily support ranges, the MMIO addresses
now use AddrRange to index a PM4 packet processor instead of the
hard-coded constexpr MMIO start and size pairs.

By default only one PM4 packet processor is created, meaning the
functionality of the simulation is unchanged for devices currently
supported in gem5.

Change-Id: I977f4fd3a169ef4a78671a4fb58c8ea0e19bf52c
2024-03-21 10:13:55 -05:00
Matthew Poremba
39153cd234 dev-amdgpu: Implement PCIe indirect read/write
PCIe can read/write to any 32-bit address using the PCI index/index2
registers as an address and then reading/writing the corresponding
data/data2 register.

This commit adds this functionality and removes one magic value being
written to support GPU POST. This feature is disabled for Vega10 which
relies on an MMIO trace for too many values to implement in the MMIO
interface.

Change-Id: Iacfdd1294a7652fc3e60304b57df536d318c847b
2024-03-21 10:13:55 -05:00
Matthew Poremba
047c194780 dev-amdgpu: Implement SRBM write
The SRBM write packets where previously not required. This commit
implements SRBM writes to set a register by using the new setRegVal
interface. SRBM writes seem to be used for SRIOV enabled devices.

Change-Id: I202653d339e882e8de59d69a995f65332b2dfb8c
2024-03-21 10:10:01 -05:00
Matthew Poremba
6bbde8fbb8 dev-amdgpu: Rework handling of unknown registers
The top level AMDGPUDevice currently reads/writes all unknown registers
to/from a map containing the previously written value. This is intended
as a way to handle registers that are not part of the model but the
driver requires for functionality. Since this is at the top level, it
can mask changes to register values which do not go through the same
interface. For example, reading an MMIO, changing via PM4 queue, and
reading again returns the stale cached value.

This commit removes the usage of the regs map in AMDGPUDevice,
implements some important MMIOs that were previously handled by it, and
moves the unknown register handling to the NBIO aperture only. To reduce
the number of additional MMIOs to implement, the display manager in
vega10 is now disabled.

Change-Id: Iff0a599dd82d663c7e710b79c6ef6d0ad1fc44a2
2024-03-21 10:10:01 -05:00
Matthew Poremba
009cec56e0 dev-amdgpu: Check for SDMA copies to GART range
The SDMA engine can potentially be used to write to the GART address
range. Since gem5 has a shadow copy of the GART table to avoid sending
functional reads to device memory, the GART table must be updated when
copying to the GART range.

This changeset adds a check in the VM for GART range and implements the
SDMA copy packet writing to the GART range. A fatal is added to write
and ptePde, which are the only other two ways to write to memory, as
using these packets to update the GART table has not been observed.

Change-Id: I1e62dfd9179cc9e987659e68414209fd77bba2bd
2024-03-21 10:10:01 -05:00
Matthew Poremba
998709d4fc dev-amdgpu: Improve PM4 write data packet
The write data packet can write multiple dwords but currently always
assumes there is one dword, which can cause some write data to be
missed. This case is not common, but the number of dwords is implicitly
defined in the PM4 header.

This changeset passes the PM4 header to write data so that the correct
number of dwords can be determined. For now we assume no page crossing
when writing multiple dwords as the driver should be checking for that.

Change-Id: I0e8c3cbc28873779f468c2a11fdcf177210a22b7
2024-03-21 10:10:01 -05:00
Matthew Poremba
c045c68540 dev-amdgpu: Add node_id to interrupt handler
The ROCm 6.0 driver adds a node_id field to interrupts which must match
before passing on the interrupt to be cleared by the cookie from gem5's
interrupt handler implementation. Add this field and enable for gfx942.

The usage of the field can be seen in event_interrupt_isr_v9_4_3 at
https://github.com/ROCm/ROCK-Kernel-Driver/blob/roc-6.0.x/drivers/
    gpu/drm/amd/amdkfd/kfd_int_process_v9.c#L449

Change-Id: Iae8b8f0386a5ad2852b4a3c69f2c161d965c4922
2024-03-21 10:10:01 -05:00
Giacomo Travaglini
0ec8cf8d05 dev-arm: Fix SMMUv3 DTB autogen (#934)
Replacing FdtProperyWords (expecting an integer) with FdtPropertyStrings

Change-Id: Icd1cf00704e253c88ac9b1d69c3cf946d2a8ca70

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-14 15:42:57 +00:00
Giacomo Travaglini
5161195db5 dev-arm: Remove the SMMUv3 irq_interface_enable parameter
The SMMU_IRQ_CTRL had been made optionally writeable by a
prior patch [1] even if interrupts were not supported in
the SMMUv3 model.
As we are partially enabling IRQ support, we remove this option
and we make the SMMU_IRQ_CTRL always writeable

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/38555

Change-Id: Ie1f9458d583a5d8bcbe450c3e88bda6b3c53cf10
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 13:53:44 +00:00
Giacomo Travaglini
d63282a9da dev-arm: Implement wired interrupt for SMMU event queue
See https://github.com/orgs/gem5/discussions/898

The SMMUv3 Event Queue is basically unused at the moment.  Whenever a
transaction fails we actually abort simulation.  The sendEvent method
could be used to actually report the failure to the driver but it is
lacking interrupt support to notify the PE there is an event to handle.
The SMMUv3 spec allows both wired and MSI interrupts to be used.

We add the eventq_irq SPI param to the SMMU object and we draft an
initial sendInterrupt utility that makes use of it whenever it is
needed.

Change-Id: I6d103919ca8bf53794ae4bc922cbdc7156adf37a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 13:53:21 +00:00
Giacomo Travaglini
63c815b5fc dev-arm: Do not panic in the SMMUv3 for fauting transactions
Rely on the architected solution instead of aborting simulation.
This means handling writes to the Event queue to signal managing
software there was a fault in the SMMU

Change-Id: I7b69ca77021732c6059bd6b837ae722da71350ff
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 11:29:22 +00:00
Giacomo Travaglini
7d5d1cd9c8 dev-arm: Rewrite SMMUEvent
The struct fields of the SMMUEvent were not matching the SMMUv3 specs.
This was "not an issue" as events have been implicitly disabled until
now (every translation error was aborting simulation)

With generateEvent we automatically construct a SMMU event from
a translation result.

Change-Id: Iba6a08d551c0a99bb58c4118992f1d2b683f62cf
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 11:29:22 +00:00
Giacomo Travaglini
ef10db5a3e dev-arm: Record additional information in the TranslResult
A faulting translation should return additional information
(other than the fault type). This will be used by future
patches to properly populate the SMMU event record of the
event queue

As we currenlty support two faults only:

1) F_TRANSLATION
2) F_PERMISSION

We add to TranslResult the relevant fault information only:
type, class, stage and ipa

Change-Id: I0a81d5fc202e1b6135cecdcd6dfd2239c2f1ba7e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 11:29:22 +00:00
Giacomo Travaglini
3d1f68f205 dev-arm: Return translation fault in doReadCD
Reading the Context Descriptor (CD) might require a stage2
translation. At the moment doReadCD does not check for the
return value of the translateStage2.
This means that any stage2 fault will be silently discarded
and an invalid address will be used/returned.

By returning a translation result we make sure any error
happening in the second stage of translation will be properly
flagged

Change-Id: I2ecd43f7e23080bf8222bc3addfabbd027ee8feb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 11:29:22 +00:00
Giacomo Travaglini
4a4b775985 dev-arm: Provide encapsulation by adding TranslResult::isFaulting
We don't check the fault type directly. This will improve
readability once the TranslResult class will be augmented
with extra fields

Change-Id: I5acafaabf098d6ee79e1f0c384499cc043a75a9d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-08 11:29:22 +00:00
Giacomo Travaglini
c0e5d58a96 dev: RegisterBank addRegistersAt for fragmented reg banks (#902)
One of the limitations of the RegBank class is that it does not allow
you to pass a non-contiguous set of registers. Its simplest form will
just accept an initializer list of registers and it will store them in
sequence.

A more refined version [1] will optionally accept an offset value to be
passed alongside the register reference. This is not meant to be used by
the register bank to store the register at the provided offset.

It is rather used by the bank to sanity check the register sits exactly
at the provided range.

The way to work around this for a fragemented register space is to
explicitly allocate RAZ/RAO blocks as registers and to pass them to
addRegisters together with the others. (See the SysSecCtrl [2] as an
example)

This makes it a bit tedious to model a register bank with gaps between
its registers. First, the exact number and position of the gaps needs to
be extraced from a spec. These sometimes report only implemented
registers and their offset, and omit to document gaps/reserved space. So
a developer needs to manually add register offset and size to check if
all registers are contiguous. Second, these reserved register blocks
need to be instantiated in the bank adding boilerplate code and
affecting readibility.

For these reasons we add a new registration method, called
addRegisters*At*. It reuses the RegisterAdder class but this time the
offset field is really used to instruct the bank where the register
should be mapped. The method is templated and the template parameter
tells the bank which register type should be used to fill the remaining
space. We make the RegBank the owner of this filler space (registers are
generated internally within addRegistersAt).

[1]: https://github.com/gem5/gem5/blob/stable/src/dev/reg_bank.hh#L106
[2]: https://github.com/gem5/gem5/blob/stable/src/dev/arm/ssc.cc#L48

Change-Id: I614ae6e9eeb40b365ac9b6dd8b75abbfdb9cb687

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2024-03-01 15:32:40 +00:00
Yu-Cheng Chang
bcf455755e arch-riscv,dev: Update the PLIC implementation (#886)
Update the PLIC based on the
[riscv-plic-spec](https://github.com/riscv/riscv-plic-spec) in the PR:
- Support customized PLIC hardID and privilege mode configuration
- Backward compatable with the n_contexts parameter, will generate the
config like {0,M}, {0,S}, {1,M} ...

Change-Id: Ibff736827edb7c97921e01fa27f503574a27a562
2024-02-26 10:32:53 -08:00
wmin0
4e75e35a33 dev-arm: Remove the dependency of Platform for ArmSigInterruptPin (#878)
ArmSigInterruptPin don't send the interrupt to GIC. Instead it sends the
interrupt to the irq specified in Param. When using ArmSigInterruptPin,
we shouldn't ask users to provide "Platform" since it doesn't need it.
To reduce the confusion, this change removes the dependency of Platform
for ArmSigInterruptPin.

Change-Id: I0ee507ed1c08b4fa6d3e384e28732f3acb4f6892
2024-02-20 08:50:27 +00:00
kroarty-lanl
197be3a0dd dev: Fix off-by-one in IDE controller PCI register allocation (#824)
The PCI configuration space is 256 bytes, yet because the
PCI_CONFIG_SIZE macro is 0xff, the final register allocation in the IDE
controller only allocated up to byte 255.

Change-Id: I1aef2cad9df366ee8425edb410037061eb29ae33
2024-02-01 10:14:28 -08:00
Matthew Poremba
7f71477f15 dev-amdgpu: Limit SDMA NOP count to wptr boundary (#806)
If the NOP count of an SDMA NOP packet goes beyond the wptr address, the
queue decode method will loop infinitely. If a packet comes in with a
bad count this causes gem5 to hang. This change advances the rptr one
dword at a time until either reaching the NOP count or when rptr == wptr
to prevent this issue.

Change-Id: Ib2c0f74a477bff27890c9c064bb4190e76e513bd
2024-01-25 15:35:35 -08:00
Ivana Mitrovic
24e0d71034 arch-gcn3: Remove gcn3 (#781)
Related to issue #703 , this PR removes GCN3 related files and updates
source code, documentation, and tests to switch over to Vega is that was
not done already. Highlights are:

 - Remove all src/arch/amdgpu/gcn3 files and update Kconfigs.
 - Remove references to GCN3 and replace with Vega where applicable.
- Update the build targets in the gcn-gpu Docker. This will need to be
rebuilt but not urgently.
- Remove the GCN3 tag in testlib. Most tests seem to be using Vega
already, so that commit is small.
2024-01-25 10:14:46 -08:00