[gem5-dev] Change in gem5/gem5[develop]: util-docker: Use python3 by default for Ubuntu 18.04 docker images

2021-05-05 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/45125 )


Change subject: util-docker: Use python3 by default for Ubuntu 18.04 docker  
images

..

util-docker: Use python3 by default for Ubuntu 18.04 docker images

gem5 dropped the support for python2. This change sets python3
to have a higher priority than python2 in the Ubuntu 18.04 docker
images. This is done so that gem5 will be compiled and tested
in the python3 environment by default.

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

Signed-off-by: Hoa Nguyen 
Change-Id: I11ffb06697ecf4cebf9f98b611641faa42805547
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45125
Maintainer: Bobby R. Bruce 
Maintainer: Jason Lowe-Power 
Reviewed-by: Jason Lowe-Power 
Tested-by: kokoro 
---
M util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile
M util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile  
b/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile

index 2403a50..775e549 100644
--- a/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile
+++ b/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile
@@ -32,3 +32,6 @@
 libprotobuf-dev protobuf-compiler libprotoc-dev  
libgoogle-perftools-dev \

 python3-dev python3 python3-six doxygen libboost-all-dev \
 libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config
+
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3  
10

+RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1
diff --git a/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile  
b/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile

index 5ec6784..53a7d92 100644
--- a/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile
+++ b/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile
@@ -30,3 +30,6 @@
 RUN apt -y upgrade
 RUN apt -y install build-essential scons zlib1g-dev m4 python3-dev python3  
\

 python3-six
+
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3  
10

+RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45125
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I11ffb06697ecf4cebf9f98b611641faa42805547
Gerrit-Change-Number: 45125
Gerrit-PatchSet: 3
Gerrit-Owner: Hoa Nguyen 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Hoa Nguyen 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Re: gem5 namespace

2021-05-05 Thread Gabe Black via gem5-dev
Yeah, we don't have a ton of namespaces already, but having two copies of
all of them for a while might be messy. I also don't think you can really
mark a namespace as deprecated without even more macro trickery.

Using snake case for the namespaces would be a change to acclimate to and
I'm not *excited* to make a big change like that, especially to something
I'm so used to, but importantly it would maintain consistency which is
arguably more important. It would bring us in line with namespaces like
"std" too, which, given how common it is, wouldn't be the worst thing.

We would have to be careful that short, simple namespace names like
"loader" don't conflict with existing local variable names. Given the
potential for problems there and that we only have a handful of namespaces
currently, it might make sense to convert each namespace one by one, which
might make it easier to deal with fallout.

Gabe

On Wed, May 5, 2021 at 6:45 AM Giacomo Travaglini via gem5-dev <
gem5-dev@gem5.org> wrote:

