Commit Graph

18526 Commits

Author SHA1 Message Date
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
Yu-hsin Wang
614b608a08 fastmodel: Add an example reset controller for IrisCpu
The example reset controller provides a register interface to config
RVBAR and ability to reset the core.

Change-Id: I088ddde6f44ff9cc5914afb834ec07a8f7f269fa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54065
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-11 02:11:40 +00:00
Gabe Black
e5187e279a tests: Decrease the iterations of the checkpoint test to 3.
Currently, the test in realview64-simple-atomic-checkpoint.py runs the
default number of checkpoint cycles which is 5. Each of these cycles
takes a long time to run (approximately 5 minutes) which makes this test
take a long time to run to completion. We would get almost all of the
benefit of this test in a fraction of the time if we reduce the number
of iterations down to 3. This still has enough iterations to catch bugs
which would happen in one, a different class of bugs which happen when
checkpointing more than once, and even a third iteration for safety.
Because this test is one of the (if not the) most time consuming test in
the quick tests, reducing its length will significantly improve turn
around time when running all those tests.

That is especially valuable when running the tests multiple times to try
to iterate on a bug, or when sweeping through a series of changes trying
to identify the source of breakages. In cases where we might need to
identify failures which don't effect the end product of a series, ie where
a problem is introduced and then coincidentally fixed in a later change,
this is especially important since every individual change needs to be
checked, not just log(n) of the changes like in a binary search.

Ideally in the future we will also try to figure out why taking and
restoring from checkpoints takes so long so that each iteration of this
test is substantially less expensive. If we do that, we could consider
increasing the iteration count again.

Change-Id: Icfa2a391a4a7457d893f2063fab231d22e572deb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53123
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-01-09 14:10:55 +00:00
Bobby R. Bruce
7c882f7d15 base: Add missing ']' in version ID
Change-Id: I73ac530fde2fff29022aa800f4de925709d9c2f5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55184
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-07 19:06:44 +00:00
Bobby R. Bruce
5e3c64da4e base: Improve ImageFileData's error when file failed to open
When a user accidentally specifies the wrong path to a file, the
following error is received:

```
build/X86/base/loader/image_file_data.cc:111: panic: panic condition fd < 0 occurred: Failed to open file {path}.
```

For new users to gem5 this is confusing, and does not explicitly state
that the root cause of the issue is likely due to the path being
incorrect. Due to use of `panic_if`, this error was followed by a long
and unhelpful backtrace.

This patch expands the error message to state this error is typically
triggered when the specified path is incorrect. It also changes the
`panic_if` to a `fatal_if`. As noted in `src/base/logging.hh`, a
"panic() should be called when something happens that should never ever
happen", while a "fatal() should be called when the simulation cannot
continue due to some condition that is the user's fault". It is clear a
`fatal_if` is more suitable here as it is typically a user error. A
backtrace is not printed for `fatal`, only for `panic`.

Change-Id: I6e0a9bf4efb27ee00a40d77d74fd0dc99f9be4f8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55183
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-07 19:06:44 +00:00
Alistair Delva
791da53cf8 configs: Add support for initrd/initramfs
Allow the user to specify the path to an initrd/initramfs file which
will be loaded in memory after the DTB. The load address for this data
will be passed to Linux via DeviceTree.

Change-Id: I52e12b9b88ab415fe3b318a6359026651667f3c6
Signed-off-by: Alistair Delva <adelva@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54186
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-05 23:07:07 +00:00
Alistair Delva
75cd1ff764 dev-arm: Add RealView support for initrd/initramfs
Update the RealView bootloader simulator to set up the initrd_addr. The
load address is derived from the dtb_addr plus the maximum allowable DTB
blob size.

Change-Id: I2eaeb1ade38d24ad8e02230cc99d12873c2f56f9
Signed-off-by: Alistair Delva <adelva@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54185
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-05 23:07:07 +00:00
Alistair Delva
cb7799648b arch-arm: Add support for initrd/initramfs
Add initrd_filename and initrd_addr parameters to specify that an
initrd/initramfs should be loaded into memory from a file, just like the
DTB blob. The user must specify the initrd file, and they can specify
the initrd load address as well. However, in practice, it's expected
that the dev/machine backend will derive the initrd load address from
the dtb load address, which is how a bootloader would typically do it.

Change-Id: I6378927c2984b7ccdd1471486dd7803500ef5883
Signed-off-by: Alistair Delva <adelva@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54184
Reviewed-by: Richard Cooper <richard.cooper@arm.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-05 21:38:34 +00:00
Alistair Delva
5af49d03da base: Add support for DT initrd/initramfs
Add a new API function, addBootData(), which allows the ports to specify
the size and load address of the initrd/initramfs via DeviceTree. This
uses the standard chosen nodes for initrd-start/initrd-end.

Update the addBootCmdline() to call addBootData() with no
initrd/initramfs so as to maintain backwards compatibility.

Change-Id: I7b1d5cf2a0b18685eaadf1d881434f3d48c45d8b
Signed-off-by: Alistair Delva <adelva@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54183
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-05 21:38:34 +00:00
Eric Ye
f894de5486 scons: Try to fix build dependency bug when generating fastmodels
Bug: 201084562
Change-Id: I33cc9e09b1ce46f80864d75f088a2534949e55e1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55043
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-05 15:29:32 +00:00
Alex Richardson
5ac54aab7e misc: Generate StateMachine debug includes in deterministic order
Since 3454a4a36e the order of the debug/
includes is non-deterministic which can result in unnecessary rebuilds.

Change-Id: I583d2caf70632e08fa59ac85073786270991edbc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54983
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-05 10:15:55 +00:00