Commit Graph

633 Commits

Author SHA1 Message Date
Gabe Black
7deb34b24d util: Delete util/batch, util/pbs, and util qdo.
The util/pbs directory has a set of python scripts which were written to
submit jobs to the PBS pool at the University of Michigan. They aren't
incredibly specialized for that environment, but they do have a little
bit of hard coding which, for instance, uses paths which are only
meaningful there.

The util/batch directory was added alongside a seemingly unrelated
change (perhaps by accident?) and is a slightly updated copy of util/pbs
which also (or instead?) supports OAR.

The qdo script seems to be a script for managing job queues on PBS
and/or OAR, and is also tuned to the UofM environment, for instance
insisting that a path starts with /n/poolfs so that files are available
on an NFS volume shared with the pool.

All three of these scripts could potentially be useful with modification
in a similar environment, but also all three are unmaintained. The
environment in UofM may no longer actually match the expectations of
these scripts, and even if it does/did, gem5 may no longer be 100%
compatible with them.

If these scripts sit in util not being used by anyone, they add clutter
and complexity without adding any value. If someone really needs to know
what was once in them, they can be recovered from revision control.

Change-Id: I0192bd119893f7a41fcb820f4cf408609b03cd27
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30957
Reviewed-by: Steve Reinhardt <stever@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.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>
2020-07-07 05:05:52 +00:00
Hoa Nguyen
835c07eb0f util: Add missing iostream header to util/m5/src/commands.cc
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I93f99284ecda22c73572cc0ffa8c3be0160ce560
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30734
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-06-27 00:48:13 +00:00
Gabe Black
8e0b1d3378 util: Move the call type implementations into their own subdir.
Change-Id: Ie94c2ef4783b6b5700beb0f0bbeb765ce9b03934
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27551
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2020-06-26 02:36:48 +00:00
Gabe Black
4ba0cf1160 util: c++-ify command line arguments in the m5 utility.
Change-Id: Icfdd95c61ac9937823027563d086e5a690870fb4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27550
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
2020-06-26 02:36:48 +00:00
Gabe Black
276a449171 util: c++-ify the call type in the m5 utility.
Use a class to track call type information, and mostly avoid having to
use ifdefs to include or not include support for individual call types.

Change-Id: I731c99e67ea1c511d53431df3f77b4a959919a59
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27549
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
2020-06-26 02:36:48 +00:00
Gabe Black
4b0162342b util: Convert the m5 utility to C++.
This will make it possible to use the googletest unit testing framework,
and will let us use c++ mechanisms to simplify and streamline the code.

Change-Id: I8ab358de47ce6b5c2d601cc0b9f2a694b2037a9b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27548
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
2020-06-26 02:36:48 +00:00
Gabe Black
f5b5090be1 util: Pull most code out of m5.c.
By pulling the code out, this code can be tested by unit tests.

Change-Id: I2d0510995d3e97d721f1de3024120f0c90b7a5ba
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27547
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
2020-06-26 02:36:48 +00:00
Bobby R. Bruce
25b5f5dfa1 python,util: Fixed string decoding in include verifier
The Python2 <-> Python3 port included a decode on a string as part of
the include statement git-hook verifier. This results in a failure. To
fix this issue, the file to be checked is opened in binary mode.

This issue was highlighted by Gabe Black here:
https://gem5-review.googlesource.com/c/public/gem5/+/28588

Change-Id: I9a30ecc24d4741853ed1c2d0c03addf57c3e5b6c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30336
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-06-25 23:48:10 +00:00
Kyle Roarty
14a9d1f2e6 util: Update MIOpen version used in Docker
The updated MIOpen version uses rocBLAS instead of MIOpenGEMM for
both convolution and rnn GEMM kernels, which provides a speedup in
simulation.