> Hi all,
>
> I agree with Daniel's analysis and solution, as enforcing snake_case for
> namespaces would probably make everyone happy.
> We could in theory adopt namespace aliases for backward compatibility, to
> transition smoothly from one "convention" (PascalCase for namespaces is not
> mentioned in our coding style) to the other, but I think it will complicate
> things even further.
>
> Kind Regards
>
> Giacomo
>
> > -Original Message-
> > From: Jason Lowe-Power via gem5-dev 
> > Sent: 03 May 2021 21:27
> > To: gem5 Developer List 
> > Cc: Jason Lowe-Power 
> > Subject: [gem5-dev] Re: gem5 namespace
> >
> > Hey Daniel,
> >
> > Sorry, I didn't mean to add to the confusion :). I may have gotten my
> case
> > names confused! Also, I really appreciate the thoughtfulness and effort
> > you're putting into this conversation! I believe I agree with your email
> below.
> >
> >
> > I think that most people don't care that much (which is why we haven't
> heard
> > from many). From my experience, our users only care when they get merge
> > conflicts :D. That said, I'm not sure if "straightforward" is a way most
> of our
> > users ever feel about merge conflicts. IMO, stability and ease of update
> > should be high priority. If we are going to be changing names, etc. in a
> way
> > that means external users of gem5 will have compiler errors, we should
> > probably provide backwards compatibility and warnings. Most of our users
> > are not software engineers and do not have as much experience with git,
> > compilers, etc. as we do.
> >
> >
> > Cheers,
> > Jason
> >
> >
> > On Mon, May 3, 2021 at 12:40 PM Daniel Carvalho via gem5-dev  > d...@gem5.org  > wrote:
> >
> >
> >   I'm confused, Jason. I thought you were in favor of adopting snake
> > case as a "general convention" (i.e., "the google way"), so by adopting
> snake
> > case we would be adopting the "general convention", not forging our own
> > path. However, if by "general convention" you mean "the convention vastly
> > adopted by gem5", I don't have the exact numbers, but I'd guess it is 70%
> > pascal, 30% snake case - i.e., IMHO, not a "general convention", just a
> > preference. Adding "gem5" or "Gem5" would only extend this mess, not add
> > an exception.
> >
> >   Regarding changing the name of the variable, indeed, it is not a
> > necessary step.
> >
> >   Again, as stated before, I don't care which solution is taken. The
> > important thing is to come to a decision that appeases most community
> > members; however, it is hard to reach a consensus when we seem to have
> > strong opinions on both sides, yet we only have 5 votes. That is why I
> have
> > suggested officially adopting snake case namespaces: it would solve the
> > "gem5 VS Gem5" problem, it is feasible to do it without having
> exceptions (at
> > least as of now), Giacomo expressed preference towards lowercase
> > namespaces, Jason suggested affinity with the google approach (snake
> case)
> > and "gem5", Bobby prefers "gem5", and Gabe and I like
> consistency/patterns.
> > The (huge) downside to this solution is that it would affect users, but
> 1) we'd
> > already be affecting users anyway with the new namespace, and 2) solving
> > the merge conflicts would be straightforward if the patches were created
> > with that in mind.
> >
> >
> >   Regards,
> >   Daniel
> >
> >   Em segunda-feira, 3 de maio de 2021 15:44:46 BRT, Jason Lowe-
> > Power mailto:ja...@lowepower.com> >
> > escreveu:
> >
> >
> >   Just a few quick replies below. Overall, I think we're being too
> > focused on "standards" and not on enough on ease of use. It's not a
> problem
> > if there are exceptions to guidance, if there's good reasons for the
> > exceptions.
> >
> >
> >   On Mon, May 3, 2021 at 11:36 AM Daniel Carvalho via gem5-dev
> > mailto:gem5-dev@gem5.org> > wrote:
> >
> >
> >   As mentioned by Gabe in the Jira issue, some of the
> > namespaces u

[gem5-dev] Change in gem5/gem5[develop]: util: Use python3 by default for Ubuntu 18.04 docker images

2021-05-05 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/45125 )



Change subject: util: Use python3 by default for Ubuntu 18.04 docker images
..

util: Use python3 by default for Ubuntu 18.04 docker images

gem5 dropped the support for python2. This change sets python3
to have a higher priority than python2 in the Ubuntu 18.04 docker
images. This is done so that gem5 will be compiled and tested
in the python3 environment by default.

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

Signed-off-by: Hoa Nguyen 
Change-Id: I11ffb06697ecf4cebf9f98b611641faa42805547
---
M util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile
M util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile
2 files changed, 6 insertions(+), 0 deletions(-)



diff --git a/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile  
b/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile

index 2403a50..775e549 100644
--- a/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile
+++ b/util/dockerfiles/ubuntu-18.04_all-dependencies/Dockerfile
@@ -32,3 +32,6 @@
 libprotobuf-dev protobuf-compiler libprotoc-dev  
libgoogle-perftools-dev \

 python3-dev python3 python3-six doxygen libboost-all-dev \
 libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config
+
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3  
10

+RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1
diff --git a/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile  
b/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile

index 5ec6784..53a7d92 100644
--- a/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile
+++ b/util/dockerfiles/ubuntu-18.04_min-dependencies/Dockerfile
@@ -30,3 +30,6 @@
 RUN apt -y upgrade
 RUN apt -y install build-essential scons zlib1g-dev m4 python3-dev python3  
\

 python3-six
+
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3  
10

+RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45125
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I11ffb06697ecf4cebf9f98b611641faa42805547
Gerrit-Change-Number: 45125
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: base: Add warnings for legacy stats

