Commit Graph

1102 Commits

Author SHA1 Message Date
Jerin Joy
aee1622a6c arch-riscv: Added the Zba and Zbb bitmanip instructions
Zba instructions added:
add.uw, sh1add, sh1add.uw, sh2add, sh2add.uw, sh3add, sh3add.uw, slli.uw

Zbb instructions added:
andn, orn, xnor, clz, clzw, ctz, ctzw, cpop, cpopw, max, maxu, min,
minu, sext.b, sext.h, zext.h, rol, rolw, ror, rori, roriw, rorw, orc.b, rev8

Changes based on spec:
https://github.com/riscv/riscv-bitmanip/releases/download/1.0.0/bitmanip-1.0.0.pdf

Change-Id: I056719f62eee89e0f085d1bf1fa182f9dfe614d8
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58630
Reviewed-by: Luming Wang <wlm199558@126.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-04-13 20:09:59 +00:00
Gabe Black
8a91e933e8 scons: Use the 'png' tag for the PNG library.
Use that instead of checking HAVE_PNG manually.

Change-Id: I70876982c2506bee1173341fa100f5fae2ae4302
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58709
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-04-07 20:47:23 +00:00
Gabe Black
e6c0ba97db scons: Put all config variables in an env['CONF'] sub-dict.
This makes what are configuration and what are internal SCons variables
explicit and separate, and makes it unnecessary to call out what
variables to export to C++.

These variables will also be plumbed into and out of kconfiglib in later
changes.

Change-Id: Iaf5e098d7404af06285c421dbdf8ef4171b3f001
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56892
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-28 20:31:21 +00:00
Jui-min Lee
75eedb1d0b mem: Add SharedMemoryServer
Add an utility class that provides a service for another process
query and get the fd of the corresponding region in gem5's physmem.

Basically, the service works in this way:
1. client connect to the unix socket created by a SharedMemoryServer
2. client send a request {start, end} to gem5
3. the server locates the corresponding shared memory
4. gem5 response {offset} and pass {fd} in ancillary data

mmap fd at offset will provide the client the view into the physical
memory of the request range.

Change-Id: I9d42fd8a41fc28dcfebb45dec10bc9ebb8e21d11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57729
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-28 08:26:44 +00:00
Gabe Black
c11dc40f06 arch-arm,base: Use SourceLib() in a few simple spots.
There are a couple places where SourceLib(), an interface to SCons's
LIB variable that respects tags, can be used simply in existing
SConscripts. Do that so that SourceLib is used, and as an example if
someone wants to see it in action.

Change-Id: Idb27da17724990093252b710f5f9fde8351a4bc5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58070
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-23 20:39:28 +00:00
Yu-hsin Wang
2ced661aed base: change bitunion default constructor to default
Current implementation prevents customers from performing zero
initialize on BitUnion class. Customers would get unexpected results
when writing `BitUnion{}`. Changing the default constructor to default
can solve this issue.

After changing the default constructor, the test failed with unused
variable. I also change one with zero initializer and make the other
with maybe_unused label.
```
tests/build/ARM/base/bitunion.test.cc:133:14: error: 'emptySixteen' defined but not used [-Werror=unused-variable]
  133 | EmptySixteen emptySixteen;
      |              ^~~~~~~~~~~~
tests/build/ARM/base/bitunion.test.cc:132:16: error: 'emptyThirtyTwo' defined but not used [-Werror=unused-variable]
  132 | EmptyThirtyTwo emptyThirtyTwo;
      |                ^~~~~~~~~~~~~~
```

Change-Id: Icbed36b3fa6751cbda63e84443eaab6d865d9bd6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57730
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-23 02:21:02 +00:00
Gabe Black
06117275fa scons: Make all sticky variables automatically exported.
All sticky vars are exported, but not all exported vars are sticky. The
vars which are exported but not sticky are (at least in general) found
with Configure() style measurement.

Change-Id: Idebf17e44c2eeca745cdfdd9f42eddcfdb0cf9ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56891
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-03-15 00:45:30 +00:00
Gabe Black
375236082d scons: Use env and not main in SConscripts.
"env" is the environment for the current variant, where "main" is the
environment that was derived from.