Change-Id: I4b81f18e95d39fd79b22d0bf92563ede61e44e32
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30494
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-06-24 04:06:25 +00:00
Gabe Black
64cf2f4b84 util: Add a semihosting implementation to the aarch64 m5 utility.
This will allow it to work on CPUs that only support semihosting like
ARM's fastmodels.

Change-Id: I74e536d79d0f77b864e1e4b9d73e265b6d0b1fcb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27245
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-06-22 08:33:17 +00:00
Gabe Black
24b4aeb726 util: Allow overriding the magic address in the m5 utility.
This is useful in situations where the address is hard to know ahead of
time, for instance on ARM systems where the address map is hard to
predict.

The default address is now M5OP_ADDR, or 0 if that's not defined.

Change-Id: I3140e05b04365c1a76e52f8c3dc85f472c230ae4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27244
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2020-06-22 08:33:04 +00:00
Tony Gutierrez
9d51dec937 arch, gpu-compute: Remove HSAIL related files
Change-Id: Iefba0a38d62da7598bbfe3fe6ff46454d35144b1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28410
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-06-17 02:53:47 +00:00
Giacomo Travaglini
7ce081d583 misc: Remove any reference to the ALPHA ISA
Change-Id: Ie761cd69ae0e8e632ca2b92e63a404e8804f0e6f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30015
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-06-08 09:00:55 +00:00
Bobby R. Bruce
e53de444f6 misc: Merge branch 'release-staging-v20.0.0.0' into develop 2020-05-28 01:04:16 -07:00
Richard Cooper
49ae60abe4 misc: Fix util/gem5img.py for new versions of sfdisk
Newer versions of sfdisk have changed the format of the dump output,
as well as the options for partitioning a disk.

