Commit Graph

18536 Commits

Author SHA1 Message Date
Tiago Mück
da41d3eaa4 tests: extend ruby_mem_test
Replace ruby_mem_test by these tests which run different
configurations:

ruby_mem_test-garnet: use Garnet

ruby_mem_test-simple: use SimpleNetwork (same as original ruby_mem_test)

ruby_mem_test-simple-extra: use SimpleNetwork with
--simple-physical-channels option

ruby_mem_test-simple-extra-multicore: same as previous using 4 cores

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I7716cd222dd56ddbf06f53f92ec9b568ed5a182c
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41867
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Tiago Muck
bab3ce1661 configs,mem-ruby: SimpleNetwork physical channels
Setting the physical_vnets_channels parameter enables the emulation of
the bandwidth impact of having multiple physical channels for each
virtual network. This is implemented by computing bandwidth in a
per-vnet/channel basis within Throttle objects. The size of the
message buffers are also scaled according to this setting (when buffer
are not unlimited).

The physical_vnets_bandwidth can be used to override the channel width
set for each link and assign different widths for each virtual network.

The --simple-physical-channels option can be used with the generic
configuration scripts to automatically assign a single physical channel
to each virtual network defined in the protocol.

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: Ia8c9ec8651405eac8710d3f4d67f637a8054a76b
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41854
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Tiago Mück
87cdf354be mem-ruby: dequeue rate limit for message buffers
The 'max_dequeue_rate' parameter limits the rate at which messages can
be dequeued in a single cycle. When set, 'isReady' returns false if
after max_dequeue_rate is reached.

This can be used to fine tune the performance of cache controllers.

For the record, other ways of achieving a similar effect could be:
1) Modifying the SLICC compiler to limit message consumption in the
   generated wakeup() function
2) Set the buffer size to max_dequeue_rate. This can potentially cut the
   the expected throughput in half. For instance if a producer can
   enqueue every cycle, and a consumer can dequeue every cycle, a
   message can only be actually enqueued every two (assuming
   buffer_size=1) since the buffer entries available after dequeue
   are only visible in the next cycle (even if the consumer executes
   before the producer).

JIRA: https://gem5.atlassian.net/browse/GEM5-920

Change-Id: I3a446c7276b80a0e3f409b4fbab0ab65ff5c1f81
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41862
Reviewed-by: Meatboy 106 <garbage2collector@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 15:26:58 +00:00
Yu-hsin Wang
2fed34d099 fastmodel: Set simulation pause when breakpoint hit
The 7th parameter of breakpoint_set_code is dontStop. It seems the
fastmodel would prefetch something or do some evaluation ahead with the
flag set. This behavior prevents the instruction stepping feature of
gdb. The implementation of the feature is creating a breakpoint on the
next instruction and contining the simulation. Without stopping on the
breakpoint, it wouldn't invoke the breakpoint callback, since it may
evaulate the code we just want it to stop already. We should set the
dontStop to false to fix this issue.

Change-Id: Iaf8acd3235fa9625c1423ef34606e1fa5d0c531a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55484
Reviewed-by: Earl Ou <shunhsingou@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-20 01:16:20 +00:00
Yu-hsin Wang
52661838a4 ext: upgrade to googletest 1.11.x
Upgrade googletest to 1.11.x
upstream commit: 8306020a3e9eceafec65508868d7ab5c63bb41f7

sha1sum df8cdd26ee7cdf2a3d9c05a92d3630a96f406422 generated by command:
find . -type f ! -name SConscript ! -path "./.*" -print0 \
| sort -z | xargs -0 sha1sum | sha1sum

This upgrade is mainly for providing ConditionalMatcher support.

Change-Id: I27d971c02c59a3ad42c3002f1b4e1a8b18269c56
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55384
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-01-20 01:16:02 +00:00
Matthew Poremba
3ecd28a222 arch-vega: Update FLAT memory access helpers to support LDS
This patch ports the changes from a similar patch for arch-gcn3:
https://gem5-review.googlesource.com/c/public/gem5/+/48343. Vega already
has an helper function to send to the correct pipe depending on the
scope, however the initMem helpers currently always assume global scope.

In addition the MUBUF WBINVL1 instructions are updated similarly to the
GCN3 patch.