Change-Id: I71e30684aa82a297241820502f204400c89c80cf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56890
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2022-02-25 09:32:14 +00:00
Daniel R. Carvalho
0ea570c8a1 sim,tests: Add a tag for gem5 events
This tag can be used to determine which files are needed
when sim/eventq.hh is included in a header file. For
example, when declaring a unit test, this tag makes
the SConscript declaration much simpler.

Change-Id: If68ddf94975dbe9f7121fefb6051a8bbaca19c4b
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44107
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 10:24:54 +00:00
Jui-min Lee
9d63b391d2 base: Fix ListenSocket binding logic
The original implementation does not cleanup the socket after it failed
to listen. However, the API doesn't give our user a way to bypass the
bind part and the next try will always break at the bind call.
Furthermore, the next failure will be EINVAL instead of EADDRINUSE so
gem5 will just abort without giving any meaningful message.

In this CL we cleanup the socket if we failed to invoke listen, so the
user can retry with a clean state and even retry on another port.

Test: Try to launch two gem5 that both bind to gdb port (7000) and
    repeat it for 100 times.
Change-Id: I7272ea3c3b6ab56e4b904f3a3a45ed389d00dd05
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55943
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nathanael Premillieu <nathanael.premillieu@huawei.com>
2022-02-08 00:01:47 +00:00
Gabe Black
528d184ac7 misc: Linearlize VecElem indexing.
These registers used to be accessed with a two dimensional index, with
one dimension specifying the register, and the second index specifying
the element within that register. This change linearizes that index down
to one dimension, where the elements of each register are laid out one
after the other in sequence.

Change-Id: I41110f57b505679a327108369db61c826d24922e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49148
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-01-21 23:05:47 +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
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
Bobby R. Bruce
5e6a561a3f misc: Revert v21.2 specific commits for develop
These changes were made to the release staging branch for the v21.2
release. This commit reverts them for the develop branch.

Change-Id: I9f02470d00d5034a0797f32d4c1fe0e7055860a6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54904
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-12-28 21:30:21 +00:00
Bobby R. Bruce
065a7dbf1b misc: Merge branch release-staging-v21-2 into develop
Change-Id: I8200ac51c20117f63b51d555fa2f12e5dd35f22e
2021-12-26 23:59:41 -08:00
Bobby R. Bruce
bf2740096e base: Update the version to v21.2.0.0
Change-Id: Ib4b3d0a370498c59d6b56701bfa5018d8c1cb709
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54464
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-12-21 22:28:42 +00:00
Daniel R. Carvalho
0d1a40602f base: Finish deprecating SatCounter
SatCounter has been marked as deprecated for at least 2 versions,
so it can be removed.

Change-Id: Iffb75822cc0d09d8b7d9b86828b26198865ce407
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54523
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-12-20 21:55:01 +00:00
Yu-hsin Wang
46957f4337 base: Correct checkBpLen naming with checkBpKind
In gdb document*1, the second parameter of checkpoint command(Z0, Z1) is
named after kind. Although underlying implementation probably considers
it as length*2, it's still good to follow the name described in gdb
document for avoiding any confusion.

Refs:
1. https://sourceware.org/gdb/onlinedocs/gdb/Packets.html
2. https://github.com/bminor/binutils-gdb/blob/master/gdb/arch-utils.h#L41

Change-Id: Ib4b585613b8018970b16355f96cdff2ce9d5bae6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54123
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2021-12-16 13:26:39 +00:00
Gabe Black
1c233ee9d2 scons: Add sim_object and enums arguments to SimObject().
This will explicitly declare what SimObject and Enum types need to be set
up in C++, which will make importing all the SimObject modules during
the setup phase of SCons uneccessary.

Change-Id: Id2d7603daf33b236ceaa0789e2f089f589d34e62
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49406
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-12-08 08:01:23 +00:00
Chen Zou
a1c0436f40 base-stats: HDF5 calls with better compatibility
H5Object.getObjName() is added at HDF5 V1.8.13.
As an example, compilation error would be thrown on CentOS 7.
obj.getObjnameByIdx(obj.getId()) would work with older versions.