2021-05-05 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44706 )


Change subject: base: Add warnings for legacy stats
..

base: Add warnings for legacy stats

Legacy stat is defined as a stat that doesn't belong to any
Stats::Group.

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

Change-Id: I8d426882b6bf7600998e181f18d1339ce82d5917
Signed-off-by: Hoa Nguyen 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44706
Reviewed-by: Daniel Carvalho 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M src/base/statistics.hh
1 file changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Jason Lowe-Power: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/statistics.hh b/src/base/statistics.hh
index 63bfb5b..9de975b 100644
--- a/src/base/statistics.hh
+++ b/src/base/statistics.hh
@@ -75,6 +75,7 @@
 #include "base/cast.hh"
 #include "base/cprintf.hh"
 #include "base/intmath.hh"
+#include "base/logging.hh"
 #include "base/stats/group.hh"
 #include "base/stats/info.hh"
 #include "base/stats/output.hh"
@@ -259,6 +260,14 @@

 if (desc)
 info->desc = desc;
+
+// Stat that does not belong to any Stats::Group is a legacy stat
+std::string common_message = "Legacy stat is a stat that does not "
+"belong to any Stats::Group. Legacy stat is deprecated.";
+if (parent == nullptr && name != nullptr)
+warn(csprintf("`%s` is a legacy stat. %s", name,  
common_message));

+else if (parent == nullptr)
+warn_once("One of the stats is a legacy stat. " +  
common_message);

 }

 /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44706
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8d426882b6bf7600998e181f18d1339ce82d5917
Gerrit-Change-Number: 44706
Gerrit-PatchSet: 8
Gerrit-Owner: Hoa Nguyen 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Hoa Nguyen 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: dev-amdgpu: Add initial AMDGPU device

2021-05-05 Thread Matt Poremba (Gerrit) via gem5-dev
Matt Poremba has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44909 )


Change subject: dev-amdgpu: Add initial AMDGPU device
..

dev-amdgpu: Add initial AMDGPU device

The initial device contains enough code for the gpufs configuration
scripts to register an amdgpu device that identifies as a Vega 10
(Frontier Edition) device when PCI devices are listed by Linux. It also
contains stubs necessary for adding the MMIO interface to handle driver
initialization.

Using the configuration Linux boots and the device is successfully seen
in lspci. The driver can also begin loading an successfully sends
initial MMIOs and attempts to read the ROM.

Change-Id: I7ad87026876f31f44668e700d5adb639c2c053c1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44909
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Matt Sinclair 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
A src/dev/amdgpu/AMDGPU.py
A src/dev/amdgpu/SConscript
A src/dev/amdgpu/amdgpu_device.cc
A src/dev/amdgpu/amdgpu_device.hh
4 files changed, 464 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, but someone else must approve; Looks  
good to me, approved

  Matt Sinclair: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/dev/amdgpu/AMDGPU.py b/src/dev/amdgpu/AMDGPU.py
new file mode 100644
index 000..29526c4
--- /dev/null
+++ b/src/dev/amdgpu/AMDGPU.py
@@ -0,0 +1,72 @@
+# Copyright (c) 2021 Advanced Micro Devices, Inc.
+# All rights reserved.
+#
+# For use for simulation and test purposes only
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are  
met:

+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright  
notice,

+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS  
IS"

+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR  
PURPOSE

+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF  
THE

+# POSSIBILITY OF SUCH DAMAGE.
+
+from m5.params import *
+from m5.objects.PciDevice import PciDevice
+from m5.objects.PciDevice import PciMemBar, PciMemUpperBar, PciLegacyIoBar
+
+# PCI device model for an AMD Vega 10 based GPU. The PCI codes and BARs
+# correspond to a Vega Frontier Edition hardware device. None of the PCI
+# related values in this class should be changed.
+#
+# This class requires a ROM binary and an MMIO trace to initialize the
+# device registers and memory. It is intended only to be used in  
full-system