Change-Id: I612b9198cb56e226721a90e72bba64395c84ebcd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55465
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-18 15:20:10 +00:00
Matthew Poremba
ff17ecc177 arch-vega: Fix MUBUF out-of-bounds case 1
Ported from https://gem5-review.googlesource.com/c/public/gem5/+/51127:

This patch updates the out-of-bounds check to properly check
against the correct buffer_offset, which is different depending
on if the const_swizzle_enable is true or false.

Change-Id: I9757226e62c587b679cab2a42f3616a5dca97e60
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55464
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-18 15:20:10 +00:00
Matthew Poremba
0cb64ce9f0 arch-vega: Free dest registers in non-memory Load DS insts
Ported from https://gem5-review.googlesource.com/c/public/gem5/+/48019:

Certain DS insts are classfied as Loads, but don't actually go through
the memory pipeline. However, any instruction classified as a load
marks its destination registers as free in the memory pipeline.

Because these instructions didn't use the memory pipeline, they
never freed their destination registers, which led to a deadlock.

This patch explicitly calls the function used to free the destination
registers in the execute() method of those Load instructions that
don't use the memory pipeline.

Change-Id: I8231217a79661ca6acc837b2ab4931b946049a1a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55463
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-17 23:55:51 +00:00
Austin Harris
41ee8ec7d8 mem: implement x86 locked accesses in timing-mode classic cache
Add LockedRMW(Read|Write)(Req|Resp) commands.  In timing mode,
use a combination of clearing permission bits and leaving
an MSHR in place to prevent accesses & snoops from touching
a locked block between the read and write parts of an locked
RMW sequence.

Based on an old patch by Steve Reinhardt:
http://reviews.gem5.org/r/2691/index.html

Jira Issue: https://gem5.atlassian.net/browse/GEM5-1105

Change-Id: Ieadda4deb17667ca4a6282f87f6da2af3b011f66
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52303
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-17 15:15:24 +00:00
Gabe Black
ef4381aecc dev: Refactor how counters are set up in the 8254 timer.
Instead of dynamically allocating the channels, statically allocate them
in a std::array. Also name them "counters" instead of "counter" so that
that variable name can be used for an individual counter.

Change-Id: I49614e192c8201b708e71331e7f70182b47546c6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55284
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-01-16 03:43:58 +00:00
Gabe Black
6f843a918b sim,configs: Default m5ops_base to 0 (disabled) on x86.
This is already the default for other platforms. This is most important
when using KVM, where this mechanism is the only way to trigger pseudo
instructions, or in SE mode to also trigger system calls.

Change-Id: I0094e6814898ba397c7425e0fe76d84853bb17ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52498
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 23:17:31 +00:00
Gabe Black
d3a323a72c arch-x86: Make x86 respect m5op_base in SE mode.
In SE mode, we can reasonably hard code what virtual address the m5ops
show up at since that's private to the process, but we should respect
the external setting of what physical address to use.

Change-Id: I2ed9e5ba8c411e22e1d5163cf2ab875f9e2fe387
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52496
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 12:27:19 +00:00
Gabe Black
1b0852ed30 arch-x86: Bare metal workload.
Change-Id: I9ff6f5a9970cc7af2ba639be18f1881748074777
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45045
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 08:40:06 +00:00
Gabe Black
c2c4303a07 arch-x86: Use 16 bit modRM encoding if address size is 16 bit.
The modRM byte should be interpreted with 16 bit rules if the address
size is 16 bits, whether that's because the address size is that by
default, or because it was overridden. It should not be based on the
operand size in any case.

Change-Id: I8827abe1eea8905b0404f7402fb9531804d63fae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55503
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:59:41 +00:00
Gabe Black
69010fd0c9 arch-x86: Keep all the IOAPIC entries masked at startup.
There are two entities setting up the IOAPIC when the simulation is
started, the IOAPIC itsef, and the PC platform object. It's probably not
a good idea (and definitely confusing) to have this initialization
happening in two places.

For now at least, lets make the PC platform object mask the IOAPIC lines
at startup like the IOAPIC is doing. This will help prevent spurious
interrupts from being delivered to the CPU during startup.