Change-Id: I104eaac050db7501ab3a1aa3ad6dc1ee8b8d7e22
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53283
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-12-07 15:28:01 +00:00
Gabe Black
2805f3dee1 misc: Stop including arch/pcstate.hh.
Change-Id: Ic9ea62ae9c59fd838175fd6af4c075101d46a0b1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52067
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-11-30 23:30:06 +00:00
Gabe Black
e7cd655f14 base: Set enableUnits in ScalarPrint declared in DistPrint::operator().
The setup() method of ScalarPrint, inherited from BasePrint, is not
called by its constructor, and is not called on the ScalarPrint "print"
in DistPrint::operator(). This sets most of the values in BasePrint.
Instead, this method sets these values itself based on the values of the
DistPrint itself.

Unfortunately it looks like this method forgot to set enableUnits, which
ends up otherwise uninitialized when the printUnits method is called.
This change fixes that.

Change-Id: Ib1ea78796539f6d9222d19dad597a4e64aa69808
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52483
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-05 22:56:48 +00:00
Yu-hsin Wang
0d64ec9a29 base: fix name setter doesn't pass correct stat style
There are two kinds of stats in the system. The old one requires an
unique name, while the new one requires an local name. The setName
function has a flag to specify the difference. In the constructor of
InfoAccess, it sets correct flag to the setName function. However, if
you set the name later with the setter, it wouldn't set the flag for
you. This leads the name conflict in new style stats with same local
name. We should also pass the correct flag in the name setter.

Change-Id: I0fcaad3cca65d0f2859c5f6cb28a00813a026a0c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52323
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-11-03 04:36:31 +00:00
Gabe Black
8304ed1967 base,arch-arm: Replace Stats namespace with statistics.
The Stats namespace is deprecated.

Change-Id: I17b1aa7fbced5db7b325e5339395281f3b3eda0b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51528
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-10-13 20:28:52 +00:00
Davide Basilio Bartolini
3d025b517f misc: Fix hdf5 stats + test
HDF5 stats file creation was not completing correctly due to name
clashes.

Change-Id: Ifc2d52f4bbc62b0c6798ce92f4d027b0ec69a373
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51061
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-10-12 06:03:21 +00:00
Bobby R. Bruce
b0c2b278a9 misc: Merge branch v21.1.0.2 hotfix branch into develop
Change-Id: I225dddd6ec1399528f4759a3c5c5e306d8c7a38c
2021-09-22 11:43:57 -07:00
Bobby R. Bruce
ca921387ae misc: Update the version to v21.1.0.2
Change-Id: I4013ed678b367f95bb0f69e4a827ad04995cc3c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50750
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 18:37:48 +00:00
CHEN Meng
59c4fd07cb base-stats: fix storage initializing
Commit (70194795c3) introduced std::vector with resize() to initializing all storages. This method caused data duplication in statistics. Storage is now initialized using loops.

Change-Id: I4350863a83671fc10cc02b5cb7d3b38e6cf4f565
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50747
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 18:37:48 +00:00
Daniel R. Carvalho
96c9d03fa6 base,tests: Add unit test for SymbolTable
Add a unit test for base/loader/symtab.*.

Change-Id: I81c14826ab629439897235cbaaf79047e603ff8d
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43250
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 15:47:37 +00:00
Daniel R. Carvalho
cbffe30e64 sim,tests: Add unit test for sim/serialize.hh
Add a unit test for sim/serialize.hh.

==Bugs==
arrayParamIn cannot parse strings with spaces. Since spaces
are used as delimiters, strings containing spaces are parsed
as multiple entries of the array. The test that checks for
this has been disabled.

==Unexpected Behavior==
Serialization has an unexpected behavior when returning to
previous scopes. For example,

  ...
  SCS scs(cpt, "S1")
  paramOut(cpt, "param1", integer1)
  {
    SCS scs_2(cpt, "S2")
    paramOut(cpt, "param2", integer2)
  }
  paramOut(cpt, "param3", integer3)

will generate the output:
  ...
  [S1]
    param1=1
  [S2]
    param2=2
    param3=3

But the user might expect:
  ...
  [S1]
    param1=1
  [S2]
    param2=2
  [S1]
    param3=3

==Incovenient Behavior==
arrayParamIn with a std::array parameter is slightly
incovenient, since the raw data pointer must be extracted.
It may be worth it to add a template specialization.

==Not Tested==
paramInImpl is not being directly tested because it should
not be used as an external API - paramIn and optParamIn
should be used instead.

arrayParamIn with an InsertIterator parameter is not being
directly tested because the other versions should be used
instead.