+# simulation under Linux where the amdgpu driver is modprobed.
+class AMDGPUDevice(PciDevice):
+type = 'AMDGPUDevice'
+cxx_header = "dev/amdgpu/amdgpu_device.hh"
+
+# IDs for AMD Vega 10
+VendorID = 0x1002
+DeviceID = 0x6863
+# Command 0x3 never gets sent indicating IO and Mem bars are enabled.  
Hard

+# code the command here and deal unassigned BARs on C++ side.
+Command = 0x3
+Status = 0x0280
+Revision = 0x0
+ClassCode = 0x03
+SubClassCode = 0x00
+ProgIF = 0x00
+
+# Use max possible BAR size for Vega 10. We can override with driver  
param

+BAR0 = PciMemBar(size='16GiB')
+BAR1 = PciMemUpperBar()
+BAR2 = PciMemBar(size='2MiB')
+BAR3 = PciMemUpperBar()
+BAR4 = PciLegacyIoBar(addr=0xf000, size='256B')
+BAR5 = PciMemBar(size='512KiB')
+
+InterruptLine = 14
+InterruptPin = 2
+ExpansionROM = 0
+
+rom_binary = Param.String("ROM binary dumped from hardware")
+trace_file = Param.String("MMIO trace collected on hardware")
diff --git a/src/dev/amdgpu/SConscript b/src/dev/amdgpu/SConscript
new file mode 100644
index 000..78b73ab
--- /dev/null
+++ b/src/dev/amdgpu/SConscript
@@ -0,0 +1,42 @@
+# Copyright (c) 2021 Advanced Micro Devices, Inc.
+# All rights reserved.
+#
+# For use for simulation and test purposes only
+#

[gem5-dev] Re: gem5 namespace

2021-05-05 Thread Giacomo Travaglini via gem5-dev
Hi all,

I agree with Daniel's analysis and solution, as enforcing snake_case for 
namespaces would probably make everyone happy.
We could in theory adopt namespace aliases for backward compatibility, to 
transition smoothly from one "convention" (PascalCase for namespaces is not 
mentioned in our coding style) to the other, but I think it will complicate 
things even further.

Kind Regards

Giacomo

> -Original Message-
> From: Jason Lowe-Power via gem5-dev 
> Sent: 03 May 2021 21:27
> To: gem5 Developer List 
> Cc: Jason Lowe-Power 
> Subject: [gem5-dev] Re: gem5 namespace
>
> Hey Daniel,
>
> Sorry, I didn't mean to add to the confusion :). I may have gotten my case
> names confused! Also, I really appreciate the thoughtfulness and effort
> you're putting into this conversation! I believe I agree with your email 
> below.
>
>
> I think that most people don't care that much (which is why we haven't heard
> from many). From my experience, our users only care when they get merge
> conflicts :D. That said, I'm not sure if "straightforward" is a way most of 
> our
> users ever feel about merge conflicts. IMO, stability and ease of update
> should be high priority. If we are going to be changing names, etc. in a way
> that means external users of gem5 will have compiler errors, we should
> probably provide backwards compatibility and warnings. Most of our users
> are not software engineers and do not have as much experience with git,
> compilers, etc. as we do.
>
>
> Cheers,
> Jason
>
>
> On Mon, May 3, 2021 at 12:40 PM Daniel Carvalho via gem5-dev  d...@gem5.org  > wrote:
>
>
>   I'm confused, Jason. I thought you were in favor of adopting snake
> case as a "general convention" (i.e., "the google way"), so by adopting snake
> case we would be adopting the "general convention", not forging our own
> path. However, if by "general convention" you mean "the convention vastly
> adopted by gem5", I don't have the exact numbers, but I'd guess it is 70%
> pascal, 30% snake case - i.e., IMHO, not a "general convention", just a
> preference. Adding "gem5" or "Gem5" would only extend this mess, not add
> an exception.
>
>   Regarding changing the name of the variable, indeed, it is not a
> necessary step.
>
>   Again, as stated before, I don't care which solution is taken. The
> important thing is to come to a decision that appeases most community
> members; however, it is hard to reach a consensus when we seem to have
> strong opinions on both sides, yet we only have 5 votes. That is why I have
> suggested officially adopting snake case namespaces: it would solve the
> "gem5 VS Gem5" problem, it is feasible to do it without having exceptions (at
> least as of now), Giacomo expressed preference towards lowercase
> namespaces, Jason suggested affinity with the google approach (snake case)
> and "gem5", Bobby prefers "gem5", and Gabe and I like consistency/patterns.
> The (huge) downside to this solution is that it would affect users, but 1) 
> we'd
> already be affecting users anyway with the new namespace, and 2) solving
> the merge conflicts would be straightforward if the patches were created
> with that in mind.
>
>
>   Regards,
>   Daniel
>
>   Em segunda-feira, 3 de maio de 2021 15:44:46 BRT, Jason Lowe-
> Power mailto:ja...@lowepower.com> >
> escreveu:
>
>
>   Just a few quick replies below. Overall, I think we're being too
> focused on "standards" and not on enough on ease of use. It's not a problem
> if there are exceptions to guidance, if there's good reasons for the
> exceptions.
>
>
>   On Mon, May 3, 2021 at 11:36 AM Daniel Carvalho via gem5-dev
> mailto:gem5-dev@gem5.org> > wrote:
>
>
>   As mentioned by Gabe in the Jira issue, some of the
> namespaces using snake declared in the codebase case are defined as parts
> of a standard, and thus cannot be modified. Realistically, this means that if
> we wanted to follow a namespace naming convention, it'd be snake case:
> despite having way more occurrences of pascal case namespaces, they are all
> "ours"; this means that, although inconvenient, it would be doable to
> standardize all of them.
>
>
>
>   If we just say "all namespaces should be PascalCase. gem5, the name
> of this project, is an exception" would be OK with me.
>
>
>
>   Would you be willing to adopt to enforce a snake case
> namespace naming convention? From the previous replies to this thread, it
> seems that this solution would appease most - if not all - participants.
>
>
>   I really don't think this is too important. I would definitely prefer to
> follow the *general* conventions rather than forging our own path.
>
>
>
>
>   For this change to take place, we need to (not necessarily
> sorted):
>   1) Rename the python variables named "gem5" in
> src/systemc/tlm_bridge/TlmBridge.py (or remove them - I don't remember
> finding where they are used);
>
>
>   Why does this 