Change-Id: I10f455d8e0fca28ddaf772c224a32c1f5f2dd37b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55452
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:59:25 +00:00
Gabe Black
c17d68f739 arch-x86: In the LVT in the local APIC, start with all entries masked.
This is what the APIC is supposed to look like when coming out of reset.

Change-Id: Ia9b6e13533692109849e729d9ad3b358f36e2e47
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55451
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:59:10 +00:00
Gabe Black
7b01dbd926 arch-x86: Implement real mode far ret.
Change-Id: I4fd3210f30246f19ca03906465f160bcbfbfbccc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55450
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:58:52 +00:00
Gabe Black
c22ec209d8 arch-x86: Split out and implement INT for real mode.
The INT instruction is much simpler in real mode than it is in legacy
protected mode.

Change-Id: I79f5bc7ebe36726537cd61657f301905085c1199
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55449
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:58:37 +00:00
Gabe Black
cfce0ad874 arch-x86: Implement IRET for real mode.
The IRET instruction is comparitively very simple in real mode. It just
pops a few values off the stack into CS, RIP, and RFLAGS, and sets the
CS base.

Change-Id: I2bc6015209f1beca31253e288dad7c8de5cd22fc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55448
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:58:25 +00:00
Gabe Black
2572b85f54 arch-x86: Hook up the PUSH segment selector insts in the decoder.
Change-Id: Id4d59ced3f74a593bb6b0774b843f5dc155c49c5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55447
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-01-15 07:58:09 +00:00
Gabe Black
75f77d8fd3 arch-x86: Implement the PUSH instruction for segment selectors.
The implementation for PUSH is very simple and can be implemented
trivially like the other PUSH versions. POP is more complicated since it
needs to actually set up the segment being popped into.

Change-Id: I4a5a4bcace15aef02186f893ccdd052083e5cb5d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55446
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-01-15 07:57:52 +00:00
Gabe Black
10118f7518 arch-x86: Add decoder syntax for fixed segment registers.
There is syntax for this already for fixed integer registers, which this
is patterned after. Rather than prefixing the operand descriptor with a
lower case "r", fixed segment registers are prefixed with a lower case
"s".

Change-Id: Ic08d323bef732a62de23f77ec805c8b7cd5e2303
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55445
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 07:57:30 +00:00
Gabe Black
25b046f4d4 arch-x86: Fix disassembly of fixed register macroops.
These are mapped to instruction definitions like MOV_R_R, even though
one or more of the Rs might have come from a fixed value. Because
MOV_R_R (for instance) is only defined once, using a fixed text constant
there won't work because that can only have one value.

Instead, use a variable which will have the value of that constant so
that the same disassembly code will work no matter what fixed value was
used.

Change-Id: Ie45181c6becce80ad44fa30fc3323757ef713d7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55444
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-01-15 07:57:17 +00:00
Gabe Black
864650101b arch-x86: Handle a special case for MODRM in 16 bit mode.
When the address size is 16 bit, the mod field is 0, and the rm is 6,
there is no base register, only a displacement.

Change-Id: Ib67a6e5ce617d08913b9ca6dee66877f0154ffe1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55285
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 01:54:09 +00:00
Gabe Black
946edc794f arch-x86: Implement count latching with the PIT read back command.
This command can trigger count latching for any of the PIT channels
together with a single command, and can also latch a status byte. The
status byte is not implemented here, but there is already functionality
for latching the count which this can use.

Change-Id: Ic2ad7c73d0c521fdd6fe5f62cb478c6718f3b90c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55283
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 01:53:01 +00:00
Gabe Black
3a19fa4d8d arch-x86: Plumb up more of the i8237 DMA controller.
The device still can't actually do any DMAing, but now it's interface is
plumbed up so that it should work as expected up to the point where it's
asked to DMA something. Then it will panic as before.

Change-Id: I06a163a9a963bf87405e24fc5ceebe14f186adfd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55248
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 01:45:36 +00:00
Gabe Black
01333c73de arch-x86: Fix real mode far jumps with set MSB in the offset.
When performing a real mode far jump, we were computing the offset into
the segment more or less correctly, but then when we tried to actually
set the PC using it, we used the second of the two wrip microop
arguments. The first argument is an unsigned value and is intended to be
a base to work from when figuring out the new IP, and the second
argument is a signed offset which can be used to implement relative
jumps/branches. When we used the second operand for our new value,
setting the first operand to t0 (the zero register on x86), we would
inadvertantly sign extend it since the wrip instruction would treat it
as a signed value.