Change-Id: If0c8f045aa317790d5fcb32e48629b113b62efc5
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41337
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-22 05:31:01 +00:00
Gabe Black
e9b7f08abb base,python: Expand AddrRange exclude and add subtraction operators.
Expand exclude to work with an AddrRange or AddrRangeList, define
versions to exclude both from an AddrRangeList, and make all available
through subtraction operators. Add -= operators for AddrRangeList with
another AddrRangeList or AddrRange.

Change-Id: Ic48f0c45a4809dbc51e1d3133e8319134aabe29e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50347
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
2021-09-20 20:52:05 +00:00
Gabe Black
416939c5c2 misc: Use AddrRangeList more consistently in the AddrRange class.
We go through the trouble of defining an AddrRangeList typedef, but then
we don't use it consistently and use std::vector<AddrRange> instead.

This change converts the exclude method from using
std::vector<AddrRange> to AddrRangeList, and also adds a constructor
which takes an AddrRangeList.

Because there is a lot of code which uses the std::vector based
constructor, this change does not remove that method.

Change-Id: I1a03b25990025688aa760a67d3e7a2e8141384ce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50344
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-20 20:50:30 +00:00
Gabe Black
649ab2dc98 base: Make the AddrRange::exclude method const.
This should not modify the base AddrRange, and can be marked const.

Change-Id: I8554707ab8dd895d24891acff18013308ab779a6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50337
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
2021-09-16 20:42:41 +00:00
Gabe Black
7f9d9d336f base: Fix some style problems in addr_range.hh.
Change-Id: Ib55b86350c4bc3f1f44af996db25a1e44826d077
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50346
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
2021-09-15 20:19:42 +00:00
Bobby R. Bruce
082f0835b0 misc: Update the version to v21.1.0.1
Change-Id: I64055b88bc3ba3f1e104ad796abec6ff4a4b3b11
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50031
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-08 17:26:12 +00:00
Tom Rollet
fc045f9a6b scons: fix hook for 'deprecated' attribute
On the new release, the compilation is polluted by the same warning:
    > ''deprecated' attribute directive ignored

It seems that the hook added in this patch does not work:
https://gem5-review.googlesource.com/c/public/gem5/+/45246/1..7

The snippet of code compile with TryCompile on g++{8,9}.
It probably comes from the fact that the compilation
only creates a warning and not an error.

By adding temporarily '-Werror' for this compilation test,
it filters the faulty gcc versions.

Change-Id: I2b8b7a1a7e06df437b76e98d212947f4f9452311
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48843
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
(cherry picked from commit a366e66272)
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50028
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2021-09-08 17:26:12 +00:00
Nicolas Boichat
729eea73a4 base: Remove SOCK_CLOEXEC from socketCloexec.
63c53e21fe ("base: Add SOCK_CLOEXEC when creating/accepting sockets")
accidentally left SOCK_CLOEXEC as socketCloexec parameter, remove
it as socketCloexec will add that parameter, and it'll not compile
on platforms that do not provide the flag.

Change-Id: I30e6fa1824b0258a325b53422585a9a362de4dff
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49947
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-09-06 23:58:56 +00:00
Gabe Black
77a0372fe9 scons,debug: Implement the "All" flag in C++ and not scons.
Create an AllFlagsFlag class which inherits from the CompoundFlag class.
This class is a singleton, and the SimpleFlags install themselves in it
instead of having SCons collect them.

The allFlagsVersion global variable was supposed to be for debugging
according to a comment, but was actually an important part of the "All"
flags inner workings. It was not exposed in the header, but was
redefined/pulled through in src/python/pybind11/debug.cc. The
AllFlagsFlag class now tracks that value, and it can be accessed without
reaching behind the curtain.

This also somewhat decentralizes the debug flag building process in
SCons. The debug/flags.cc still includes all flags at once which
centralizes them, but at least now the "All" flag won't also.

Change-Id: I8430e0fe9022846aade028fb46c80777169a2007
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48370
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nathanael Premillieu <nathanael.premillieu@huawei.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2021-09-05 17:13:53 +00:00
Nicolas Boichat
63c53e21fe base: Add SOCK_CLOEXEC when creating/accepting sockets
Prevents any forked process (e.g. diod) from holding on the sockets
if gem5 crashes.

This flag is only supported on Linux, so we stub it out on other
platforms.