[gem5-dev] Change in gem5/gem5[develop]: base: Add DPRINTFV macro

2021-05-05 Thread Giacomo Travaglini (Gerrit) via gem5-dev
Giacomo Travaglini has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/44967 )


Change subject: base: Add DPRINTFV macro
..

base: Add DPRINTFV macro

This macro is directly expecting a Debug::Flag instance as a first
argument instead of simply the name of the debug flag, and it is
forwarding it with no preprocessing to the underlying logic
(dprintf_flag).
This is different from the common DPRINTF, which is converting the
first argument into a flag and into a string literal.

This is useful if we want to pass the DebugFlag from the subclass to
the superclass. This makes it possible to set tracepoints in the
Base class logic, and let the Derived classes define the flag which
will enable the tracepoint

class Base
{
Base(const Debug::SimpleFlag &_flag)
  : flag(_flag) {}

void baseLogic()
{
DPRINTFV(flag, "...");
}

const Debug::SimpleFlag flag;
}

class Derived1 : public Base
{
Derived1() : Base(Debug::Derived1) {}
}

class Derived2 : public Base
{
Derived2() : Base(Debug::Derived2) {}
}

A more concrete example is Arm Table Walker, which is using a DmaPort.
If we want to log the table walker port activity, we are using the
--debug-flags=DMA, which is unconvenient as it will contain the
logs from every DMA device in the simulation

Change-Id: I793cf1521303fd0a3bbea2059a9447386f83661e
Signed-off-by: Giacomo Travaglini 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44967
Tested-by: kokoro 
Reviewed-by: Daniel Carvalho 
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
---
M src/base/trace.hh
1 file changed, 16 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Daniel Carvalho: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/trace.hh b/src/base/trace.hh
index 36fcee4..be8476b 100644
--- a/src/base/trace.hh
+++ b/src/base/trace.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2019 ARM Limited
+ * Copyright (c) 2014, 2019, 2021 Arm Limited
  * All rights reserved
  *
  * Copyright (c) 2001-2006 The Regents of The University of Michigan