Instead, we can just switch the two operands so that the wrip microop
treats the desired value as the unsigned base, and then adds a signed t0
to it, which will still be 0 one way or the other.

Also, while researching this bug, I found that the size used for
computing the new IP is always the operand size, and never the address
size. This CL fixes that problem as well by removing the faulty
override.

Change-Id: I96ac9effd37b40161dd8d0b634c5869e767a8873
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55243
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-15 01:44:38 +00:00
Earl Ou
186ba92504 fastmodel: make gem5 fastmodel build hermetic
This CL makes fastmodel RPATH relative to $ORIGIN instead of absolute
path. In this way we can move build folder (installing), without
breaking gem5 run.

Change-Id: I8b16d749252b982e45dfe779a5df931015a0e07d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55085
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-14 14:40:14 +00:00
Alex Richardson
f9f86cc366 arch-riscv: Consistently check privilege mode for CSR accesses
According to the RISC-V privileged spec (section 2.1), bits 8 and 9 of
the CSR number encode the lowest  privilege mode that is permitted to
access the CSR. Commit 55e7d3e5b6 added
this check for for CSR_MSTATUS but none of the other CSRs.

Change-Id: Iecf2e387fa9ee810e8b8471341bfa371693b97c5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55404
Reviewed-by: Nils Asmussen <nils.asmussen@barkhauseninstitut.org>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-13 10:44:48 +00:00
Alex Richardson
bd687d48eb arch-riscv: Add an ostream operator for PrivilegeMode
This makes it easier to use the current privilege mode in error messages.

Change-Id: I425d45d3957a70d8afb6cbde18955fae1461c960
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55403
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-13 10:44:48 +00:00
Gabe Black
93bebf86cc scons,sim: Eliminate the generated cxx_config/init.cc file.
This file populated the "cxx_config_directory" map from type names to
directory entry generating types. It used a comprehensive list of
includes of all SimObject headers, and a comprehensive list of the
generating types to fill everything in.

Instead, this change creates a new singleton helper class which, when
instantiated as a static member of a CxxConfigParams subclass, will
install a pointer to a CxxConfigDirectoryEntry to that map during global
object construction time.

Also, this change renames the map to cxxConfigDirectory which is in
compliance with the style guide, and puts it behind an accessor which
returns a static variable which is the actual map. This avoids any
problems that might come from global object construction order.

Change-Id: Iaa913fbe5af1b11d90ca618e29420eeb7cb0faed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49455
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-13 05:21:41 +00:00
Gabe Black
9f5806d44b scons: Handle most SimObject work right within SimObject().
This (mostly) avoids having to keep around a list of SimObjects to
process later. Unfortunately cxx_config/init.cc still depends on a
complete list of SimObjects, and so has to be set up after all SimObject
types have been accumulated.

Change-Id: I440fe7c0d3e9713f2e78332d9255769f3934a0c3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49454
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-13 05:21:41 +00:00
Gabe Black
b0f9375377 python,util: Pull enum hh|cc generation out of the MetaEnum class.
Change-Id: Ibfcc2d6916318ffef806f74e57e3f8360489efb6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49452
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-13 05:21:41 +00:00
Gabe Black
4003ad7510 python,util: Pull CXX config generation code out of SimObject.
Change-Id: I94d6f5b172ab71ee8bedea854e1db9711748f313
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49451
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-13 05:21:41 +00:00
Gabe Black
c498d8bced cpu: Specialize CPUs for an ISA at the leaves, not BaseCPU.
The BaseCPU type had been specializing itself based on the value of
TARGET_ISA, which is not compatible with building more than one ISA at a
time.

This change refactors the CPU models so that the BaseCPU is more
general, and the ISA specific components are added to the CPU when the
CPU types are fully specialized. For instance, The AtomicSimpleCPU has a
version called X86AtomicSimpleCPU which installs the X86 specific
aspects of the CPU.

This specialization is done in three ways.