Test: ls -l /proc/$DIOD_PID/fd shows a lot less fds.
Change-Id: I6bc195ed3bd638ab28ff7690f43afce030fa28c7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48623
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-31 00:15:33 +00:00
Gabe Black
548987217f mem,base: Fix signed/unsigned comparison warnings/errors.
Change-Id: Icf477f4b0c162f0174216e511960d0e76db313ae
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49616
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-28 04:18:12 +00:00
Gabe Black
b8b9db1508 base: Extend gem5_assert to subsume chatty_assert.
If given more than just its condition, gem5_assert will assume it
should act like chatty_assert.

Because we have our own custom assert now anyway, we can fold the
behavior of both into one macro and make life easier for users.

Deprecate chatty_assert.

Change-Id: I43497b5333802a265c0ad096681f64ab6f0424b1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48606
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-21 00:54:48 +00:00
Bobby R. Bruce
d8da636bbb tests: Fix ExcludeInterleavingRanges test for .fast comp
Change-Id: Ie3ebfc0caa52f11649f479066022734ac82e6d1b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49065
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-09 22:40:56 +00:00
Jan Vrany
db9e64a570 base: handle initial communication with GDB in attach()
When remote GDB attaches to gem5, handle the initial communication
(`qSupported` and alike) right away instead of scheduling a `DataEvent`
and firing the simulation loop in hope that GDB will be quick enough to
send initial packets before instructions are dispatched.

This requires attach() to be always called at instruction boundary
to make it safe to interact with the rest of gem5.

When `--wait-gdb` is used, connect() is called from workflow startup,
therefore on an instruction boundary and therefore needs not special
handling.

To handle case the GDB connects while simulation is already running,
we arrange (new) assynchronous IncommingConnectionEvent on listening
socket that, when there's a new connection being made, *only* schedules
*synchronous* ConnectEvent that handles the rest, *including* calling
an accept() on listening socket. This way it is safe to process commands
in attach().

In order to make the code more systematic and easier to understands,
detach() is also made to be called only synchronously (that is, at
intruction boundary). Asynchronous events and event handlers are
prefixed with "incoming".

This seems to fix the race described in 44612 [1]

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

Change-Id: I33b2922ba017205acabd51b6a8be3e6fb2d6409a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48182
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Boris Shingarov <shingarov@labware.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-05 08:43:20 +00:00
Jan Vrany
6ed6f9c807 base: Extract GDB command processing into separate function
Change-Id: I1f090285f92752d6907044b9ee6ade1869a2cb9f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48181
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-05 08:43:20 +00:00
Giacomo Travaglini
19f2fd376b base: Add an exclude method to the AddrRange class
This will allow us to define a list of ranges provided an exclude
pattern, which is handy when a fragmented memory map is present

Change-Id: Ib3d76ef178355585d80e9e600b7c60e66efa01c1
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48903
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-04 09:18:40 +00:00
Yu-hsin Wang
636d0c3745 base: improve gdb exception information
Even it is an unknow exception for GDB, we still can try to cast it
to std::exception and print some information from `what()`.

Change-Id: Ie0cdc978eb1b3e130bc2153eae99025dcd0109f7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48825
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-08-02 02:07:17 +00:00
Tom Rollet
a366e66272 scons: fix hook for 'deprecated' attribute
On the new release, the compilation is polluted by the same warning:
    > ''deprecated' attribute directive ignored

It seems that the hook added in this patch does not work:
https://gem5-review.googlesource.com/c/public/gem5/+/45246/1..7

The snippet of code compile with TryCompile on g++{8,9}.
It probably comes from the fact that the compilation
only creates a warning and not an error.

By adding temporarily '-Werror' for this compilation test,
it filters the faulty gcc versions.

Change-Id: I2b8b7a1a7e06df437b76e98d212947f4f9452311
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48843
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-30 16:22:26 +00:00
Bobby R. Bruce
cec0d074a4 misc: Updated gem5 versioning information for develop branch
Change-Id: I17382ac18dcdce4cdf8c3366886cd41fbcd7d946
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48813
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2021-07-30 04:44:09 +00:00
Jason Lowe-Power
eb24bca44e Merge "misc: Merge branch 'release-staging-v21-1' into develop" into develop 2021-07-30 04:44:09 +00:00