@@ -154,10 +154,17 @@
  * If you desire that the automatic printing not occur, use DPRINTFR
  * (R for raw)
  *
+ * With DPRINTFV it is possible to pass a Debug::SimpleFlag variable
+ * as first argument. Example:
+ *
+ * Debug::Flag some_flag = Debug::DMA;
+ * DPRINTFV(some_flag, ...);
+ *
  * \def DDUMP(x, data, count)
  * \def DPRINTF(x, ...)
  * \def DPRINTFS(x, s, ...)
  * \def DPRINTFR(x, ...)
+ * \def DPRINTFV(x, ...)
  * \def DPRINTFN(...)
  * \def DPRINTFNR(...)
  * \def DPRINTF_UNCONDITIONAL(x, ...)
@@ -195,6 +202,13 @@
 }  \
 } while (0)

+#define DPRINTFV(x, ...) do {  \
+if (M5_UNLIKELY(x)) {  \
+Trace::getDebugLogger()->dprintf_flag( \
+curTick(), name(), x.name(), __VA_ARGS__); \
+}  \
+} while (0)
+
 #define DPRINTFN(...) do { \
 Trace::getDebugLogger()->dprintf(curTick(), name(), __VA_ARGS__);  \
 } while (0)
@@ -214,6 +228,7 @@
 #define DPRINTF(x, ...) do {} while (0)
 #define DPRINTFS(x, ...) do {} while (0)
 #define DPRINTFR(...) do {} while (0)
+#define DPRINTFV(...) do {} while (0)
 #define DPRINTFN(...) do {} while (0)
 #define DPRINTFNR(...) do {} while (0)
 #define DPRINTF_UNCONDITIONAL(x, ...) do {} while (0)



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44967
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I793cf1521303fd0a3bbea2059a9447386f83661e
Gerrit-Change-Number: 44967
Gerrit-PatchSet: 4
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: arch-power: Add TAR and associated instructions

2021-05-05 Thread Boris Shingarov (Gerrit) via gem5-dev
Boris Shingarov has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40889 )


Change subject: arch-power: Add TAR and associated instructions
..

arch-power: Add TAR and associated instructions

This adds the definition of the Target Address Register (TAR)
and the following instructions that are associated with it.
  * Move To Target Address Register (mttar)
  * Move From Target Address Register (mftar)
  * Branch Conditional to Branch Target Address Register (bctar[l])

Change-Id: I30f54ebd38b503fb6c9ba9dd74d00ccbbc0f8318
Signed-off-by: Sandipan Das 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40889
Reviewed-by: Boris Shingarov 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M src/arch/power/insts/integer.cc
M src/arch/power/isa/decoder.isa
M src/arch/power/isa/operands.isa
M src/arch/power/regs/int.hh
4 files changed, 15 insertions(+), 5 deletions(-)

Approvals:
  Boris Shingarov: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/power/insts/integer.cc  
b/src/arch/power/insts/integer.cc

index fdf3b51..c10abe6 100644
--- a/src/arch/power/insts/integer.cc
+++ b/src/arch/power/insts/integer.cc
@@ -49,12 +49,14 @@
myMnemonic == "mtxer" ||
myMnemonic == "mtlr"  ||
myMnemonic == "mtctr" ||
+   myMnemonic == "mttar" ||
myMnemonic == "cmpi") {
 printDest = false;
 } else if (myMnemonic == "mfcr"  ||
myMnemonic == "mfxer" ||
myMnemonic == "mflr"  ||
-   myMnemonic == "mfctr") {
+   myMnemonic == "mfctr" ||
+   myMnemonic == "mftar") {
 printSrcs = false;
 }

diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa
index e4f57ca..ac52ab3 100644
--- a/src/arch/power/isa/decoder.isa
+++ b/src/arch/power/isa/decoder.isa
@@ -152,8 +152,12 @@
 }});
 }