1. The mmu parameter is assigned an instance of the architecture
specific MMU type. This provides a reasonable default, but also avoids
having having to use the ISA specific type when the parameter is
created.

2. The ISA specific types are made available as class attributes, and
the utility functions (including __init__!) in the BaseCPU class can
refer to them to get the types they need to set up the CPU at run time.

Because SimObjects have strange, unhelpful semantics as far as assigning
to their attributes, these types need to be set up in a non-SimObject
class, which is then brought in as a base of the actual SimObject type.
Because the metaclass of this other type is just "type", things work
like you would expect. The SimObject doesn't do any special processing
of base classes if they aren't also SimObjects, so these attributes
survive and are accessible using normal lookup in the BaseCPU class.

3. There are some methods like addCheckerCPU and properties like
needsTSO which have ISA specific values or behaviors. These are set in
the ISA specific subclass, where they are inherently specific to an ISA
and don't need to check TARGET_ISA.

Also, the DummyChecker which was set up for the BaseSimpleCPU which
doesn't actually do anything in either C++ or python was not carried
forward. The CPU type still exists, but it isn't installed in the
simple CPUs.

To provide backward compatibility, each ISA implements a .py file which
matches the original .py for a CPU, and the original is renamed with a
Base prefix. The ISA specific version creates an alias with the old CPU
name which maps to the ISA specific type. This way, old scripts which
refer to, for example, AtomicSimpleCPU, will get the X86AtomicSimpleCPU
if the x86 version was compiled in, the ArmAtomicSimpleCPU on arm, etc.

Unfortunately, because of how tags on PySource and by extension SimObjects
are implemented right now, if you set the tags on two SimObjects or
PySources which have the same module path, the later will overwrite the
former whether or not they both would be included. There are some
changes in review which would revamp this and make it work like you
would expect, without this central bookkeeping which has the conflict.
Since I can't use that here, I fell back to checking TARGET_ISA to
decide whether to tell SCons about those files at all.

In the long term, this mechanism should be revamped so that these
compatibility types are only available if there is exactly one ISA
compiled into gem5. After the configs have been updated and no longer
assume they can use AtomicSimpleCPU in all cases, then these types can
be deleted.

Also, because ISAs can now either provide subclasses for a CPU or not,
the CPU_MODELS variable has been removed, meaning the non-ISA
specialized versions of those CPU models will always be included in
gem5, except when building the NULL ISA.

In the future, a more granular config mechanism will hopefully be
implemented for *all* of gem5 and not just the CPUs, and these can be
conditional again in case you only need certain models, and want to
reduce build time or binary size by excluding the others.

Change-Id: I02fc3f645c551678ede46268bbea9f66c3f6c74b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52490
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 15:59:27 +00:00
Alex Richardson
f4e84cd25e cpu-simple: Convert invalid access assertions to panic()
Currently, an access to an invalid address will cause GEM5 to exit with
a `!pkt.isError()` assertion failure. I was seeing this assertion while
running a baremetal RISC-V binary that faulted before the trap vector
had been configured and therefore tried to jump to address zero. With
this change we now print the invalid address and the type of access
(ifetch/load/store/amo) which makes debugging such a problem much easier.
For example, my faulting program now prints the following:
`panic: Instruction fetch ([0:0x4]) failed: BadAddressError [0:3] IF`
I also saw this assertion with a program that was dereferencing a NULL
pointer, which now prints a more helpful message:
`panic: Data fetch ([0x10:0x11]) failed: BadAddressError [10:10]`

Change-Id: Id983b74bf4688711f47308c6c7c15f49662ac495
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55203
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 15:34:39 +00:00
Yu-hsin Wang
a8c85b1c40 dev-arm: Mask el2_watchdog in VExpressFastmodel platform
el2_watchdog depends on SystemCounter. However, we have mask
system_counter in the platform. We should also mask the el2_watchdog
accordingly.

Change-Id: I2ed774549272438d654e0573ffe9f482a6659d37
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55306
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 08:07:43 +00:00
Yu-hsin Wang
1e0504cf4a fastmodel: Fix cluster build failed
FastModelCortexCluster subclasses don't have `type` property. They don't
need to be specified in sim_objects for generating *Params class.