Updated the gem5img.py script to work with the new version of sfdisk.
The script should still work with older versions of sfdisk, but this
has not been tested (see https://askubuntu.com/a/819614).

Tested on Ubuntu 18.04.2 LTS with sfdisk from util-linux 2.31.1.

Change-Id: I1197ecacabdd7caaab00327977fb9ab6eae06654
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29472
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-27 10:03:36 +00:00
Kyle Roarty
fc5e23c5c7 util: Add dockerfile for GCN3 w/machine learning
This dockerfile creates an image that installs the software stack needed
to run both machine learning and non-machine learning applications using
the GCN3 gpu model, while also applying patches to the software stack to
optimize machine learning applications, as well as APUs, which is the
current type of GPU in the GCN3 GPU model.

Change-Id: If36c2df1c00c895e27e9d741027fd10c17bf224e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29192
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-21 05:30:38 +00:00
Gabe Black
e850d3f4c7 util: Pull argument parsing functions out of m5.c.
Make them available in other files as well.

Change-Id: I3ddaed1a06023f929acc95c90f8f9adda7ff429c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27243
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
2020-05-18 04:03:38 +00:00
Jason Lowe-Power
ea91211f27 util: Update style file->open for python3
Change-Id: Ibcce194b1905f0e7f29aa91fd0ff881ba879ad51
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29068
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2020-05-14 16:48:57 +00:00
Bobby R. Bruce
fcca5f3030 misc: Added missing optional dependencies to 18.04 Docker
Change-Id: Ibc43664f99ce9fbd28d14352243fb17b7754289b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28892
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-12 20:39:21 +00:00
Bobby R. Bruce
66c5aa5fbf misc: Added python-six as a dependency in 18.04 docker
Previously the docker utilized Python-Pip. This is an intermediate
dependency we don't need. We can install the Python-six module directly
via the APT framework.

Change-Id: I30e3e1cdca802ca19422140f39af7dc9dc166ed7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28891
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-12 20:39:21 +00:00
Bobby R. Bruce
30c58a20cc misc: Removed python3 Dockerfile
This was previously used to test gem5 being compiled and run in a
Python3 environment. This is redundant with the introduction of
"util/dockerfiles/ubuntu-20.04_all-dependencies", which uses python3
exclusively.

Change-Id: Ie837da338c3985ba92aff84144948a23fd6ece3f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28890
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-12 20:39:21 +00:00
Bobby R. Bruce
69e7866785 misc: Added Dockerfile for Ubuntu 20.04
This Dockerfile creates an image which simulates an Ubuntu 20.04
environment. Unlike the Ubuntu 18.04 Dockerfile, this does not use
Python2. It uses exclusively Python3. Ubuntu 20.04 has Python3 installed
by default. The image this Dockerfile creates can be obtained from
"gcr.io/gem5-test/ubuntu-20.04_all-dependencies". To pull:

docker pull gcr.io/gem5-test/ubuntu-20.04_all-dependencies

Change-Id: I73b51028e0d6a3198aa6e7b1906d20ed6eb6c815
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28889
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-12 20:39:21 +00:00
Giacomo Travaglini
58a797d36c util: Make cpt_upgraders python3 compatible
It won't be possible to build gem5 in a python3 only environment
otherwise since the cpt_upgrader.py script is automatically run at the
end of compilation

Change-Id: Iea4217e5cd64ca44b99aa0db5dabfdced7aeb3ea
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28587
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-06 08:15:15 +00:00
Giacomo Travaglini
86454a3539 util: Port git hooks to python3
This involves changing:
* git-commit
* git-pre-commit
* style verifiers

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

Change-Id: I7bd0b54469f942bf927c8be1fd94d12f67594d48
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28588
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-06 08:15:15 +00:00
Gabe Black
40b79073f0 util: Add support for multiple call types in the m5 utility.
Using mechanisms added in previous CLs, this change modifies the m5
utility so that it can use any of the back ends enabled and implemented
by each variant, defaulting to one particular implementation if not is
selected explicitly.

On x86, the default mechanism is the magic address. All other variants
default to the magic instruction since they don't have a well
established address to use or even in most cases an implementation to
use.

The ability to override the particular magic address the utility wants
to use (necessary on variants such as aarch64) will be added in a future
CL.

Change-Id: I5fc414740e30759e7dde719cddcc8d5d41f8cc74
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27242
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-05-02 06:11:26 +00:00
Tony Gutierrez
94f15bd3f7 arch-gcn3: Add files for arch gcn3 (GPU machine ISA)
Decoder: gpu_decoder.hh and decoder.cc:
    The decoder is defined in these files. The decoder
    is implemented as a lookup table of function pointers
    where each decode function will decode to a unique
    ISA instruction, or do some sub-decoding to infer
    the next decode function to call.

    The format for each OP encoding is defined in the
    header file.

Registers:
    registers.[hh|cc] define the special registers and
    operand selector values, which are used to map
    operands to registers/special values. many
    convenience functions are also provides to determine
    the source/type of an operand, for example vector
    vs. scalar, register operand vs. constant, etc.

GPU ISA:
    Some special GPU ISA state is maintained in gpu_isa.hh
    and isa.cc. This class is used to hold some special
    registers and values that can be used as operands
    by ISA instructions. Eventually more ISA-specific
    state should be moved here, and out of the WF class.

Vector Operands:
    The operands for GCN3 instructions are defined in
    operand.hh. This file defines both scalar and
    vector operands wth GCN3 specific semantics. The
    vector operand class is desgned around the generic
    vec_reg.hh that is already present in gem5.

Instructions:
    The GCN3 instructions are defined and implemented
    throughout gpu_static_inst.[hh|cc], instructions.[hh|cc],
    op_encodings.[hh|cc], and inst_util.hh. GCN3 instructions
    all fall under one of the OP encoding types; for example
    scalar memory operands are of the type SMEM, vector
    ALU instructions can be VOP3, VOP2, etc. The base code
    common to all instructions of a certain OP encoding type
    is implemented in the OP encodings files, which includes
    operand information, disassembly methods, encoding type,
    etc.

    Each individual ISA isntruction is implemented as
    a class object in instructions.[hh|cc] and are derived
    from one of the OP encoding types. The instructions.cc
    file is primarily for the execute() methods of each
    individual instruction, and the header file provides
    the class definition and a few instruction specific
    API calls.

    Note that these instruction classes were auto-generated
    but not using the gem5 ISA description language. A
    custom ISA description was used and that cannot be released
    publicly, therefore we are providing them already in C++.

Change-Id: I14d2a02d6b87109f41341c8f50a69a2cca9f3d14
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28127
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-30 15:54:38 +00:00
Gabe Black
26454e8072 util: Add an abstraction layer for call types in the m5 utility.
These make the calling code in m5.c a little bit more generic. Each call
type will have a function to check the arguments and see if that type is
being requested and/or has any additional options set in the arguments.
If so, those are processed, and argc and argv are adjusted.

Then another function returns the appropriate dispatch table to use for
that invocation scheme. This is behind a function instead of, for
instance, a global variable because it gives the call type a little bit
more control over what's happening, for instance if it would use
different implementations in slightly different circumstances.

Change-Id: I661cf202ec657466496767cbdf331fe27995ab26
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27241
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-28 01:07:43 +00:00
Gabe Black
6072c1ad28 util: Use a dispatch table to call ops in the m5 utility.
This way different implementations can be substituted in depending on
how the low level ops should actually be triggered (inst, addr,
semihosting, (etc?)).

Change-Id: I7c6eab7d87cc973d0bc9c1889037a0f89ce057e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27238
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-28 01:07:43 +00:00
Gabe Black
3e88a4aa01 misc,util: Remove explicit ';'s from M5OP_FOREACH.
It may be the case that each item M5OP_FOREACH iterates over should end
in a ',' and not a ';', for instance when putting each item into an
array or initializing a structure. If the caller still wants a ';', they
can add it into the definition of the M5OP macro.

Change-Id: Idd6538b0aad27df39658c3f749c6ff5e4fe55e6d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27237
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-28 01:07:43 +00:00
Gabe Black
4af8df1ecd util: Delete the execfile m5 utility command.
This command was just a thin wrapper around the readfile command, and
can be easily duplicated by piping the output of that command to
/tmp/execfile and then running it.

Change-Id: Ib77166ee9f07571d57e4d21e9615def55e5391a8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27233
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-28 01:07:43 +00:00
Gabe Black
5e888d44fe util: Eliminate the sw99param m5 utility command.
This is a small additional layer on top of the initparam command and
just breaks the returned value into 12 bit chunks. It presumes that
there is some particular meaning to the default initparam value which
may or may not be true. It's not entirely clear what the 12 bit chunks
that this command returns are actually good for, and it's been around
long enough that there isn't really any good documentation about what
it's intended purpose was.

Change-Id: I21af0e0cf7501f47026a6dd31920d46cfccff167
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27232
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-28 01:07:43 +00:00
Gabe Black
21eba2a6fa util: Improve the usage text of the m5 utility.
Make sure there *is* help text for every command, alphabetize the
commands, explain all the arguments and what the command as a whole
does.

Change-Id: Icf74f8c638545c8658c99169dce728f7b1127806
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27231
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-28 01:07:43 +00:00
Gabe Black
90879d4920 util: Refactor the string->register packing function in the m5 utility.
This change removes the responsibility for checking the number of
arguments and handing the default of no string back into init_param and
out of the function which packs strings into registers. It also renames
the function to more closely match its purpose, and rewrites it to be a
bit simpler and (IMHO) easier to follow.

Importantly, rather than doing a hand implemented strcpy which would
follow the endianness of the target/simulated platform, this change
makes this function pack the registers explicitly in little endian byte
order. This way on the consuming end in gem5, the initParam function
doesn't have to care what the guest endianness is, it can just translate
them from little endian to whatever the host endianness is (very likely
also little endian).

Change-Id: Ie9f79ecb8d4584c6e47a2793a31ccaa8c7c15986
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27229
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-27 21:03:28 +00:00
Gabe Black
c12a72e073 util: Correct some help text for the initparam m5 utility command.
The "key" value passed to the initparam command can be at most 16
characters long, but the text said it had to be shorter than 16
characters.

Change-Id: Ic98dc87feb868b44c4210ae16cb5b0dad2a67d88
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27227
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-27 21:03:28 +00:00
Gabe Black
f64c8ce5bb util: Remove the "pin" command from the m5 utility.
This command did not use any m5 ops, does the same thing as the
"taskset" command under Linux:

https://linux.die.net/man/1/taskset

and might even have introduced a build error if compiled for any other
OS since that would have left a trailing comma in the mainfuncs array.

While the last problem would be easy to correct, this is not related to
the purpose of this utility (giving access to m5 ops), and is redundant
with an existing standard utility provided with Linux.

Change-Id: Ie72b9310f5e6264f6035013f47ebe74a27464abb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27226
Reviewed-by: Ciro Santilli <ciro.santilli@arm.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>
2020-04-27 21:03:28 +00:00
Gabe Black
8fd4d147b6 util: Add missing functions to the java wrapper for m5 ops.
Change-Id: I9bdef3cb78cc01b0743ea38eec6f6d28cd2f6765
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27225
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-27 21:03:28 +00:00
Gabe Black
55c75d799f util: Update the java wrapper names for m5 ops.
These were regularized a while ago, but not updated in the java wrapper.
There are also missing ops, but these will be added in another change.

Change-Id: Iaef281249c26d446709ba2b214ee37d574f6b72c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27223
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
2020-04-27 21:03:28 +00:00
Gabe Black
d0d29805f6 util: Convert the other architecture's m5 utility builds to scons.
Because I don't have a canonical toolchain to set SPARC's defaults to,
it will by default build for Linux instead of Solaris like it used to.
This will make it hard to test, but without a compiler there's not much
I can do.

This also coincidentally brings the SPARC version more in line with the
other variants which all target Linux.

Change-Id: Ie19217e988782da124306160920f40ef168840e4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27219
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2020-04-27 21:03:28 +00:00
Gabe Black
da21567d2c util: Add some additional flags for files in the m5 util.
When compiling static objects, disable pie with the -no-pie linker flag.
This is necessary for x86, and doesn't seem to hurt anything for the
other variants.

When compiling shared objects, particularly the assembly files which
can't rely on the compiler to generate position independent code, define
M5OP_PIC so that the assembly code can configure itself correctly.

Change-Id: I80d1ea7a7704666027e74228036af5e0e4b9eac2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27218
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-26 11:15:16 +00:00
Gabe Black
3ec5c71875 util: Add config files for crosstool-ng toolchains.
There is one for each arch gem5 supports, except RISCV which is not
supported by crosstool-ng at the moment. All configs are for Linux, also
because that's what crosstool-ng tends to support.

Change-Id: I898a9e8c7b144c3d690c232fd4fb20ede5430def
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27758
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
2020-04-16 09:12:55 +00:00
Gabe Black
8a46b6b6b4 util,scons: Generalize the aarch64 scons for the m5 util.
Slightly parameterize it so it can be used with the other versions of
the utility.

All build products for a given variant will now go under
build/${VARIANT}. The primary build outputs will go under
build/${VARIANT}/out so that they're easy to distinguish.

Change-Id: Idd244cc2a6c08ec8e4d67de3d0bae604c0611220
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27217
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-15 12:19:26 +00:00
Gabe Black
dccede3a61 util: In build_cross_gcc, set LIMITS_H_TEST=true.
This forces a test in the gcc Makefile to pick the right answer, where
its own check will not. Without this fix, installing libsanitizer fails
to build while installing the c++ headers because it can't find a
definition for PATH_MAX. Disabling building libsanitizer seems to work
around the problem, but other problems crop up later when using the
cross compiler, specifically when trying to build the googletest
library.

The chrome authors apparently ran into a similar problem when building
the native client tool chain as described in this bug:

https://bugs.chromium.org/p/nativeclient/issues/detail?id=3190

The CL which fixed the issue is here:

https://codereview.chromium.org/11462002/patch/1/2.

With a similar fix applied to build_cross_gcc.py, the cross compilers
build without issue, and are then able to build the googletest library
without issue.

Change-Id: Ia6869d3dc523cb0d964e82bb300f8b092693739b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27489
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-15 00:08:22 +00:00
Gabe Black
351790353a util: Move m5op_arm_A64.S into an aarch64 subdirectory.
Also rename it to m5op.S. These files will be distinguished by what
directory they're in, rather than by their name.

Change-Id: I3a89d529bb5b760579df22234cf9bf870711b56e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27216
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-10 06:15:24 +00:00
Gabe Black
2d8ced8b24 util: Delete the aarch64 Makefile for the m5 utility.
Change-Id: I202f2b0986ef12ddb076045673d80405b1afb54a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27215
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>
2020-04-10 06:15:03 +00:00
Gabe Black
dc23a1fb9c util,scons: Detect java and lua51 in the m5 utility scons files.
These will enable or disable the java and lua51 m5 op wrappers depending
on whether the required tools are available on the host system.

Change-Id: I2b11a13a39b2dfd5d45a9ed57702d2e225ef7d2e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27214
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2020-04-10 06:14:43 +00:00
Gabe Black
612536b85f util: Add SCons build files for the aarch64 verson of the m5 utility.
These are currently specific to aarch64, but will be expanded to cover
all other versions of the utility as well.

The intention of these new files is to centralize the build mechanism
for the different versions of the utility so that they have consistent
features, mechanisms, and targets, and so that new features will
automatically be shared by all versions without having to be implemented
in each.

This also sets up a separate build directory which will keep the source
tree clean, and will (with some more development) make it possible to
build multiple versions of the m5 utility at the same time without them
running into each other.

Change-Id: I10018eef6beb4af30a8d3bbab8b82cabd2b3f22c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27213
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-10 06:14:13 +00:00
Gabe Black
049aaf41f5 util: Implement PIC assembly for the aarch64.
When accessing m5_mem and building PIC code, we need to get the address
of m5_mem out of the global offset table, and then load the value from
there. If we try to load from m5_mem directly, the assembled code has a
relocation type the linker can't handle when building a shared object.

Change-Id: Ieb19c3d17c37ef810559ee24b68886b18ddcc869
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27212
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2020-04-09 05:31:09 +00:00
Gabe Black
0d0979ba17 util: Update jni_gem5Op.c so it will compile again.
The header for the m5op entry points had moved. Also the names of the
entry points had been normalized to have a consistent structure. Neither
of those changes were ported to this file, making it no longer compile.

Change-Id: I890c0486bd19fe2692cce92983290e854dc87afa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27211
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2020-04-01 11:58:06 +00:00
Gabe Black
031d261fe1 util: Update the m5 util Makefiles to not use javah.
In more recent versions of the JDK, the javah tool has been dropped. The
same job can be accomplished by passing a -h option to javac, telling it
where to put the header files javah would have generated.

Change-Id: Ibc543d5fa222848458f45b1945f8050b85b77ca2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27210
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2020-04-01 11:58:06 +00:00
Gabe Black
a959f28ec9 util: Move source files into a src directory.
This also moves the Makefiles, which will still produce build output in
the src directory. This is to prepare for a scons based build system
which will create a separate build directory with build artifacts.

Change-Id: I7c6d325e1d0a428656b2e3070b5e942515543696
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27209
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
2020-04-01 11:58:06 +00:00