-// Conditionally branch to address in CTR based on CR.
-528: BranchRegCondOp::bcctr({{ NIA = CTR & -4ULL; }});
+// Conditionally branch to an address in a register based on
+// either CR only or both CR and CTR.
+format BranchRegCondOp {
+528: bcctr({{ NIA = CTR & -4ULL; }});
+560: bctar({{ NIA = TAR & -4ULL; }}, true);
+}
 }

 format IntRotateOp {
@@ -480,12 +484,14 @@
 0x20: mfxer({{ Rt = XER; }});
 0x100: mflr({{ Rt = LR; }});
 0x120: mfctr({{ Rt = CTR; }});
+0x1f9: mftar({{ Rt = TAR; }});
 }

 467: decode SPR {
 0x20: mtxer({{ XER = Rs; }});
 0x100: mtlr({{ LR = Rs; }});
 0x120: mtctr({{ CTR = Rs; }});
+0x1f9: mttar({{ TAR = Rs; }});
 }

 512: mcrxr({{
diff --git a/src/arch/power/isa/operands.isa  
b/src/arch/power/isa/operands.isa

index 07415ba..23cf50b 100644
--- a/src/arch/power/isa/operands.isa
+++ b/src/arch/power/isa/operands.isa
@@ -64,6 +64,7 @@
 'CR': ('IntReg', 'uw', 'INTREG_CR', 'IsInteger', 9),
 'LR': ('IntReg', 'ud', 'INTREG_LR', 'IsInteger', 9),
 'CTR': ('IntReg', 'ud', 'INTREG_CTR', 'IsInteger', 9),
+'TAR': ('IntReg', 'ud', 'INTREG_TAR', 'IsInteger', 9),
 'XER': ('IntReg', 'uw', 'INTREG_XER', 'IsInteger', 9),

 # Setting as IntReg so things are stored as an integer, not double
diff --git a/src/arch/power/regs/int.hh b/src/arch/power/regs/int.hh
index 7d63f79..2d6a16b 100644
--- a/src/arch/power/regs/int.hh
+++ b/src/arch/power/regs/int.hh
@@ -35,9 +35,9 @@
 // Constants Related to the number of registers
 const int NumIntArchRegs = 32;

-// CR, XER, LR, CTR, FPSCR, RSV, RSV-LEN, RSV-ADDR
+// CR, XER, LR, CTR, TAR, FPSCR, RSV, RSV-LEN, RSV-ADDR
 // and zero register, which doesn't actually exist but needs a number
-const int NumIntSpecialRegs = 9;
+const int NumIntSpecialRegs = 10;

 const int NumIntRegs = NumIntArchRegs + NumIntSpecialRegs;

@@ -51,6 +51,7 @@
 INTREG_XER,
 INTREG_LR,
 INTREG_CTR,
+INTREG_TAR,
 INTREG_FPSCR,
 INTREG_RSV,
 INTREG_RSV_LEN,

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40889
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I30f54ebd38b503fb6c9ba9dd74d00ccbbc0f8318
Gerrit-Change-Number: 40889
Gerrit-PatchSet: 6
Gerrit-Owner: Sandipan Das 
Gerrit-Reviewer: Boris Shingarov 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-l

[gem5-dev] Change in gem5/gem5[develop]: configs: Improve error message of missing files

2021-05-05 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/45105 )



Change subject: configs: Improve error message of missing files
..

configs: Improve error message of missing files

In PathSearchFunc.__call__(), filename is the name of the file
while filepath contains the relative path to the missing file
relative to $M5_PATH.

Outputing the filepath in the error message makes the error
message more useful as it provides the expected location of
the file as well as the name of the file.

Change-Id: I5f1fdb9e48ac9ae59a26d1a4a40bc9ff9acd
Signed-off-by: Hoa Nguyen 
---
M configs/common/SysPaths.py
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/configs/common/SysPaths.py b/configs/common/SysPaths.py
index 2b2fca3..762efaf 100644
--- a/configs/common/SysPaths.py
+++ b/configs/common/SysPaths.py
@@ -70,7 +70,7 @@
 return next(p for p in paths if os.path.exists(p))
 except StopIteration:
 raise IOError("Can't find file '{}' on {}."
-.format(filename, self.environment_variable))
+.format(filepath, self.environment_variable))

 disk = PathSearchFunc('disks')
 binary = PathSearchFunc('binaries')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45105
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5f1fdb9e48ac9ae59a26d1a4a40bc9ff9acd
Gerrit-Change-Number: 45105
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s