Change-Id: Ic09e494042e05d68c890f9603b8b78a4a8d815a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55305
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 08:07:33 +00:00
Wing Li
ad7ff8e271 fastmodel: export wake request ports from GIC
Change-Id: I561ef876a4e873501ed2e9775b5bdb59707521a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54783
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 01:48:19 +00:00
Wing Li
301ddefa28 dev: define VectorIntSourcePin type
Change-Id: Ic457593cefb4f82794d3fe4c8c91931c1bf76a63
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55363
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 01:48:19 +00:00
Yu-hsin Wang
cd9fc30d92 dev-arm: Add missing sim_objects of VExpressFastmodel
Change-Id: Ic6a9e5f1381c6c6412faa6d19f1448ca0e08b1e7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55304
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-12 01:25:07 +00:00
Bobby R. Bruce
83b703c6b8 stdlib: Remove stdlib README.md
This README.md is outdated and incompleted. User's wishing to learn
about the gem5 stdlib should reference the gem5 website:
https://www.gem5.org/documentation/gem5-stdlib/overview

Issue-on: https://gem5.atlassian.net/browse/GEM5-1019
Change-Id: Ib66bd748d517708833ac591515601f206ce4728a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55323
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 22:51:29 +00:00
Gabe Black
df540f0dbf python,util: Pull param struct generation code out of SimObject.
Change-Id: I9f9c3b858a214650f6f07e6127bb316a227982a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49450
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 22:46:43 +00:00
Gabe Black
f42b198371 scons: Stop importing SimObjects into src/SConscript.
Get rid of the actual imports, and all the machinery which supports it.
Everything that had been using them is now handled using helper scripts
and/or the gem5py_m5 utility binary.

Change-Id: I079e50bdabef6d8d199caa80b589319d6419c4ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49429
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 22:46:43 +00:00
Gabe Black
19c7fe03ac scons: Generate cxx_config/init.cc using a helper script.
Change-Id: Ib0129fc5c2de3977f2dedc1bfec532bbedb2d20e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49428
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 22:46:43 +00:00
Gabe Black
ee8ad3f8eb scons: Generate cxx config wrappers using a helper script.
Change-Id: I003426881dc0fd8a338048abbdfa05a606221c39
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49427
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 22:46:43 +00:00
Gabe Black
a8d7a41f9f scons,util: Use external helper scripts to build enum hhs and ccs.
Change-Id: Id5cfca9ca7848394baff39c76a4ed0edbec61573
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49426
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 22:46:43 +00:00
Matthew Poremba
d6bd91a9fd arch-vega: Implement large ds_read/write instructions
Port large DS read/write instructions from
https://gem5-review.googlesource.com/c/public/gem5/+/48342.

This implements the 96 and 128b ds_read/write instructions in a similar
fashion to the 3 and 4 dword flat_load/store instructions.

These instructions are treated as reads/writes of 3 or 4 dwords, instead
of as a single 96b/128b memory transaction, due to the limitations of
the VecOperand class used in the amdgpu code.

In order to handle treating the memory transaction as multiple dwords,
the patch also adds in new initMemRead/initMemWrite functions for ds
instructions. These are similar to the functions used in flat
instructions for the same purpose.

Change-Id: Iee2de14eb7f32b6654799d53dc97d806288af98f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55344
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 16:58:09 +00:00
Matthew Poremba
5a94e73d00 arch-vega: Validate if scalar sources are scalar gprs
Port the fixes for scalar source checks from arch-gcn3 at
https://gem5-review.googlesource.com/c/public/gem5/+/48344.

Scalar sources can either be a general-purpose register or a constant
register that holds a single value.

If we don't check for if the register is a general-purpose register,
it's possible that we get a constant register, which then causes all of
the register mapping code to break, as the constant registers aren't
supposed to be mapped like the general-purpose registers are.

This fix adds an isScalarReg check to the instruction encodings that
were missing it.

Change-Id: I30dd2d082a5a1dcc3075843bcefd325113ed1df6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55343
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 16:58:09 +00:00
Yu-hsin Wang
dc48de5e62 configs: Fix parameters change when WalkCache is removed
Change-Id: I3e8d2ae60e64d18462f6782484be500c5c514003
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55303
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 02:11:56 +00:00