[gem5-dev] Change in gem5/gem5[develop]: arch-riscv: FS Linux config file for RISC-V

2021-02-08 Thread Peter Yuen (Gerrit) via gem5-dev
Peter Yuen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/41033 )



Change subject: arch-riscv: FS Linux config file for RISC-V
..

arch-riscv: FS Linux config file for RISC-V

This file is added to provide a clean starter for RISC-V FS Linux
configuration.

Change-Id: Ifd401761be86758340f26edd00a5ab1ca51e6938
---
A configs/example/riscv/fs_linux.py
1 file changed, 228 insertions(+), 0 deletions(-)



diff --git a/configs/example/riscv/fs_linux.py  
b/configs/example/riscv/fs_linux.py

new file mode 100644
index 000..75c54a5
--- /dev/null
+++ b/configs/example/riscv/fs_linux.py
@@ -0,0 +1,228 @@
+# Copyright (c) 2021 Huawei International
+# All rights reserved.
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Copyright (c) 2012-2014 Mark D. Hill and David A. Wood
+# Copyright (c) 2009-2011 Advanced Micro Devices, Inc.
+# Copyright (c) 2006-2007 The Regents of The University of Michigan
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# 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;
+# neither the name of the copyright holders 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
+# OWNER 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.
+
+import optparse
+import sys
+
+import m5
+from m5.defines import buildEnv
+from m5.objects import *
+from m5.util import addToPath, fatal, warn
+from m5.util.fdthelper import *
+
+addToPath('../../')
+
+from ruby import Ruby
+
+from common.FSConfig import *
+from common.SysPaths import *
+from common.Benchmarks import *
+from common import Simulation
+from common import CacheConfig
+from common import CpuConfig
+from common import MemConfig
+from common import ObjectList
+from common.Caches import *
+from common import Options
+
+# - Add Options  #
+parser = optparse.OptionParser()
+Options.addCommonOptions(parser)
+Options.addFSOptions(parser)
+
+# NOTE: Ruby in FS Linux has not been tested yet
+if '--ruby' in sys.argv:
+Ruby.define_options(parser)
+
+#  Parse Options --- #
+(options, args) = parser.parse_args()
+
+if args:
+print("Error: script doesn't take any positional arguments")
+sys.exit(1)
+
+# CPU and Memory
+(CPUClass, mem_mode, FutureClass) = Simulation.setCPUClass(options)
+MemClass = Simulation.setMemClass(options)
+
+np = options.num_cpus
+
+#  Setup System  #
+# Edit this section to customize peripherals and system settings
+system = System()
+mdesc = SysConfig(disks=options.disk_image, rootdev=options.root_device,
+mem=options.mem_size, os_type=options.os_type)
+system.mem_mode = mem_mode
+system.mem_ranges = [AddrRange(start=0x8000, size=mdesc.mem())]
+
+system.workload = RiscvBareMetal()
+
+system.iobus = IOXBar()
+system.membus = MemBus()
+
+system.system_port = system.membus.slave
+
+system.intrctrl = IntrControl()
+
+# HiFive platform
+system.platform = HiFive()
+
+# CLNT
+system.platform.clint = Clint()
+system.platform.clint.frequency = Frequency("100MHz")
+system.platform.clint.pio = 

[gem5-dev] Re: derived units for stats formulas?

2021-02-08 Thread Hoa Nguyen via gem5-dev
Hi Gabe,

Thanks for the suggestion. It would be nice if we can derive the unit
from the Formula that way. However, for now, I think it's better to
manually determine the stat units for three reasons: most stats
involving Formula are straightforward to determine the unit, it keeps
the implementation simple, and there is a corner case that could
result in a wrong unit.

A bit about the corner case. We have a unit called `Ratio`, which
represents a quantity of unit A divided by a quantity of unit A. There
is also a unit called `Count`, which represents a quantity of any unit
other than ticks, cycles, bytes, etc. The problem is that, if we have
a formula `f = scalarA / scalarB`, where `scalarA` and `scalarB` have
`Count` as its unit, then `f` could be a `Ratio` or a `Count / Count`.
This would require the user to manually specify the unit.

Regards,
Hoa Nguyen

On 2/6/21, Gabe Black via gem5-dev  wrote:
> Hi folks working on stats. I noticed a lot of changes recently related to
> stats and units, and while I haven't been paying that close attention to
> it, it at least sounds like a pretty good idea, so go for it.
>
> One thing I noticed though, was that there are some stats which are derived
> from other stats (formula stats I think). These specify how they're
> computed by overloading operators on other stats, so if a stat should
> computed as the value of stat A divided by the value of stat B, you'd set
> it to be A / B. Then in addition to that, the units are also separately
> computed the same way, by saying, for instance, bytes / seconds. If stat A
> already has units bytes, and stat B already has units seconds, why don't we
> just figure out the units of A / B as bytes / seconds without having to
> specify it again? That would simplify writing out stats, and reduce the
> likelihood of errors.
>
> Just a thought.
>
> Gabe
>
___
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]: mem: Change units of mem_interface to supported units

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



Change subject: mem: Change units of mem_interface to supported units
..

mem: Change units of mem_interface to supported units

Change-Id: I4be712dcc9c37b2d3688f23b074634c981a2e64b
Signed-off-by: Hoa Nguyen 
---
M src/mem/mem_interface.cc
1 file changed, 103 insertions(+), 129 deletions(-)



diff --git a/src/mem/mem_interface.cc b/src/mem/mem_interface.cc
index 95b571e..52d601e 100644
--- a/src/mem/mem_interface.cc
+++ b/src/mem/mem_interface.cc
@@ -1786,28 +1786,34 @@

 // The energy components inside the power lib are calculated over
 // the window so accumulate into the corresponding gem5 stat
-stats.actEnergy += energy.act_energy * dram.devicesPerRank;
-stats.preEnergy += energy.pre_energy * dram.devicesPerRank;
-stats.readEnergy += energy.read_energy * dram.devicesPerRank;
-stats.writeEnergy += energy.write_energy * dram.devicesPerRank;
-stats.refreshEnergy += energy.ref_energy * dram.devicesPerRank;
-stats.actBackEnergy += energy.act_stdby_energy * dram.devicesPerRank;
-stats.preBackEnergy += energy.pre_stdby_energy * dram.devicesPerRank;
-stats.actPowerDownEnergy += energy.f_act_pd_energy *  
dram.devicesPerRank;
-stats.prePowerDownEnergy += energy.f_pre_pd_energy *  
dram.devicesPerRank;

-stats.selfRefreshEnergy += energy.sref_energy * dram.devicesPerRank;
+stats.actEnergy += energy.act_energy * dram.devicesPerRank * 1e-12;
+stats.preEnergy += energy.pre_energy * dram.devicesPerRank * 1e-12;
+stats.readEnergy += energy.read_energy * dram.devicesPerRank * 1e-12;
+stats.writeEnergy += energy.write_energy * dram.devicesPerRank * 1e-12;
+stats.refreshEnergy += energy.ref_energy * dram.devicesPerRank * 1e-12;
+stats.actBackEnergy += energy.act_stdby_energy * dram.devicesPerRank
+* 1e-12;
+stats.preBackEnergy += energy.pre_stdby_energy * dram.devicesPerRank
+* 1e-12;
+stats.actPowerDownEnergy += energy.f_act_pd_energy *  
dram.devicesPerRank

+* 1e-12;
+stats.prePowerDownEnergy += energy.f_pre_pd_energy *  
dram.devicesPerRank

+* 1e-12;
+stats.selfRefreshEnergy += energy.sref_energy * dram.devicesPerRank
+* 1e-12;

 // Accumulate window energy into the total energy.
-stats.totalEnergy += energy.window_energy * dram.devicesPerRank;
+stats.totalEnergy += energy.window_energy * dram.devicesPerRank *  
1e-12;

+
 // Average power must not be accumulated but calculated over the time
-// since last stats reset. SimClock::Frequency is tick period not tick
-// frequency.
-//  energy (pJ) 1e-9
-// power (mW) = --- * --
-//  time (tick)   tick_frequency
+// since last stats reset. SimClock::Frequency is an integer  
representing
+// the number of ticks per second, which is the same as  
SimClock::Int::s.

+// energy (J)
+// power (W) = --- x ticks_per_second
+// time (tick)
 stats.averagePower = (stats.totalEnergy.value() /
 (curTick() - dram.lastStatsResetTick)) *
-(SimClock::Frequency / 10.0);
+(SimClock::Int::s);
 }

 void
@@ -1849,50 +1855,39 @@
 : Stats::Group(&_dram),
 dram(_dram),

-ADD_STAT(readBursts, UNIT_COUNT, "Number of DRAM read bursts"),
-ADD_STAT(writeBursts, UNIT_COUNT, "Number of DRAM write bursts"),
+ADD_STAT(readBursts, "Number of DRAM read bursts"),
+ADD_STAT(writeBursts, "Number of DRAM write bursts"),

-ADD_STAT(perBankRdBursts, UNIT_COUNT, "Per bank write bursts"),
-ADD_STAT(perBankWrBursts, UNIT_COUNT, "Per bank write bursts"),
+ADD_STAT(perBankRdBursts, "Per bank write bursts"),
+ADD_STAT(perBankWrBursts, "Per bank write bursts"),

-ADD_STAT(totQLat, UNIT_TICK, "Total ticks spent queuing"),
-ADD_STAT(totBusLat, UNIT_TICK, "Total ticks spent in databus  
transfers"),

-ADD_STAT(totMemAccLat, UNIT_TICK,
+ADD_STAT(totQLat, "Total ticks spent queuing"),
+ADD_STAT(totBusLat, "Total ticks spent in databus transfers"),
+ADD_STAT(totMemAccLat,
  "Total ticks spent from burst creation until serviced "
  "by the DRAM"),

-ADD_STAT(avgQLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count),
- "Average queueing delay per DRAM burst"),
-ADD_STAT(avgBusLat, UNIT_RATE(Stats::Units::Tick, Stats::Units::Count),
- "Average bus latency per DRAM burst"),
-ADD_STAT(avgMemAccLat, UNIT_RATE(Stats::Units::Tick,  
Stats::Units::Count),

- "Average memory access latency per DRAM burst"),
+ADD_STAT(avgQLat, "Average queueing delay per DRAM burst"),
+ADD_STAT(avgBusLat, "Average bus latency per DRAM burst"),
+ADD_STAT(avgMemAccLat, "Average memory access 

[gem5-dev] Change in gem5/gem5[develop]: cpu,mem: Converting stats to supported units

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



Change subject: cpu,mem: Converting stats to supported units
..

cpu,mem: Converting stats to supported units

There are several stats having unit being a multiple of supported
units. This change makes the following conversions:
  * pJ -> J (Joule)
  * mW -> W (Watt)
  * MiB/s -> bytes/s
  * percentage -> ratio

Change-Id: I9832796e87698daa7f87f91fa39ce40bbf92e737
Signed-off-by: Hoa Nguyen 
---
M src/cpu/o3/fetch_impl.hh
M src/cpu/pred/bpred_unit.cc
M src/cpu/pred/bpred_unit.hh
M src/mem/mem_ctrl.cc
M src/mem/mem_interface.cc
M src/mem/xbar.cc
6 files changed, 77 insertions(+), 77 deletions(-)



diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index 23ab06b..24e7464 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -193,8 +193,8 @@
  "Number of outstanding ITLB misses that were squashed"),
 ADD_STAT(nisnDist,
  "Number of instructions fetched each cycle (Total)"),
-ADD_STAT(idleRate, "Percent of cycles fetch was idle",
- idleCycles * 100 / cpu->baseStats.numCycles),
+ADD_STAT(idleRate, "Ratio of cycles fetch was idle",
+ idleCycles / cpu->baseStats.numCycles),
 ADD_STAT(branchRate, "Number of branch fetches per cycle",
  branches / cpu->baseStats.numCycles),
 ADD_STAT(rate, "Number of inst fetches per cycle",
diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc
index e618fb5..d32d75b 100644
--- a/src/cpu/pred/bpred_unit.cc
+++ b/src/cpu/pred/bpred_unit.cc
@@ -74,8 +74,7 @@
   ADD_STAT(condIncorrect, "Number of conditional branches incorrect"),
   ADD_STAT(BTBLookups, "Number of BTB lookups"),
   ADD_STAT(BTBHits, "Number of BTB hits"),
-  ADD_STAT(BTBHitPct, "BTB Hit Percentage",
-   (BTBHits / BTBLookups) * 100),
+  ADD_STAT(BTBHitRatio, "BTB Hit Ratio", BTBHits / BTBLookups),
   ADD_STAT(RASUsed, "Number of times the RAS was used to get a  
target."),

   ADD_STAT(RASIncorrect, "Number of incorrect RAS predictions."),
   ADD_STAT(indirectLookups, "Number of indirect predictor lookups."),
@@ -84,7 +83,7 @@
   ADD_STAT(indirectMispredicted, "Number of mispredicted indirect"
   " branches.")
 {
-BTBHitPct.precision(6);
+BTBHitRatio.precision(6);
 }

 ProbePoints::PMUUPtr
diff --git a/src/cpu/pred/bpred_unit.hh b/src/cpu/pred/bpred_unit.hh
index e445a39..ca164fa 100644
--- a/src/cpu/pred/bpred_unit.hh
+++ b/src/cpu/pred/bpred_unit.hh
@@ -290,8 +290,8 @@
 Stats::Scalar BTBLookups;
 /** Stat for number of BTB hits. */
 Stats::Scalar BTBHits;
-/** Stat for percent times an entry in BTB found. */
-Stats::Formula BTBHitPct;
+/** Stat for the ratio between BTB hits and BTB lookups. */
+Stats::Formula BTBHitRatio;
 /** Stat for number of times the RAS is used to get a target. */
 Stats::Scalar RASUsed;
 /** Stat for number of times the RAS is incorrect. */
diff --git a/src/mem/mem_ctrl.cc b/src/mem/mem_ctrl.cc
index c66d238..717e966 100644
--- a/src/mem/mem_ctrl.cc
+++ b/src/mem/mem_ctrl.cc
@@ -1224,8 +1224,8 @@
 ADD_STAT(bytesWrittenSys,
  "Total written bytes from the system interface side"),

-ADD_STAT(avgRdBWSys, "Average system read bandwidth in MiByte/s"),
-ADD_STAT(avgWrBWSys, "Average system write bandwidth in MiByte/s"),
+ADD_STAT(avgRdBWSys, "Average system read bandwidth in Byte/s"),
+ADD_STAT(avgWrBWSys, "Average system write bandwidth in Byte/s"),

 ADD_STAT(totGap, "Total gap between requests"),
 ADD_STAT(avgGap, "Average gap between requests"),
@@ -1276,8 +1276,8 @@
 .init(ctrl.writeBufferSize)
 .flags(nozero);

-avgRdBWSys.precision(2);
-avgWrBWSys.precision(2);
+avgRdBWSys.precision(8);
+avgWrBWSys.precision(8);
 avgGap.precision(2);

 // per-requestor bytes read and written to memory
@@ -1337,8 +1337,8 @@
 }

 // Formula stats
-avgRdBWSys = (bytesReadSys / 100) / simSeconds;
-avgWrBWSys = (bytesWrittenSys / 100) / simSeconds;
+avgRdBWSys = (bytesReadSys) / simSeconds;
+avgWrBWSys = (bytesWrittenSys) / simSeconds;

 avgGap = totGap / (readReqs + writeReqs);

diff --git a/src/mem/mem_interface.cc b/src/mem/mem_interface.cc
index d81d34c..52d601e 100644
--- a/src/mem/mem_interface.cc
+++ b/src/mem/mem_interface.cc
@@ -1786,28 +1786,34 @@

 // The energy components inside the power lib are calculated over
 // the window so accumulate into the corresponding gem5 stat
-stats.actEnergy += energy.act_energy * dram.devicesPerRank;
-stats.preEnergy += energy.pre_energy * dram.devicesPerRank;
-stats.readEnergy += energy.read_energy * dram.devicesPerRank;
-stats.writeEnergy += energy.write_energy * dram.devicesPerRank;
- 

[gem5-dev] test library error

2021-02-08 Thread Gabe Black via gem5-dev
Hi folks. In the kokoro log for this run, I see the below error. I suspect
it timed out? In any case, it looks like there's a bug in the testing
library somebody might want to look into.

https://gem5-review.googlesource.com/c/public/gem5/+/40795/3
https://source.cloud.google.com/results/invocations/558d1dfb-a6bd-46f9-baac-6f53d3ac0fd3


 Results: 597 Passed, 6 Failed, 1 Errored in 1.3e+04 seconds
== Traceback (most recent call last): File "./main.py", line 25, in
 sys.exit(testlib()) File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/main.py", line 331,
in main result = globals()['do_'+configuration.config.command]() File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/main.py", line 303,
in do_run return run_schedule(test_schedule, log_handler) File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/main.py", line 277,
in run_schedule log_handler.finish_testing() File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/main.py", line 68,
in finish_testing self.result_handler.close() File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/handlers.py", line
164, in close self._save() File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/handlers.py", line
156, in _save result.JUnitSavedResults.save( File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/result.py", line
330, in save results = JUnitTestSuites(results) File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/result.py", line
238, in __init__ self.elements.append(JUnitTestSuite(suite)) File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/result.py", line
264, in __init__ self.elements.append(JUnitTestCase(test)) File
"/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/result.py", line
277, in __init__ XMLAttribute('time', str(test_result.time["user_time"])),
File "/tmpfs/src/git/jenkins-gem5-prod/tests/../ext/testlib/result.py",
line 77, in time return self._metadata.time AttributeError:
'TestCaseMetadata' object has no attribute 'time'
___
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]: sim: Get rid of the IsConforming type trait template.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40495 )


Change subject: sim: Get rid of the IsConforming type trait template.
..

sim: Get rid of the IsConforming type trait template.

The idea of this template was to distinguish types which should
grow/shrink based on the native size of the ABI in question. Or in other
words, if the ABI was 32 bit, the type should also be 32 bit, or 64 bit
and 64 bit.

Unfortunately, I had intended for Addr to be a conforming type (since
local pointers would be conforming), but uint64_t not to be. Since Addr
is defined as a typedef of uint64_t, the compiler would make *both*
types conforming, giving incorrect behavior on 32 bit systems.

Local pointers will need to be handled in a different way, likely with
the VPtr template, so that they will be treated correctly and not like
an explicitly 64 bit data type.

Change-Id: Idfdd5351260b48bb531a1926b93e0478a297826d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40495
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M src/arch/arm/aapcs32.hh
M src/arch/arm/reg_abi.hh
M src/arch/sparc/se_workload.hh
M src/arch/x86/linux/se_workload.hh
M src/sim/syscall_abi.hh
5 files changed, 10 insertions(+), 39 deletions(-)

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



diff --git a/src/arch/arm/aapcs32.hh b/src/arch/arm/aapcs32.hh
index a0f09b8..a1345bd 100644
--- a/src/arch/arm/aapcs32.hh
+++ b/src/arch/arm/aapcs32.hh
@@ -160,9 +160,7 @@
 static void
 store(ThreadContext *tc, const Integer )
 {
-if (std::is_same::value) {
-tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)i);
-} else if (ArmISA::byteOrder(tc) == ByteOrder::little) {
+if (ArmISA::byteOrder(tc) == ByteOrder::little) {
 tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)(i >> 0));
 tc->setIntReg(ArmISA::INTREG_R1, (uint32_t)(i >> 32));
 } else {
@@ -199,11 +197,6 @@
 static Integer
 get(ThreadContext *tc, Aapcs32::State )
 {
-if (std::is_same::value &&
-state.ncrn <= state.MAX_CRN) {
-return tc->readIntReg(state.ncrn++);
-}
-
 if (alignof(Integer) == 8 && (state.ncrn % 2))
 state.ncrn++;

diff --git a/src/arch/arm/reg_abi.hh b/src/arch/arm/reg_abi.hh
index eb87eff..94dea18 100644
--- a/src/arch/arm/reg_abi.hh
+++ b/src/arch/arm/reg_abi.hh
@@ -55,6 +55,7 @@
 struct Argument::value &&
+std::is_integral::value &&
 ABI::template IsWide::value>>
 {
 static Arg
diff --git a/src/arch/sparc/se_workload.hh b/src/arch/sparc/se_workload.hh
index e39261d..7303010 100644
--- a/src/arch/sparc/se_workload.hh
+++ b/src/arch/sparc/se_workload.hh
@@ -105,6 +105,7 @@
 template 
 struct Argument::value &&
 SparcISA::SEWorkload::SyscallABI32::IsWide::value>>
 {
 using ABI = SparcISA::SEWorkload::SyscallABI32;
diff --git a/src/arch/x86/linux/se_workload.hh  
b/src/arch/x86/linux/se_workload.hh

index c1cd234..cd26e04 100644
--- a/src/arch/x86/linux/se_workload.hh
+++ b/src/arch/x86/linux/se_workload.hh
@@ -93,7 +93,7 @@

 template 
 struct Argument::value &&
 X86ISA::EmuLinux::SyscallABI32::IsWide::value>>
 {
 using ABI = X86ISA::EmuLinux::SyscallABI32;
diff --git a/src/sim/syscall_abi.hh b/src/sim/syscall_abi.hh
index 9d55202..a60af42 100644
--- a/src/sim/syscall_abi.hh
+++ b/src/sim/syscall_abi.hh
@@ -36,18 +36,6 @@

 class SyscallDesc;

-namespace GuestABI
-{
-
-// Does this normally 64 bit data type shrink down to 32 bits for 32 bit  
ABIs?

-template 
-struct IsConforming : public std::false_type {};
-
-template <>
-struct IsConforming : public std::true_type {};
-
-} // namespace GuestABI
-
 struct GenericSyscallABI
 {
 using State = int;
@@ -64,25 +52,12 @@

 // Is this argument too big for a single register?
 template 
-struct IsWide;
+struct IsWide : public std::false_type {};

 template 
-struct IsWide::value &&
-(sizeof(T) <= sizeof(UintPtr) ||
- GuestABI::IsConforming::value)>>
-{
-static const bool value = false;
-};
-
-template 
-struct IsWide::value &&
-(sizeof(T) > sizeof(UintPtr)) &&
-!GuestABI::IsConforming::value>>
-{
-static const bool value = true;
-};
+struct IsWide sizeof(UintPtr))>> :
+public std::true_type
+{};

 // Read two registers and merge them into one value.
 static uint64_t
@@ -117,7 +92,8 @@
 // arguments aren't handled generically.
 template 
 struct Argument::value>>
+typename std::enable_if_t::value &&
+!ABI::template IsWide::value>>
 {
 static Arg
 get(ThreadContext *tc, typename ABI::State )



The change was submitted with unreviewed changes in the following files:

--
To view, visit 

[gem5-dev] Change in gem5/gem5[develop]: arch,sim: Use VPtr<> instead of Addr in system call signatures.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40498 )


Change subject: arch,sim: Use VPtr<> instead of Addr in system call  
signatures.

..

arch,sim: Use VPtr<> instead of Addr in system call signatures.

This tells the GuestABI mechanism that these are guest pointers and not
uint64_ts, and that they should be treated as 32 bit or 64 bit values
depending on the size of pointers in the target ABI.

Change-Id: Ia9b5447848c52668a975d8b07b11ad457e756b13
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40498
Maintainer: Gabe Black 
Tested-by: kokoro 
Reviewed-by: Bobby R. Bruce 
---
M src/arch/arm/freebsd/se_workload.cc
M src/arch/mips/linux/se_workload.cc
M src/arch/sparc/linux/syscalls.cc
M src/sim/syscall_emul.cc
M src/sim/syscall_emul.hh
5 files changed, 120 insertions(+), 112 deletions(-)

Approvals:
  Bobby R. Bruce: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/arm/freebsd/se_workload.cc  
b/src/arch/arm/freebsd/se_workload.cc

index ab6b03e..661a4a9 100644
--- a/src/arch/arm/freebsd/se_workload.cc
+++ b/src/arch/arm/freebsd/se_workload.cc
@@ -83,8 +83,8 @@

 #if !defined ( __GNU_LIBRARY__ )
 static SyscallReturn
-sysctlFunc(SyscallDesc *desc, ThreadContext *tc, Addr namep, size_t  
nameLen,

-   Addr oldp, Addr oldlenp, Addr newp, size_t newlen)
+sysctlFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> namep, size_t  
nameLen,

+   VPtr<> oldp, VPtr<> oldlenp, VPtr<> newp, size_t newlen)
 {
 uint64_t ret;

diff --git a/src/arch/mips/linux/se_workload.cc  
b/src/arch/mips/linux/se_workload.cc

index 0abe263..ef12f4f 100644
--- a/src/arch/mips/linux/se_workload.cc
+++ b/src/arch/mips/linux/se_workload.cc
@@ -124,7 +124,7 @@
 /// Target sys_setsysinfo() handler.
 static SyscallReturn
 sys_setsysinfoFunc(SyscallDesc *desc, ThreadContext *tc, unsigned op,
-   Addr bufPtr, unsigned nbytes)
+   VPtr<> bufPtr, unsigned nbytes)
 {
 switch (op) {

@@ -147,7 +147,7 @@
 }

 static SyscallReturn
-setThreadAreaFunc(SyscallDesc *desc, ThreadContext *tc, Addr addr)
+setThreadAreaFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> addr)
 {
 tc->setMiscRegNoEffect(MISCREG_TP_VALUE, addr);
 return 0;
diff --git a/src/arch/sparc/linux/syscalls.cc  
b/src/arch/sparc/linux/syscalls.cc

index a00f60e..17cc705 100644
--- a/src/arch/sparc/linux/syscalls.cc
+++ b/src/arch/sparc/linux/syscalls.cc
@@ -54,7 +54,7 @@

 static SyscallReturn
 getresuidFunc(SyscallDesc *desc, ThreadContext *tc,
-  Addr ruid, Addr euid, Addr suid)
+  VPtr<> ruid, VPtr<> euid, VPtr<> suid)
 {
 const uint64_t id = htobe(100);
 // Handle the EFAULT case
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 8f04cd5..4f6716b 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -89,7 +89,7 @@
 }

 static void
-exitFutexWake(ThreadContext *tc, Addr addr, uint64_t tgid)
+exitFutexWake(ThreadContext *tc, VPtr<> addr, uint64_t tgid)
 {
 // Clear value at address pointed to by thread's childClearTID field.
 BufferArg ctidBuf(addr, sizeof(long));
@@ -243,7 +243,7 @@


 SyscallReturn
-brkFunc(SyscallDesc *desc, ThreadContext *tc, Addr new_brk)
+brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
 {
 // change brk addr to first arg
 auto p = tc->getProcessPtr();
@@ -300,7 +300,7 @@
 SyscallReturn
 _llseekFunc(SyscallDesc *desc, ThreadContext *tc,
 int tgt_fd, uint64_t offset_high, uint32_t offset_low,
-Addr result_ptr, int whence)
+VPtr<> result_ptr, int whence)
 {
 auto p = tc->getProcessPtr();

@@ -325,7 +325,7 @@


 SyscallReturn
-munmapFunc(SyscallDesc *desc, ThreadContext *tc, Addr start, size_t length)
+munmapFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> start, size_t  
length)

 {
 // Even if the system is currently not capable of recycling physical
 // pages, there is no reason we can't unmap them so that we trigger
@@ -348,7 +348,7 @@

 SyscallReturn
 gethostnameFunc(SyscallDesc *desc, ThreadContext *tc,
-Addr buf_ptr, int name_len)
+VPtr<> buf_ptr, int name_len)
 {
 BufferArg name(buf_ptr, name_len);
 strncpy((char *)name.bufferPtr(), hostname, name_len);
@@ -358,7 +358,7 @@

 SyscallReturn
 getcwdFunc(SyscallDesc *desc, ThreadContext *tc,
-   Addr buf_ptr, unsigned long size)
+   VPtr<> buf_ptr, unsigned long size)
 {
 int result = 0;
 auto p = tc->getProcessPtr();
@@ -388,7 +388,7 @@

 SyscallReturn
 readlinkFunc(SyscallDesc *desc, ThreadContext *tc,
- Addr pathname, Addr buf_ptr, size_t bufsiz)
+ VPtr<> pathname, VPtr<> buf_ptr, size_t bufsiz)
 {
 std::string path;
 auto p = tc->getProcessPtr();
@@ -445,7 +445,7 @@
 }

 SyscallReturn

[gem5-dev] Change in gem5/gem5[develop]: base-stats: Add support for unit prefixes

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



Change subject: base-stats: Add support for unit prefixes
..

base-stats: Add support for unit prefixes

Change-Id: Ic15f2933f731bb032f27885b6e3ee71efc365712
Signed-off-by: Hoa Nguyen 
---
A src/base/stats/unit_prefixes.hh
M src/base/stats/units.hh
M src/cpu/base.cc
M src/cpu/minor/stats.cc
4 files changed, 229 insertions(+), 98 deletions(-)



diff --git a/src/base/stats/unit_prefixes.hh  
b/src/base/stats/unit_prefixes.hh

new file mode 100644
index 000..355f8b4
--- /dev/null
+++ b/src/base/stats/unit_prefixes.hh
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2021 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * 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;
+ * neither the name of the copyright holders 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
+ * OWNER 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.
+ */
+
+#ifndef __BASE_STATS_UNIT_PREFIXES_HH__
+#define __BASE_STATS_UNIT_PREFIXES_HH__
+
+namespace Stats {
+
+/**
+ * Unit Prefixes for Stats.
+ *
+ * The supported units are:
+ *   - Kilo: 1e3
+ */
+namespace Units {
+
+/**
+ * The Base class is the parent class of all unit classes.
+ * This class is intended to an abstract class specifying common behaviors  
of

+ * all unit classes.
+ */
+class Base
+{
+};
+
+class One : public Base
+{
+  public:
+static std::string toString() { return ""; }
+};
+
+
+class Kilo : public Base
+{
+  public:
+static std::string toString() { return "Kilo"; }
+};
+
+class Mega : public Base
+{
+  public:
+static std::string toString() { return "Mega"; }
+};
+
+} // namespace UnitPrefixes
+
+} // namespace Stats
+
+#endif // __BASE_STATS_UNITS_HH__
\ No newline at end of file
diff --git a/src/base/stats/units.hh b/src/base/stats/units.hh
index 66fe9ce..6ffb263 100644
--- a/src/base/stats/units.hh
+++ b/src/base/stats/units.hh
@@ -36,22 +36,34 @@
 /**
  * Convenience macros to declare the unit of a stat.
  */
-#define UNIT_CYCLE Stats::Units::Cycle::get()
-#define UNIT_TICK Stats::Units::Tick::get()
-#define UNIT_SECOND Stats::Units::Second::get()
-#define UNIT_INSTRUCTION Stats::Units::Instruction::get()
-#define UNIT_MICROOP Stats::Units::MicroOp::get()
-#define UNIT_BIT Stats::Units::Bit::get()
-#define UNIT_BYTE Stats::Units::Byte::get()
-#define UNIT_JOULE Stats::Units::Joule::get()
-#define UNIT_VOLT Stats::Units::Volt::get()
-#define UNIT_CELSIUS Stats::Units::DegreeCelsius::get()
-#define UNIT_RATE(T1, T2) Stats::Units::Rate::get()
-#define UNIT_RATIO Stats::Units::Ratio::get()
-#define UNIT_COUNT Stats::Units::Count::get()
+#define UNIT_PREFIX_PICO Stats::Units::Prefixes::Pico
+#define UNIT_PREFIX_NANO Stats::Units::Prefixes::Nano
+#define UNIT_PREFIX_MICRO Stats::Units::Prefixes::Micro
+#define UNIT_PREFIX_MILLI Stats::Units::Prefixes::Milli
+#define UNIT_PREFIX_ONE Stats::Units::Prefixes::One
+#define UNIT_PREFIX_KILO Stats::Units::Prefixes::Kilo
+#define UNIT_PREFIX_MEGA Stats::Units::Prefixes::Mega
+#define UNIT_PREFIX_GIGA Stats::Units::Prefixes::Giga
+
+
+#define UNIT_CYCLE Stats::Units::Cycle::get()
+#define UNIT_TICK Stats::Units::Tick::get()
+#define UNIT_SECOND Stats::Units::Second::get()
+#define UNIT_INSTRUCTION Stats::Units::Instruction::get()
+#define UNIT_MICROOP Stats::Units::MicroOp::get()
+#define UNIT_BIT Stats::Units::Bit::get()
+#define UNIT_BYTE Stats::Units::Byte::get()
+#define UNIT_JOULE Stats::Units::Joule::get()
+#define UNIT_VOLT Stats::Units::Volt::get()
+#define UNIT_CELSIUS Stats::Units::DegreeCelsius::get()
+#define UNIT_RATE(T1, T2) 

[gem5-dev] Re: Upstreaming power-gem5

2021-02-08 Thread Jason Lowe-Power via gem5-dev
Wow! Thanks for all of the work here! It's cool to see all of the
excitement around POWER support!

Just to be clear, because I think it was a little ambiguous in other
conversations, I'm very supportive of improving the POWER support in gem5
given that there are a significant number of people who want to use it. Not
long ago, there seemed to be little interest in POWER from the community,
which was influencing my push to limit the effort towards that ISA.

A couple of notes:
1. Per Bobby's recent email, we are *planning* (though plans can always
change) to mark a new gem5 release at the end of the month. In **one
week**, we are planning to create the staging branch which is the time that
no new features can be integrated for the release. If there's strong
support in the community, we can hold off for the improved POWER support,
but with all of the changes that need to be reviewed, it seems unlikely to
happen in 1 week. I suggest improved POWER support to be a main feature of
the next release (gem5-21.1 probably sometime in May or June).
2. Since we have a release coming up in 3 weeks, it is unlikely that I or
my team will have much time to look at these changes. With our limited
resources, we need to focus on finishing the features that we have started
and the general stability of gem5.

As I said, I'm very excited to see these improvements to gem5! And, I'm
looking forward to seeing the community grow!

Cheers,
Jason

On Sun, Feb 7, 2021 at 10:32 PM Sandipan Das via gem5-dev 
wrote:

> +CC: Luke
>
> On 08/02/21 10:26 am, Sandipan Das wrote:
> > Hello Boris, Gabe,
> >
> > I have rebased and pushed the changes to gerrit.
> > This is link to the first patch in the series:
> > https://gem5-review.googlesource.com/c/public/gem5/+/40880
> >
> >
> ___
> 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 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-arm: Reduce boilerplate when read/writing to Pio devices

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


Change subject: dev-arm: Reduce boilerplate when read/writing to Pio devices
..

dev-arm: Reduce boilerplate when read/writing to Pio devices

Change-Id: Id59ac950f37d7f4f2642daf324d501da1ee622de
Signed-off-by: Giacomo Travaglini 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40775
Reviewed-by: Andreas Sandberg 
Maintainer: Andreas Sandberg 
Tested-by: kokoro 
---
M src/dev/arm/pl011.cc
M src/dev/arm/rtc_pl031.cc
M src/dev/arm/ufs_device.cc
3 files changed, 9 insertions(+), 70 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc
index ea76416..cfe241d 100755
--- a/src/dev/arm/pl011.cc
+++ b/src/dev/arm/pl011.cc
@@ -64,6 +64,7 @@
 Pl011::read(PacketPtr pkt)
 {
 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr +  
pioSize);

+assert(pkt->getSize() <= 4);

 Addr daddr = pkt->getAddr() - pioAddr;

@@ -145,22 +146,7 @@
 break;
 }

-switch(pkt->getSize()) {
-  case 1:
-pkt->setLE(data);
-break;
-  case 2:
-pkt->setLE(data);
-break;
-  case 4:
-pkt->setLE(data);
-break;
-  default:
-panic("Uart read size too big?\n");
-break;
-}
-
-
+pkt->setUintX(data, ByteOrder::little);
 pkt->makeAtomicResponse();
 return pioDelay;
 }
@@ -170,6 +156,7 @@
 {

 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr +  
pioSize);

+assert(pkt->getSize() <= 4);

 Addr daddr = pkt->getAddr() - pioAddr;

@@ -179,23 +166,7 @@
 // use a temporary data since the uart registers are read/written with
 // different size operations
 //
-uint32_t data = 0;
-
-switch(pkt->getSize()) {
-  case 1:
-data = pkt->getLE();
-break;
-  case 2:
-data = pkt->getLE();
-break;
-  case 4:
-data = pkt->getLE();
-break;
-  default:
-panic("Uart write size too big?\n");
-break;
-}
-
+const uint32_t data = pkt->getUintX(ByteOrder::little);

 switch (daddr) {
 case UART_DR:
diff --git a/src/dev/arm/rtc_pl031.cc b/src/dev/arm/rtc_pl031.cc
index a6cdc7d..de84384 100644
--- a/src/dev/arm/rtc_pl031.cc
+++ b/src/dev/arm/rtc_pl031.cc
@@ -61,7 +61,7 @@
 PL031::read(PacketPtr pkt)
 {
 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr +  
pioSize);

-assert(pkt->getSize() == 4);
+assert(pkt->getSize() <= 4);
 Addr daddr = pkt->getAddr() - pioAddr;
 uint32_t data;

@@ -99,22 +99,7 @@
 break;
 }

-switch(pkt->getSize()) {
-  case 1:
-pkt->setLE(data);
-break;
-  case 2:
-pkt->setLE(data);
-break;
-  case 4:
-pkt->setLE(data);
-break;
-  default:
-panic("Uart read size too big?\n");
-break;
-}
-
-
+pkt->setUintX(data, ByteOrder::little);
 pkt->makeAtomicResponse();
 return pioDelay;
 }
@@ -123,7 +108,7 @@
 PL031::write(PacketPtr pkt)
 {
 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr +  
pioSize);

-assert(pkt->getSize() == 4);
+assert(pkt->getSize() <= 4);
 Addr daddr = pkt->getAddr() - pioAddr;
 DPRINTF(Timer, "Writing to RTC at offset: %#x\n", daddr);

diff --git a/src/dev/arm/ufs_device.cc b/src/dev/arm/ufs_device.cc
index 1406e4a..e04cb39 100644
--- a/src/dev/arm/ufs_device.cc
+++ b/src/dev/arm/ufs_device.cc
@@ -1029,26 +1029,9 @@
 Tick
 UFSHostDevice::write(PacketPtr pkt)
 {
-uint32_t data = 0;
+assert(pkt->getSize() <= 4);

-switch (pkt->getSize()) {
-
-  case 1:
-data = pkt->getLE();
-break;
-
-  case 2:
-data = pkt->getLE();
-break;
-
-  case 4:
-data = pkt->getLE();
-break;
-
-  default:
-panic("Undefined UFSHCD controller write size!\n");
-break;
-}
+const uint32_t data = pkt->getUintX(ByteOrder::little);

 switch (pkt->getAddr() & 0xFF)
 {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40775
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: Id59ac950f37d7f4f2642daf324d501da1ee622de
Gerrit-Change-Number: 40775
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Giacomo Travaglini 
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-arm: Add VRAM to VExpress_GEM5_Base

2021-02-08 Thread Giacomo Travaglini (Gerrit) via gem5-dev
Giacomo Travaglini has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40973 )



Change subject: dev-arm: Add VRAM to VExpress_GEM5_Base
..

dev-arm: Add VRAM to VExpress_GEM5_Base

Change-Id: Ibd3ae59730c6d00a6bd8b129f973b79a565f66e4
Signed-off-by: Giacomo Travaglini 
---
M src/dev/arm/RealView.py
1 file changed, 10 insertions(+), 1 deletion(-)



diff --git a/src/dev/arm/RealView.py b/src/dev/arm/RealView.py
index 8969bc0..755cfa5 100644
--- a/src/dev/arm/RealView.py
+++ b/src/dev/arm/RealView.py
@@ -964,7 +964,11 @@
0x1002-0x1002: gem5 MHU

0x1400-0x17ff: Reserved (Off-chip, PSRAM, CS1)
-   0x1800-0x1bff: Reserved (Off-chip, Peripherals, CS2)
+
+   0x1800-0x1bff: Off-chip, Peripherals, CS2
+   0x1800-0x19ff: VRAM
+   0x1a00-0x1bff: Reserved
+
0x1c00-0x1fff: Peripheral block 1 (Off-chip, CS3):
0x1c01-0x1c01: realview_io (VE system control regs.)
0x1c06-0x1c06: KMI0 (keyboard)
@@ -1171,6 +1175,10 @@
 flash1 = SimpleMemory(range=AddrRange(0x0c00, 0x1000),
   conf_table_reported=False)

+# VRAM
+vram = SimpleMemory(range = AddrRange(0x1800, size='32MB'),
+conf_table_reported = False)
+
 def _off_chip_devices(self):
 return [
 self.realview_io,
@@ -1190,6 +1198,7 @@
 def _off_chip_memory(self):
 return [
 self.flash1,
+self.vram,
 ]

 def __init__(self, **kwargs):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40973
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: Ibd3ae59730c6d00a6bd8b129f973b79a565f66e4
Gerrit-Change-Number: 40973
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
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] Re: version of pybind11 without everything in the headers

2021-02-08 Thread Gabe Black via gem5-dev
Awesome, it sounds like you've made some great progress. I'm looking
forward to it!

Gabe

On Mon, Feb 8, 2021 at 2:39 AM Ciro Santilli  wrote:

> Gabe,
>
> Following a long chain of links from those patches should eventually lead
> to: https://github.com/pybind/pybind11/pull/2445 passing through
> https://gem5.atlassian.net/browse/GEM5-572
>
> The current status is: upstream has said they will merge my split patch at
> some point. But since it conflicts with everything, they are waiting for a
> good moment to do that when their major patches get all merged. Then when
> tell me to rebase, I'll rebase and they will merge immediately, and then
> I'll send a patch into gem5 updating pybind11 and updating the build system
> to take advantage of it.
>
> I've been pinging them on major Western holidays :-)
>
> --
> *From:* Giacomo Travaglini 
> *Sent:* Thursday, February 4, 2021 12:01 PM
> *To:* gem5 Developer List ; Ciro Santilli <
> ciro.santi...@arm.com>
> *Cc:* Gabe Black 
> *Subject:* RE: [gem5-dev] version of pybind11 without everything in the
> headers
>
> Hi Gabe,
>
> I believe you are referring to the following ticket:
>
> https://gem5.atlassian.net/browse/GEM5-277
>
> Ciro is currently on vacation and he will be back next week so he will be
> able to update
> you on his progresses. IIRC pybind folks are reviewing his contribution
> but I cannot provide
> you a timeline (Ciro might)
>
> Kind Regards
>
> Giacomo
>
> > -Original Message-
> > From: Gabe Black via gem5-dev 
> > Sent: 04 February 2021 09:45
> > To: gem5 Developer List ; Ciro Santilli
> > 
> > Cc: Gabe Black 
> > Subject: [gem5-dev] version of pybind11 without everything in the headers
> >
> > Hey folks and particularly Ciro, I know a while ago there was an attempt
> to put
> > the common contents of pybind11 into a lib. Did that go anywhere? That
> > would reduce build time which would be valuable, but from this change
> it's
> > apparent that all those common symbols are *really* blowing up the build
> > directory.
> >
> > https://gem5-review.googlesource.com/c/public/gem5/+/40621/1
> >
> >
> > Gabe
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
___
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] Major cleanup of SConstruct, reviews requested

2021-02-08 Thread Gabe Black via gem5-dev
Hey folks. I've uploaded about 50 CLs which go through and scrub down
SConstruct pretty thoroughly. Rather than add a bunch of people to all the
reviews and have emails flying everywhere which nobody can keep track of, I
thought I'd just drop a pointer here, and if someone wants to go review
some CLs that would be great.

I know some people are intimidated by scons stuff, but these changes are
generally pretty small, and largely just shuffling things around python
wise. To that end, I think I did a pretty good job trimming things back and
putting things away, so hopefully SConstruct will be fairly clear and a lot
easier to grok.

There are still more things I might want to do with it in the future, but I
think the current stack of reviews is plenty for now.

https://gem5-review.googlesource.com/c/public/gem5/+/40972/1

Gabe
___
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]: scons: Update comments in SConstruct.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40972 )



Change subject: scons: Update comments in SConstruct.
..

scons: Update comments in SConstruct.

Make them consistently styled, gramatically and factually correct, and
try to make sure they're reasonably clear.

Change-Id: I3566734b0ac386113ef45ac7fd24c9fb1f2007d3
---
M SConstruct
1 file changed, 69 insertions(+), 32 deletions(-)



diff --git a/SConstruct b/SConstruct
index 7397d03..adad0e9 100755
--- a/SConstruct
+++ b/SConstruct
@@ -47,7 +47,7 @@
 # While in this directory ('gem5'), just type 'scons' to build the default
 # configuration (see below), or type 'scons build//'
 # to build some other configuration (e.g., 'build/X86/gem5.opt' for
-# the optimized full-system version).
+# the optimized X86 version).
 #
 # You can build gem5 in a different directory as long as there is a
 # 'build/' somewhere along the target path.  The build system
@@ -75,7 +75,7 @@
 #
 ###

-# Global Python includes
+# Global Python imports
 import atexit
 import os
 import sys
@@ -85,13 +85,20 @@
 from os.path import isdir, isfile
 from os.path import join, split

-# SCons includes
+# SCons imports
 import SCons
 import SCons.Node
 import SCons.Node.FS

 from m5.util import compareVersions, readCommand, readCommandWithReturn

+
+
+#
+# Command line options.
+#
+
+
 AddOption('--no-colors', dest='use_colors', action='store_false',
   help="Don't add color to abbreviated scons output")
 AddOption('--with-cxx-config', action='store_true',
@@ -118,6 +125,8 @@
 AddOption('--with-systemc-tests', action='store_true',
   help='Build systemc tests')

+# Imports of gem5_scons happen here since it depends on some options which  
are

+# declared above.
 from gem5_scons import error, warning, summarize_warnings, parse_build_path
 from gem5_scons import EnvDefaults, MakeAction, MakeActionTool
 import gem5_scons
@@ -125,6 +134,7 @@

 Export('MakeAction')

+
 
 #
 # Set up the main build environment.
@@ -136,6 +146,8 @@
 ConfigFile, AddLocalRPATH, SwitchingHeaders,
 ])

+Export('main')
+
 from gem5_scons.util import get_termcap
 termcap = get_termcap()

@@ -143,15 +155,16 @@
 if not ('CC' in main and 'CXX' in main):
 error("No C++ compiler installed (package g++ on Ubuntu and RedHat)")

-###
+# Find default configuration & binary.
+Default(environ.get('M5_DEFAULT_BINARY', 'build/ARM/gem5.debug'))
+
+
+
 #
 # Figure out which configurations to set up based on the path(s) of
 # the target(s).
 #
-###
-
-# Find default configuration & binary.
-Default(environ.get('M5_DEFAULT_BINARY', 'build/ARM/gem5.debug'))
+

 # Take a list of paths (or SCons Nodes) and return a list with all
 # paths made absolute and ~-expanded.  Paths will be interpreted
@@ -193,14 +206,15 @@
 mkdir(build_root)
 main['BUILDROOT'] = build_root

-Export('main')
-
 main.SConsignFile(os.path.join(build_root, "sconsign"))

+
+
 #
 # Set up global sticky variables... these are common to an entire build
 # tree (not specific to a particular build like X86)
 #
+

 global_vars_file = os.path.join(build_root, 'variables.global')

@@ -233,6 +247,13 @@
 # Save sticky variable settings back to current variables file
 global_vars.Save(global_vars_file, main)

+
+
+#
+# Set up various paths.
+#
+
+
 # Parse EXTRAS variable to build list of all directories where we're
 # look for sources etc.  This list is exported as extras_dir_list.
 base_dir = Dir('#src').abspath
@@ -250,6 +271,14 @@
 # Add shared top-level headers
 main.Prepend(CPPPATH=Dir('include'))

+
+
+#
+# Set command line options based on the configuration of the host and
+# build settings.
+#
+
+
 # Initialize the Link-Time Optimization (LTO) flags
 main['LTO_CCFLAGS'] = []
 main['LTO_LDFLAGS'] = []
@@ -396,10 +425,6 @@
 # cygwin has some header file issues...
 main.Append(CCFLAGS=["-Wno-uninitialized"])

-
-main['HAVE_PKG_CONFIG'] = main.Detect('pkg-config')
-
-
 # We should 

[gem5-dev] Change in gem5/gem5[develop]: scons: Create a small helper function for disecting a build target path.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40970 )



Change subject: scons: Create a small helper function for disecting a build  
target path.

..

scons: Create a small helper function for disecting a build target path.

This function does about half of the work of the loop which determines
the build root and the list of variants.

Change-Id: I4f44d1e2643244a4be889c677b25b83d41a39b19
---
M SConstruct
M site_scons/gem5_scons/__init__.py
2 files changed, 20 insertions(+), 16 deletions(-)



diff --git a/SConstruct b/SConstruct
index c1801f6..6f7c353 100755
--- a/SConstruct
+++ b/SConstruct
@@ -119,7 +119,7 @@
 AddOption('--with-systemc-tests', action='store_true',
   help='Build systemc tests')

-from gem5_scons import Transform, error, warning, summarize_warnings
+from gem5_scons import error, warning, summarize_warnings, parse_build_path
 from gem5_scons import EnvDefaults, MakeAction, MakeActionTool
 import gem5_scons
 from gem5_scons.builders import ConfigFile, AddLocalRPATH, SwitchingHeaders
@@ -177,21 +177,9 @@
 variant_paths = set()
 build_root = None
 for t in BUILD_TARGETS:
-path_dirs = t.split('/')
-
-# Pop off the target file.
-path_dirs.pop()
-
-# Search backwards for the "build" directory. Whatever was just before  
it

-# was the name of the variant.
-variant_dir = path_dirs.pop()
-while path_dirs and path_dirs[-1] != 'build':
-variant_dir = path_dirs.pop()
-if not path_dirs:
-error("No non-leaf 'build' dir found on target path.", t)
+this_build_root, variant = parse_build_path(t)

 # Make sure all targets use the same build root.
-this_build_root = os.path.join('/', *path_dirs)
 if not build_root:
 build_root = this_build_root
 elif this_build_root != build_root:
@@ -199,7 +187,7 @@
 (build_root, this_build_root))

 # Collect all the variants into a set.
-variant_paths.add(os.path.join('/', *path_dirs, variant_dir))
+variant_paths.add(os.path.join('/', build_root, variant))

 # Make sure build_root exists (might not if this is the first build there)
 if not isdir(build_root):
diff --git a/site_scons/gem5_scons/__init__.py  
b/site_scons/gem5_scons/__init__.py

index c16ab76..6afe585 100644
--- a/site_scons/gem5_scons/__init__.py
+++ b/site_scons/gem5_scons/__init__.py
@@ -224,5 +224,21 @@
 env['SHCCCOMSTR']  = Transform("SHCC")
 env['SHCXXCOMSTR'] = Transform("SHCXX")

+def parse_build_path(target):
+path_dirs = target.split('/')
+
+# Pop off the target file.
+path_dirs.pop()
+
+# Search backwards for the "build" directory. Whatever was just before  
it

+# was the name of the variant.
+variant_dir = path_dirs.pop()
+while path_dirs and path_dirs[-1] != 'build':
+variant_dir = path_dirs.pop()
+if not path_dirs:
+error("No non-leaf 'build' dir found on target path.", t)
+
+return os.path.join('/', *path_dirs), variant_dir
+
 __all__ = ['Configure', 'EnvDefaults', 'Transform', 'warning', 'error',
-   'MakeAction', 'MakeActionTool']
+   'MakeAction', 'MakeActionTool', 'parse_build_dir']

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40970
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: I4f44d1e2643244a4be889c677b25b83d41a39b19
Gerrit-Change-Number: 40970
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Simplify finding the python lib with ParseConfig.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40971 )



Change subject: scons: Simplify finding the python lib with ParseConfig.
..

scons: Simplify finding the python lib with ParseConfig.

A comment in that section of SConstruct talked about how ParseConfig
couldn't understand -Xlinker and -export-dynamic, and how that meant
they needed to parse the output of python-config manually. Some
searching around turned up this:

https://bugs.python.org/issue36508

which seems to suggest that exactly those two options weren't actually
supposed to be returned by python-config in the first place, and are
really for python's own internal build.

Change-Id: I1a50eb030019a447b919381c32168fb3bb27b89b
---
M SConstruct
1 file changed, 13 insertions(+), 47 deletions(-)



diff --git a/SConstruct b/SConstruct
index 6f7c353..7397d03 100755
--- a/SConstruct
+++ b/SConstruct
@@ -84,7 +84,6 @@
 from os.path import abspath, dirname, expanduser
 from os.path import isdir, isfile
 from os.path import join, split
-from re import match

 # SCons includes
 import SCons
@@ -423,11 +422,8 @@
 if main['USE_PYTHON']:
 # Find Python include and library directories for embedding the
 # interpreter. We rely on python-config to resolve the appropriate
-# includes and linker flags. ParseConfig does not seem to understand
-# the more exotic linker flags such as -Xlinker and -export-dynamic so
-# we add them explicitly below. If you want to link in an alternate
-# version of python, see above for instructions on how to invoke
-# scons with the appropriate PATH set.
+# includes and linker flags. If you want to link in an alternate  
version

+# of python, override the PYTHON_CONFIG variable.

 python_config = main.Detect(main['PYTHON_CONFIG'])
 if python_config is None:
@@ -436,41 +432,13 @@

 print("Info: Using Python config: %s" % (python_config, ))

-py_includes = readCommand([python_config, '--includes'],
-  exception='').split()
-py_includes = list(filter(
-lambda s: match(r'.*\/include\/.*',s), py_includes))
-# Strip the -I from the include folders before adding them to the
-# CPPPATH
-py_includes = list(map(
-lambda s: s[2:] if s.startswith('-I') else s, py_includes))
-main.Append(CPPPATH=py_includes)
+cmd = [python_config, '--ldflags', '--includes']

-# Read the linker flags and split them into libraries and other link
-# flags. The libraries are added later through the call the CheckLib.
-# Note: starting in Python 3.8 the --embed flag is required to get the
-# -lpython3.8 linker flag
-retcode, cmd_stdout = readCommandWithReturn(
-[python_config, '--ldflags', '--embed'], exception='')
-if retcode != 0:
-# If --embed isn't detected then we're running python <3.8
-retcode, cmd_stdout = readCommandWithReturn(
-[python_config, '--ldflags'], exception='')
+# Starting in Python 3.8 the --embed flag is required. Use it if  
supported.

+if conf.TryAction('@%s --embed' % python_config)[0]:
+cmd.append('--embed')

-# Checking retcode again
-if retcode != 0:
-error("Failing on python-config --ldflags command")
-
-py_ld_flags = cmd_stdout.split()
-
-py_libs = []
-for lib in py_ld_flags:
- if not lib.startswith('-l'):
- main.Append(LINKFLAGS=[lib])
- else:
- lib = lib[2:]
- if lib not in py_libs:
- py_libs.append(lib)
+main.ParseConfig(cmd)

 # verify that this stuff works
 if not conf.CheckHeader('Python.h', '<>'):
@@ -483,10 +451,6 @@
   "CC has the wrong value.\n"
   "CC = %s" % main['CC'])

-for lib in py_libs:
-if not conf.CheckLib(lib):
-error("Can't find library %s required by python." % lib)
-
 main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))

 marshal_env = main.Clone()
@@ -501,11 +465,13 @@

 # Found a working Python installation. Check if it meets minimum
 # requirements.
-if py_version[0] < 3 or \
-(py_version[0] == 3 and py_version[1] < 6):
-error('Python version too old. Version 3.6 or newer is required.')
+ver_string = '.'.join(map(str, py_version))
+if py_version[0] < 3 or (py_version[0] == 3 and py_version[1] < 6):
+error('Embedded python library 3.6 or newer required, found %s.' %
+  ver_string)
 elif py_version[0] > 3:
-warning('Python version too new. Python 3 expected.')
+warning('Embedded python library too new. '
+'Python 3 expected, found %s.' % ver_string)

 # On Solaris you need to use libsocket for socket ops
 if not conf.CheckLibWithHeader(

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

[gem5-dev] Change in gem5/gem5[develop]: scons: Pull builder definitions out of SConstruct.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40969 )



Change subject: scons: Pull builder definitions out of SConstruct.
..

scons: Pull builder definitions out of SConstruct.

Put them in site_scons/gem5_scons/builders.py. This decreases the bulk
of SConstruct and keeps related functionality together.

Change-Id: I9e1f2d606c3801131badad15f8f4419186bb7e1d
---
M SConstruct
A site_scons/gem5_scons/builders.py
2 files changed, 154 insertions(+), 97 deletions(-)



diff --git a/SConstruct b/SConstruct
index 20252e8..c1801f6 100755
--- a/SConstruct
+++ b/SConstruct
@@ -122,6 +122,7 @@
 from gem5_scons import Transform, error, warning, summarize_warnings
 from gem5_scons import EnvDefaults, MakeAction, MakeActionTool
 import gem5_scons
+from gem5_scons.builders import ConfigFile, AddLocalRPATH, SwitchingHeaders

 Export('MakeAction')

@@ -132,7 +133,8 @@
 

 main = Environment(tools=[
-'default', 'git', EnvDefaults, MakeActionTool
+'default', 'git', EnvDefaults, MakeActionTool,
+ConfigFile, AddLocalRPATH, SwitchingHeaders,
 ])

 from gem5_scons.util import get_termcap
@@ -590,69 +592,6 @@
 sticky_vars.Add(BoolVariable('USE_EFENCE',
 'Link with Electric Fence malloc debugger', False))

-###
-#
-# Define a SCons builder for configuration flag headers.
-#
-###
-
-# This function generates a config header file that #defines the
-# variable symbol to the current variable setting (0 or 1).  The source
-# operands are the name of the variable and a Value node containing the
-# value of the variable.
-def build_config_file(target, source, env):
-(variable, value) = [s.get_contents().decode('utf-8') for s in source]
-with open(str(target[0].abspath), 'w') as f:
-print('#define', variable, value, file=f)
-return None
-
-# Combine the two functions into a scons Action object.
-config_action = MakeAction(build_config_file, Transform("CONFIG H", 2))
-
-# The emitter munges the source & target node lists to reflect what
-# we're really doing.
-def config_emitter(target, source, env):
-# extract variable name from Builder arg
-variable = str(target[0])
-# True target is config header file
-target = Dir('config').File(variable.lower() + '.hh')
-val = env[variable]
-if isinstance(val, bool):
-# Force value to 0/1
-val = int(val)
-elif isinstance(val, str):
-val = '"' + val + '"'
-
-# Sources are variable name & value (packaged in SCons Value nodes)
-return [target], [Value(variable), Value(val)]
-
-config_builder = Builder(emitter=config_emitter, action=config_action)
-
-main.Append(BUILDERS = { 'ConfigFile' : config_builder })
-
-def add_local_rpath(env, *targets):
-'''Set up an RPATH for a library which lives in the build directory.
-
-The construction environment variable BIN_RPATH_PREFIX should be set to
-the relative path of the build directory starting from the location of  
the

-binary.'''
-for target in targets:
-target = env.Entry(target)
-if not isinstance(target, SCons.Node.FS.Dir):
-target = target.dir
-relpath = os.path.relpath(target.abspath, env['BUILDDIR'])
-components = [
-'\\$$ORIGIN',
-'${BIN_RPATH_PREFIX}',
-relpath
-]
-env.Append(RPATH=[env.Literal(os.path.join(*components))])
-
-if sys.platform != "darwin":
-main.Append(LINKFLAGS=Split('-z origin'))
-
-main.AddMethod(add_local_rpath, 'AddLocalRPATH')
-
 # builds in ext are shared across all configs in the build root.
 ext_dir = Dir('#ext').abspath
 ext_build_dirs = []
@@ -668,39 +607,6 @@

 ###
 #
-# This builder and wrapper method are used to set up a directory with
-# switching headers. Those are headers which are in a generic location and
-# that include more specific headers from a directory chosen at build time
-# based on the current build settings.
-#
-###
-
-def build_switching_header(target, source, env):
-path = str(target[0])
-subdir = str(source[0])
-dp, fp = os.path.split(path)
-dp = os.path.relpath(os.path.realpath(dp),
- os.path.realpath(env['BUILDDIR']))
-with open(path, 'w') as hdr:
-print('#include "%s/%s/%s"' % (dp, subdir, fp), file=hdr)
-
-switching_header_action = MakeAction(build_switching_header,
- Transform('GENERATE'))
-
-switching_header_builder = Builder(action=switching_header_action,
-   source_factory=Value,
-   single_source=True)
-
-main.Append(BUILDERS = { 

[gem5-dev] Change in gem5/gem5[develop]: scons: Move MakeAction into gem5_scons.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40968 )



Change subject: scons: Move MakeAction into gem5_scons.
..

scons: Move MakeAction into gem5_scons.

That will make it usable from builders defined outside of SConstruct.

Change-Id: Id1231a1a370b7d519a382db892ded93c604eb56f
---
M SConstruct
M site_scons/gem5_scons/__init__.py
2 files changed, 30 insertions(+), 20 deletions(-)



diff --git a/SConstruct b/SConstruct
index f158ccc..20252e8 100755
--- a/SConstruct
+++ b/SConstruct
@@ -120,16 +120,20 @@
   help='Build systemc tests')

 from gem5_scons import Transform, error, warning, summarize_warnings
-from gem5_scons import EnvDefaults
+from gem5_scons import EnvDefaults, MakeAction, MakeActionTool
 import gem5_scons

+Export('MakeAction')
+
 
 #
 # Set up the main build environment.
 #
 

-main = Environment(tools=['default', 'git', EnvDefaults])
+main = Environment(tools=[
+'default', 'git', EnvDefaults, MakeActionTool
+])

 from gem5_scons.util import get_termcap
 termcap = get_termcap()
@@ -257,23 +261,6 @@
 # Add shared top-level headers
 main.Prepend(CPPPATH=Dir('include'))

-if GetOption('verbose'):
-def MakeAction(action, string, *args, **kwargs):
-return Action(action, *args, **kwargs)
-else:
-MakeAction = Action
-main['CCCOMSTR']= Transform("CC")
-main['CXXCOMSTR']   = Transform("CXX")
-main['ASCOMSTR']= Transform("AS")
-main['ARCOMSTR']= Transform("AR", 0)
-main['LINKCOMSTR']  = Transform("LINK", 0)
-main['SHLINKCOMSTR']= Transform("SHLINK", 0)
-main['RANLIBCOMSTR']= Transform("RANLIB", 0)
-main['M4COMSTR']= Transform("M4")
-main['SHCCCOMSTR']  = Transform("SHCC")
-main['SHCXXCOMSTR'] = Transform("SHCXX")
-Export('MakeAction')
-
 # Initialize the Link-Time Optimization (LTO) flags
 main['LTO_CCFLAGS'] = []
 main['LTO_LDFLAGS'] = []
diff --git a/site_scons/gem5_scons/__init__.py  
b/site_scons/gem5_scons/__init__.py

index ed3b065..c16ab76 100644
--- a/site_scons/gem5_scons/__init__.py
+++ b/site_scons/gem5_scons/__init__.py
@@ -202,4 +202,27 @@
 print_message('Error: ', termcap.Red, message, **kwargs)
 SCons.Script.Exit(1)

-__all__ = ['Configure', 'EnvDefaults', 'Transform', 'warning', 'error']
+# The MakeAction wrapper, and a SCons tool to set up the *COMSTR variables.
+if SCons.Script.GetOption('verbose'):
+def MakeAction(action, string, *args, **kwargs):
+return SCons.Script.Action(action, *args, **kwargs)
+
+def MakeActionTool(env):
+pass
+else:
+MakeAction = SCons.Script.Action
+
+def MakeActionTool(env):
+env['CCCOMSTR']= Transform("CC")
+env['CXXCOMSTR']   = Transform("CXX")
+env['ASCOMSTR']= Transform("AS")
+env['ARCOMSTR']= Transform("AR", 0)
+env['LINKCOMSTR']  = Transform("LINK", 0)
+env['SHLINKCOMSTR']= Transform("SHLINK", 0)
+env['RANLIBCOMSTR']= Transform("RANLIB", 0)
+env['M4COMSTR']= Transform("M4")
+env['SHCCCOMSTR']  = Transform("SHCC")
+env['SHCXXCOMSTR'] = Transform("SHCXX")
+
+__all__ = ['Configure', 'EnvDefaults', 'Transform', 'warning', 'error',
+   'MakeAction', 'MakeActionTool']

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40968
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: Id1231a1a370b7d519a382db892ded93c604eb56f
Gerrit-Change-Number: 40968
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Move the "duplicate" setting into gem5_env_defaults.py.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40967 )



Change subject: scons: Move the "duplicate" setting into  
gem5_env_defaults.py.

..

scons: Move the "duplicate" setting into gem5_env_defaults.py.

This is a generic default environment setting, and so should go
alongside all the other generic default environment settings.

Change-Id: If3032a4893dd84f7c7d77e7e9420436ab445cf2b
---
M SConstruct
M site_scons/gem5_scons/defaults.py
2 files changed, 6 insertions(+), 6 deletions(-)



diff --git a/SConstruct b/SConstruct
index 3530cbc..f158ccc 100755
--- a/SConstruct
+++ b/SConstruct
@@ -204,12 +204,6 @@

 main.SConsignFile(os.path.join(build_root, "sconsign"))

-# Default duplicate option is to use hard links, but this messes up
-# when you use emacs to edit a file in the target dir, as emacs moves
-# file to file~ then copies to file, breaking the link.  Symbolic
-# (soft) links work better.
-main.SetOption('duplicate', 'soft-copy')
-
 #
 # Set up global sticky variables... these are common to an entire build
 # tree (not specific to a particular build like X86)
diff --git a/site_scons/gem5_scons/defaults.py  
b/site_scons/gem5_scons/defaults.py

index e59b40f..8309505 100644
--- a/site_scons/gem5_scons/defaults.py
+++ b/site_scons/gem5_scons/defaults.py
@@ -71,3 +71,9 @@
 # add useful python code PYTHONPATH so it can be used by subprocesses
 # as well
 env.AppendENVPath('PYTHONPATH', extra_python_paths)
+
+# Default duplicate option is to use hard links, but this messes up
+# when you use emacs to edit a file in the target dir, as emacs moves
+# file to file~ then copies to file, breaking the link.  Symbolic
+# (soft) links work better.
+env.SetOption('duplicate', 'soft-copy')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40967
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: If3032a4893dd84f7c7d77e7e9420436ab445cf2b
Gerrit-Change-Number: 40967
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons,misc: Remove the ability to disable some trivial features.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40964 )



Change subject: scons,misc: Remove the ability to disable some trivial  
features.

..

scons,misc: Remove the ability to disable some trivial features.

These are HDF5, PNG, FENV, and TUNTAP support, all of which add
capabilities to gem5 which can be ignored if not wanted. It could be
argued that FENV changes behavior because it makes setting the FP
rounding mode work or not as used by SPARC, but since the difference is
trivial and in a niche area, that (along with the other options) doesn't
seem to justify having a top level control in the build system.

Since these are no longer options which say whether to *use* a
particular feature, and are instead flags which say whether we *have* a
particular feature, change their names from USE_* to HAVE_*, to stay
consistent with other variables.

Most of the remaining USE_* flags, KVM, FASTMODEL, SYSTEMC, and
(indirectly) USE_PYTHON, toggle on and off major systems which can have
a significant effect on boot time, or, in the case of FASTMODEL, even
consume external resources which may not be available and which may
break the build.

USE_POSIX_TIMER was also left alone since it selects between two
implementations of some functions. By forcing it to be on or off
depending on the host, we would be forcing some code to be excluded in
either case. That would make that other code impossible to test without
hacking up scons or modifying the host machine.

Change-Id: I0b03f23e65478caefd50cd3516974386e3dbf0db
---
M src/base/SConscript
M src/base/SConsopts
M src/base/fenv.hh
M src/base/imgwriter.cc
M src/base/stats/SConscript
M src/base/stats/SConsopts
M src/dev/net/Ethernet.py
M src/dev/net/SConsopts
M src/dev/net/ethertap.cc
M src/dev/net/ethertap.hh
M src/python/pybind11/stats.cc
11 files changed, 28 insertions(+), 61 deletions(-)



diff --git a/src/base/SConscript b/src/base/SConscript
index d7aa2df..ce11dc7 100644
--- a/src/base/SConscript
+++ b/src/base/SConscript
@@ -42,12 +42,12 @@
 Executable('cprintftime', 'cprintftime.cc', 'cprintf.cc')
 Source('debug.cc')
 GTest('debug.test', 'debug.test.cc', 'debug.cc')
-if env['USE_FENV']:
+if env['HAVE_FENV']:
 Source('fenv.cc')
 else:
 warning("No IEEE FP rounding mode control.\n"
 "FP results may deviate slightly from other platforms.")
-if env['USE_PNG']:
+if env['HAVE_PNG']:
 env.Append(LIBS=['png'])
 Source('pngwriter.cc')
 Source('fiber.cc')
diff --git a/src/base/SConsopts b/src/base/SConsopts
index 424789d..15c1f54 100644
--- a/src/base/SConsopts
+++ b/src/base/SConsopts
@@ -32,11 +32,11 @@
 conf = gem5_scons.Configure(main)

 # Check for  (C99 FP environment control)
-have_fenv = conf.CheckHeader('fenv.h', '<>')
+main['HAVE_FENV'] = conf.CheckHeader('fenv.h', '<>')

 # Check for  (libpng library needed if wanting to dump
 # frame buffer image in png format)
-have_png = conf.CheckHeader('png.h', '<>')
+main['HAVE_PNG'] = conf.CheckHeader('png.h', '<>')

 have_posix_clock = \
 conf.CheckLibWithHeader([None, 'rt'], 'time.h', 'C',
@@ -51,26 +51,9 @@
 main = conf.Finish()


-if have_fenv:
-sticky_vars.Add(BoolVariable('USE_FENV', 'Use  IEEE mode  
control',

- True))
-else:
-warning("Header file  not found.\n"
-"This host has no IEEE FP rounding mode control.")
-main['USE_FENV'] = False
-
-
-if have_png:
-sticky_vars.Add(BoolVariable('USE_PNG',  'Enable support for PNG  
images',

- True))
-else:
-warning("Header file  not found.\n"
-"This host has no libpng library.\n"
-"Disabling support for PNG framebuffers.")
-main['USE_PNG'] = False
-
 sticky_vars.Add(BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks',
  have_posix_clock))


-export_vars.extend(['USE_FENV', 'USE_PNG', 'USE_POSIX_CLOCK', 'HAVE_VALGRIND'])
+export_vars.extend([
+'HAVE_FENV', 'HAVE_PNG', 'USE_POSIX_CLOCK', 'HAVE_VALGRIND'])
diff --git a/src/base/fenv.hh b/src/base/fenv.hh
index 8801e10..8366720 100644
--- a/src/base/fenv.hh
+++ b/src/base/fenv.hh
@@ -29,7 +29,7 @@
 #ifndef __BASE_FENV_HH__
 #define __BASE_FENV_HH__

-#include "config/use_fenv.hh"
+#include "config/have_fenv.hh"

 namespace Gem5
 {
@@ -42,7 +42,7 @@
 Upward = 3
 };

-#if USE_FENV
+#if HAVE_FENV

 void setFpRound(RoundingMode rm);
 RoundingMode getFpRound();
@@ -53,7 +53,7 @@
 static inline void setFpRound(RoundingMode rm) {}
 static inline RoundingMode getFpRound() { return RoundingMode::Downward; }

-#endif // USE_FENV
+#endif // HAVE_FENV

 } // namespace Gem5

diff --git a/src/base/imgwriter.cc b/src/base/imgwriter.cc
index abefb7f..8b5550b 100644
--- a/src/base/imgwriter.cc
+++ b/src/base/imgwriter.cc
@@ -39,9 +39,9 @@

 #include "base/bmpwriter.hh"
 #include "base/logging.hh"
-#include "config/use_png.hh"

[gem5-dev] Change in gem5/gem5[develop]: scons: Stop piggy-backing on the default tool for default settings.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40965 )



Change subject: scons: Stop piggy-backing on the default tool for default  
settings.

..

scons: Stop piggy-backing on the default tool for default settings.

Instead, create a new tool called EnvDefaults. This tool now needs
to be explicitly listed in the set of tools available through an
Environment, but that's easy to do in on place (all environments should
stem from main). Hijacking default like we were doing was (as far as I
can tell) not how that tool was intended to be used, and doing things
this way is a bit less hacky.

Also, we can split more Builders, etc, out of SConstruct, and these will
need to attach to main in the same way. We're going to need a list of
tools when main is constructed one way or the other, so we might as well
follow the rules.

Change-Id: I392e1639cb69d373c64970dccf45258000498cc3
---
M SConstruct
M site_scons/gem5_scons/__init__.py
R site_scons/gem5_scons/defaults.py
3 files changed, 5 insertions(+), 14 deletions(-)



diff --git a/SConstruct b/SConstruct
index 535e8b1..3530cbc 100755
--- a/SConstruct
+++ b/SConstruct
@@ -120,6 +120,7 @@
   help='Build systemc tests')

 from gem5_scons import Transform, error, warning, summarize_warnings
+from gem5_scons import EnvDefaults
 import gem5_scons

 
@@ -128,7 +129,7 @@
 #
 

-main = Environment(tools=['default', 'git'])
+main = Environment(tools=['default', 'git', EnvDefaults])

 from gem5_scons.util import get_termcap
 termcap = get_termcap()
diff --git a/site_scons/gem5_scons/__init__.py  
b/site_scons/gem5_scons/__init__.py

index 9d62c47..ed3b065 100644
--- a/site_scons/gem5_scons/__init__.py
+++ b/site_scons/gem5_scons/__init__.py
@@ -44,6 +44,7 @@

 from gem5_scons.util import get_termcap
 from gem5_scons.configure import Configure
+from gem5_scons.defaults import EnvDefaults
 import SCons.Script

 termcap = get_termcap()
@@ -201,4 +202,4 @@
 print_message('Error: ', termcap.Red, message, **kwargs)
 SCons.Script.Exit(1)

-__all__ = ['Configure', 'Transform', 'warning', 'error']
+__all__ = ['Configure', 'EnvDefaults', 'Transform', 'warning', 'error']
diff --git a/site_scons/site_tools/default.py  
b/site_scons/gem5_scons/defaults.py

similarity index 94%
rename from site_scons/site_tools/default.py
rename to site_scons/gem5_scons/defaults.py
index 305a2a2..e59b40f 100644
--- a/site_scons/site_tools/default.py
+++ b/site_scons/gem5_scons/defaults.py
@@ -39,14 +39,10 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 import os
-import sys
-
-import SCons.Tool
-import SCons.Tool.default

 from gem5_python_paths import extra_python_paths

-def common_config(env):
+def EnvDefaults(env):
 # export TERM so that clang reports errors in color
 use_vars = set([ 'AS', 'AR', 'CC', 'CXX', 'HOME', 'LD_LIBRARY_PATH',
  'LIBRARY_PATH', 'PATH', 'PKG_CONFIG_PATH', 'PROTOC',
@@ -75,10 +71,3 @@
 # add useful python code PYTHONPATH so it can be used by subprocesses
 # as well
 env.AppendENVPath('PYTHONPATH', extra_python_paths)
-
-def generate(env):
-common_config(env)
-SCons.Tool.default.generate(env)
-
-def exists(env):
-return 1

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40965
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: I392e1639cb69d373c64970dccf45258000498cc3
Gerrit-Change-Number: 40965
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Eliminate CXX_V and main_dict_keys in SConstruct.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40963 )



Change subject: scons: Eliminate CXX_V and main_dict_keys in SConstruct.
..

scons: Eliminate CXX_V and main_dict_keys in SConstruct.

CXX_V isn't used by anything, and main_dict_keys is unnecessary because
using "in" with the whole main environment (which acts like a dict)
checks against the keys without needing a temporary variable.

Change-Id: Iab07246c00b1969858659043cead1dd657b1707b
---
M SConstruct
1 file changed, 2 insertions(+), 5 deletions(-)



diff --git a/SConstruct b/SConstruct
index 1f6493e..535e8b1 100755
--- a/SConstruct
+++ b/SConstruct
@@ -133,10 +133,8 @@
 from gem5_scons.util import get_termcap
 termcap = get_termcap()

-main_dict_keys = main.Dictionary().keys()
-
 # Check that we have a C/C++ compiler
-if not ('CC' in main_dict_keys and 'CXX' in main_dict_keys):
+if not ('CC' in main and 'CXX' in main):
 error("No C++ compiler installed (package g++ on Ubuntu and RedHat)")

 ###
@@ -295,8 +293,7 @@
 # builds under a given build root run on the same host platform.
 conf = gem5_scons.Configure(main)

-CXX_version = readCommand([main['CXX'],'--version'], exception=False)
-CXX_V = readCommand([main['CXX'],'-V'], exception=False)
+CXX_version = readCommand([main['CXX'], '--version'], exception=False)

 main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
 main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40963
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: Iab07246c00b1969858659043cead1dd657b1707b
Gerrit-Change-Number: 40963
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Move imports below version checks in site_init.py.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40966 )



Change subject: scons: Move imports below version checks in site_init.py.
..

scons: Move imports below version checks in site_init.py.

Without knowing for sure we're using python 3, it's dangerous to start
pulling in code which may make that assumption.

Change-Id: Ic13af74a686ee0fb8f36bb672beadea4334b431c
---
M site_scons/site_init.py
1 file changed, 2 insertions(+), 1 deletion(-)



diff --git a/site_scons/site_init.py b/site_scons/site_init.py
index 2f7cbf1..3507373 100644
--- a/site_scons/site_init.py
+++ b/site_scons/site_init.py
@@ -39,7 +39,6 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 from __future__ import print_function
-from gem5_python_paths import extra_python_paths

 # Check for recent-enough Python and SCons versions.
 try:
@@ -85,4 +84,6 @@
 """)
 raise

+from gem5_python_paths import extra_python_paths
+
 sys.path[1:1] = extra_python_paths

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40966
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: Ic13af74a686ee0fb8f36bb672beadea4334b431c
Gerrit-Change-Number: 40966
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Streamline the LTO option setting code and add options for clang.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40962 )



Change subject: scons: Streamline the LTO option setting code and add  
options for clang.

..

scons: Streamline the LTO option setting code and add options for clang.

Clang also supports an -flto option, although not with a thread count.

Change-Id: Ifc783ac3ab2e0ea93fad0402b288605a20725aa0
---
M SConstruct
1 file changed, 9 insertions(+), 10 deletions(-)



diff --git a/SConstruct b/SConstruct
index 906846b..1f6493e 100755
--- a/SConstruct
+++ b/SConstruct
@@ -355,17 +355,11 @@

 main['GCC_VERSION'] = gcc_version

-# Add the appropriate Link-Time Optimization (LTO) flags
-# unless LTO is explicitly turned off.
+# If not disabled, set the Link-Time Optimization (LTO) flags.
 if not GetOption('no_lto'):
-# Pass the LTO flag when compiling to produce GIMPLE
-# output, we merely create the flags here and only append
-# them later
-main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
-
-# Use the same amount of jobs for LTO as we are running
-# scons with
-main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
+for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS':
+# Use the same amount of jobs for LTO as we are running scons  
with.

+main[var] = ['-flto=%d' % GetOption('num_jobs')]

  
main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',

   '-fno-builtin-realloc', '-fno-builtin-free'])
@@ -376,6 +370,11 @@
 error('clang version 3.9 or newer required.\n'
   'Installed version:', clang_version)

+# If not disabled, set the Link-Time Optimization (LTO) flags.
+if not GetOption('no_lto'):
+for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS':
+main[var] = ['-flto']
+
 # clang has a few additional warnings that we disable.
 conf.CheckCxxFlag('-Wno-c99-designator')
 conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40962
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: Ifc783ac3ab2e0ea93fad0402b288605a20725aa0
Gerrit-Change-Number: 40962
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Remove an extraneous Exit().

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40961 )



Change subject: scons: Remove an extraneous Exit().
..

scons: Remove an extraneous Exit().

This isn't necessary after error() which exits on its own.

Change-Id: Icad08c1badc73fa8f41013cc69d6cc5a96ff8fdb
---
M SConstruct
1 file changed, 0 insertions(+), 1 deletion(-)



diff --git a/SConstruct b/SConstruct
index b41ae6e..906846b 100755
--- a/SConstruct
+++ b/SConstruct
@@ -352,7 +352,6 @@
 if compareVersions(gcc_version, "5") < 0:
 error('gcc version 5 or newer required.\n'
   'Installed version:', gcc_version)
-Exit(1)

 main['GCC_VERSION'] = gcc_version


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40961
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: Icad08c1badc73fa8f41013cc69d6cc5a96ff8fdb
Gerrit-Change-Number: 40961
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Include libthr on freebsd no matter what compiler you're using.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40960 )



Change subject: scons: Include libthr on freebsd no matter what compiler  
you're using.

..

scons: Include libthr on freebsd no matter what compiler you're using.

The compiler won't change where the thread library is implemented.

Change-Id: Ic6fbaae2ff9c4a91ce86b06d62049b9d9a0e3132
---
M SConstruct
1 file changed, 5 insertions(+), 4 deletions(-)



diff --git a/SConstruct b/SConstruct
index 706653b..b41ae6e 100755
--- a/SConstruct
+++ b/SConstruct
@@ -308,15 +308,20 @@
 # As gcc and clang share many flags, do the common parts here
 main.Append(CCFLAGS=['-pipe'])
 main.Append(CCFLAGS=['-fno-strict-aliasing'])
+
 # Enable -Wall and -Wextra and then disable the few warnings that
 # we consistently violate
 main.Append(CCFLAGS=['-Wall', '-Wundef', '-Wextra',
  '-Wno-sign-compare', '-Wno-unused-parameter'])
+
 # We always compile using C++14
 main.Append(CXXFLAGS=['-std=c++14'])
+
 if sys.platform.startswith('freebsd'):
 main.Append(CCFLAGS=['-I/usr/local/include'])
 main.Append(CXXFLAGS=['-I/usr/local/include'])
+# On FreeBSD we need libthr.
+main.Append(LIBS=['thr'])

 conf.CheckLinkFlag('-Wl,--as-needed')
 if GetOption('gold_linker'):
@@ -384,10 +389,6 @@
 main.Append(CXXFLAGS=['-stdlib=libc++'])
 main.Append(LIBS=['c++'])

-# On FreeBSD we need libthr.
-if sys.platform.startswith('freebsd'):
-main.Append(LIBS=['thr'])
-
 # Add sanitizers flags
 sanitizers=[]
 if GetOption('with_ubsan'):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40960
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: Ic6fbaae2ff9c4a91ce86b06d62049b9d9a0e3132
Gerrit-Change-Number: 40960
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Narrow the scope of the -Wno-parentheses flag.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40958 )



Change subject: scons: Narrow the scope of the -Wno-parentheses flag.
..

scons: Narrow the scope of the -Wno-parentheses flag.

This was added to avoid warnings from code generated as part of Ruby's
AST. Instead of applying this to all of gem5, apply it only to files
generated by Ruby.

Change-Id: I2b11d2df3cb631debdc594059d9d480a0e695c59
---
M SConstruct
M src/mem/ruby/protocol/SConscript
2 files changed, 5 insertions(+), 4 deletions(-)



diff --git a/SConstruct b/SConstruct
index 00efe1b..32ebb87 100755
--- a/SConstruct
+++ b/SConstruct
@@ -378,9 +378,7 @@
 else:
 error('Unable to determine clang version.')

-# clang has a few additional warnings that we disable, extraneous
-# parantheses are allowed due to Ruby's printing of the AST.
-main.Append(CCFLAGS=['-Wno-parentheses'])
+# clang has a few additional warnings that we disable.
 conf.CheckCxxFlag('-Wno-c99-designator')
 conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

diff --git a/src/mem/ruby/protocol/SConscript  
b/src/mem/ruby/protocol/SConscript

index c037b85..dedcbb4 100644
--- a/src/mem/ruby/protocol/SConscript
+++ b/src/mem/ruby/protocol/SConscript
@@ -105,10 +105,13 @@
 nodes = env.SLICC([], sources)
 env.Depends(nodes, slicc_depends)

+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = '-Wno-parentheses'
 for f in nodes:
 s = str(f)
 if s.endswith('.cc'):
-Source(f)
+Source(f, append=append)
 elif s.endswith('.py'):
 SimObject(f)


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40958
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: I2b11d2df3cb631debdc594059d9d480a0e695c59
Gerrit-Change-Number: 40958
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: Simplify the clang version check.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40959 )



Change subject: scons: Simplify the clang version check.
..

scons: Simplify the clang version check.

Use the -dumpversion option which just prints the version with no other
text. This is what we were already doing for gcc and avoids having to
use any regular expressions.

Change-Id: I7b9fa96c7c3c10701fef51f8c0b3b075cd2fb23c
---
M SConstruct
1 file changed, 4 insertions(+), 10 deletions(-)



diff --git a/SConstruct b/SConstruct
index 32ebb87..706653b 100755
--- a/SConstruct
+++ b/SConstruct
@@ -78,7 +78,6 @@
 # Global Python includes
 import atexit
 import os
-import re
 import sys

 from os import mkdir, environ
@@ -368,15 +367,10 @@
   '-fno-builtin-realloc', '-fno-builtin-free'])

 elif main['CLANG']:
-clang_version_re = re.compile(".* version (\d+\.\d+)")
-clang_version_match = clang_version_re.search(CXX_version)
-if (clang_version_match):
-clang_version = clang_version_match.groups()[0]
-if compareVersions(clang_version, "3.9") < 0:
-error('clang version 3.9 or newer required.\n'
-  'Installed version:', clang_version)
-else:
-error('Unable to determine clang version.')
+clang_version = readCommand([main['CXX'], '-dumpversion'],  
exception=False)

+if compareVersions(clang_version, "3.9") < 0:
+error('clang version 3.9 or newer required.\n'
+  'Installed version:', clang_version)

 # clang has a few additional warnings that we disable.
 conf.CheckCxxFlag('-Wno-c99-designator')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40959
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: I7b9fa96c7c3c10701fef51f8c0b3b075cd2fb23c
Gerrit-Change-Number: 40959
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: arch-mips: Fix a bug in the MIPS yield instruction.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40957 )



Change subject: arch-mips: Fix a bug in the MIPS yield instruction.
..

arch-mips: Fix a bug in the MIPS yield instruction.

The yieldThread function implements MIPS's yield instruction, and had a
if condition in it, (src_reg && !yield_mask != 0), which upset clang. When
originally committed, this check read (src_reg & !yield_mask != 0), but
apparently as part of a cleanup sweep a long time ago, it was assumed
that the & was being used as a logical operator and was turned into &&.

Reading the actual description of what the yield instruction is supposed
to do, if src_reg is positive (it is at this point in the function),
then it's supposed to be treated as a bitvector. The YQMask register,
what gets passed in as yield_mask, can have bits set in it which mask
bits that might be set in src_reg, and if any are still set, the an
interrupt should happen, as implemented by the body of the if.

From this description, it's apparent that what the original code was
*trying* to do was to use yield_mask to mask any set bits in src_reg,
and then if any bits were left go into the body. The original author
used ! as a bitwise negating operator since what they *wanted* to do was
to block any bits in src_reg where yield_mask *is* set, and let through
any where yield_mask *is not* set. The & would do that, but only with a
bitwise negated yield_mask. Hence:

if ((src_reg & ~yield_mask) != 0) {
...
}

Change-Id: I30d0a47992750adf78c8aa0c28217da187e0cbda
---
M src/arch/mips/mt.hh
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/src/arch/mips/mt.hh b/src/arch/mips/mt.hh
index 9ab3290..da4c51a 100644
--- a/src/arch/mips/mt.hh
+++ b/src/arch/mips/mt.hh
@@ -273,7 +273,7 @@
 curTick(), tc->threadId());
 }
 } else if (src_reg > 0) {
-if (src_reg && !yield_mask != 0) {
+if ((src_reg & ~yield_mask) != 0) {
 VPEControlReg vpeControl =  
tc->readMiscReg(MISCREG_VPE_CONTROL);

 vpeControl.excpt = 2;
 tc->setMiscReg(MISCREG_VPE_CONTROL, vpeControl);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40957
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: I30d0a47992750adf78c8aa0c28217da187e0cbda
Gerrit-Change-Number: 40957
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: arch-sparc: Fix an operator precedence bug in the iob device.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40955 )



Change subject: arch-sparc: Fix an operator precedence bug in the iob  
device.

..

arch-sparc: Fix an operator precedence bug in the iob device.

Like in the nomali library, this bug is in some code making a bitmask
where what bits are enabled depends on some conditions. It used ?: to
evaluate the conditions and | to aggregate the bits, but didn't use any
()s, so the | happened first, then the ?:s. This would generate an
incorrect bitmask.

Change-Id: Iabcc8a9fd38cde5de3c0627a3b143407247c0c0e
---
M src/dev/sparc/iob.cc
1 file changed, 2 insertions(+), 2 deletions(-)



diff --git a/src/dev/sparc/iob.cc b/src/dev/sparc/iob.cc
index a0d1982..624563e 100644
--- a/src/dev/sparc/iob.cc
+++ b/src/dev/sparc/iob.cc
@@ -101,8 +101,8 @@

 if (accessAddr >= IntCtlAddr && accessAddr < IntCtlAddr +  
IntCtlSize) {

 int index = (accessAddr - IntCtlAddr) >> 3;
-uint64_t data = intCtl[index].mask  ? 1 << 2 : 0 |
-intCtl[index].pend  ? 1 << 0 : 0;
+uint64_t data = (intCtl[index].mask  ? (1 << 2) : 0) |
+(intCtl[index].pend  ? (1 << 0) : 0);
 pkt->setBE(data);
 return;
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40955
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: Iabcc8a9fd38cde5de3c0627a3b143407247c0c0e
Gerrit-Change-Number: 40955
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: scons: More narrowly target -Wno-self-assign.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40952 )



Change subject: scons: More narrowly target -Wno-self-assign.
..

scons: More narrowly target -Wno-self-assign.

This flag was necessary because of self assignments in the ISA parser
where self assignments are often hints to the parser itself, and in one
case because a pybind-ism used to attach the -= operator looked like a
self assignment.

This change narrows the scope of the flag that disables this warning to
only files generated by the ISA parser, and the single file in the
systemc code which uses that operator overload.

Change-Id: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
---
M SConstruct
M src/arch/SConscript
M src/systemc/core/SConscript
3 files changed, 9 insertions(+), 6 deletions(-)



diff --git a/SConstruct b/SConstruct
index 37c4622..e926ab0 100755
--- a/SConstruct
+++ b/SConstruct
@@ -379,11 +379,8 @@
 error('Unable to determine clang version.')

 # clang has a few additional warnings that we disable, extraneous
-# parantheses are allowed due to Ruby's printing of the AST,
-# finally self assignments are allowed as the generated CPU code
-# is relying on this
+# parantheses are allowed due to Ruby's printing of the AST.
 main.Append(CCFLAGS=['-Wno-parentheses',
- '-Wno-self-assign',
  # Some versions of libstdc++ (4.8?) seem to
  # use struct hash and class hash
  # interchangeably.
diff --git a/src/arch/SConscript b/src/arch/SConscript
index b97881d..86cb86d 100644
--- a/src/arch/SConscript
+++ b/src/arch/SConscript
@@ -191,7 +191,10 @@
 # These generated files are also top level sources.
 def source_gen(name):
 add_gen(name)
-Source(gen_file(name))
+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = ['-Wno-self-assign']
+Source(gen_file(name), append=append)

 source_gen('decoder.cc')

diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript
index 0373046..b5d0ea9 100644
--- a/src/systemc/core/SConscript
+++ b/src/systemc/core/SConscript
@@ -62,4 +62,7 @@
 if env['USE_PYTHON']:
 Source('python.cc')
 Source('sc_main_python.cc')
-Source('sc_time_python.cc')
+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = '-Wno-self-assign-overloaded'
+Source('sc_time_python.cc', append=append)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40952
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: Ib64fc72e46f894cba9064afcdbdcc5859c30e745
Gerrit-Change-Number: 40952
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: cpu,mem: Add or remove parenthesis to make the compiler happy.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40956 )



Change subject: cpu,mem: Add or remove parenthesis to make the compiler  
happy.

..

cpu,mem: Add or remove parenthesis to make the compiler happy.

Remove extraneous parenthesis in an if condition, and add some
parenthesis where an assignment was being used as a condition in a while
loop.

Change-Id: Ie12c74ac681ef042138e3b41f257ea1bb2ce4267
---
M src/cpu/o3/inst_queue_impl.hh
M src/cpu/pred/tage_base.cc
2 files changed, 3 insertions(+), 3 deletions(-)



diff --git a/src/cpu/o3/inst_queue_impl.hh b/src/cpu/o3/inst_queue_impl.hh
index 24871d9..7d81df4 100644
--- a/src/cpu/o3/inst_queue_impl.hh
+++ b/src/cpu/o3/inst_queue_impl.hh
@@ -757,12 +757,12 @@
 IssueStruct *i2e_info = issueToExecuteQueue->access(0);

 DynInstPtr mem_inst;
-while (mem_inst = std::move(getDeferredMemInstToExecute())) {
+while ((mem_inst = std::move(getDeferredMemInstToExecute( {
 addReadyMemInst(mem_inst);
 }

 // See if any cache blocked instructions are able to be executed
-while (mem_inst = std::move(getBlockedMemInstToExecute())) {
+while ((mem_inst = std::move(getBlockedMemInstToExecute( {
 addReadyMemInst(mem_inst);
 }

diff --git a/src/cpu/pred/tage_base.cc b/src/cpu/pred/tage_base.cc
index 9a436ae..2349a36 100644
--- a/src/cpu/pred/tage_base.cc
+++ b/src/cpu/pred/tage_base.cc
@@ -467,7 +467,7 @@
 //Allocate entries
 unsigned numAllocated = 0;
 for (int i = X; i <= nHistoryTables; i++) {
-if ((gtable[i][bi->tableIndices[i]].u == 0)) {
+if (gtable[i][bi->tableIndices[i]].u == 0) {
 gtable[i][bi->tableIndices[i]].tag = bi->tableTags[i];
 gtable[i][bi->tableIndices[i]].ctr = (taken) ? 0 : -1;
 ++numAllocated;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40956
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: Ie12c74ac681ef042138e3b41f257ea1bb2ce4267
Gerrit-Change-Number: 40956
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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]: misc: Fix mismatched struct/class "tags" and reenable that warning.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40953 )



Change subject: misc: Fix mismatched struct/class "tags" and reenable that  
warning.

..

misc: Fix mismatched struct/class "tags" and reenable that warning.

The mismatches were from places where Params structs had been declared
as classes instead of structs, and ruby's MachineID struct.

A comment describing why the warning had been disabled said that it was
because of libstdc++ version 4.8. As far as I can tell, that version is
old enough to be outside the window we support, and so that should no
longer be a problem. It looks like the oldest version of gcc we
support, 5.0, corresponds with approximately libstdc++ version 6.0.21.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning

Change-Id: I75ad92f3723a1883bd47e3919c5572a353344047
---
M SConstruct
M src/arch/arm/pmu.hh
M src/dev/arm/css/mhu.hh
M src/dev/arm/display.hh
M src/dev/arm/fvp_base_pwr_ctrl.hh
M src/dev/arm/generic_timer.hh
M src/dev/arm/gpu_nomali.hh
M src/dev/arm/watchdog_generic.hh
M src/dev/arm/watchdog_sp805.hh
M src/gpu-compute/scheduler.hh
M src/mem/qos/mem_sink.hh
M src/mem/ruby/system/GPUCoalescer.hh
M src/mem/ruby/system/VIPERCoalescer.hh
M src/sim/mem_state.hh
M src/sim/probe/probe.hh
M src/sim/ticked_object.hh
16 files changed, 24 insertions(+), 29 deletions(-)



diff --git a/SConstruct b/SConstruct
index e926ab0..00efe1b 100755
--- a/SConstruct
+++ b/SConstruct
@@ -380,12 +380,7 @@

 # clang has a few additional warnings that we disable, extraneous
 # parantheses are allowed due to Ruby's printing of the AST.
-main.Append(CCFLAGS=['-Wno-parentheses',
- # Some versions of libstdc++ (4.8?) seem to
- # use struct hash and class hash
- # interchangeably.
- '-Wno-mismatched-tags',
- ])
+main.Append(CCFLAGS=['-Wno-parentheses'])
 conf.CheckCxxFlag('-Wno-c99-designator')
 conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

diff --git a/src/arch/arm/pmu.hh b/src/arch/arm/pmu.hh
index 3cdcf1c..e8c63bf 100644
--- a/src/arch/arm/pmu.hh
+++ b/src/arch/arm/pmu.hh
@@ -52,7 +52,7 @@
 #include "sim/sim_object.hh"
 #include "sim/system.hh"

-class ArmPMUParams;
+struct ArmPMUParams;
 class Platform;
 class ThreadContext;
 class ArmInterruptPin;
diff --git a/src/dev/arm/css/mhu.hh b/src/dev/arm/css/mhu.hh
index 17704e8..4e13605 100644
--- a/src/dev/arm/css/mhu.hh
+++ b/src/dev/arm/css/mhu.hh
@@ -41,12 +41,12 @@
 #include "dev/arm/doorbell.hh"
 #include "dev/io_device.hh"

-class Ap2ScpDoorbellParams;
+struct Ap2ScpDoorbellParams;
 class ArmInterruptPin;
 class MHU;
-class MHUParams;
+struct MHUParams;
 class Scp;
-class Scp2ApDoorbellParams;
+struct Scp2ApDoorbellParams;

 class MhuDoorbell : public Doorbell
 {
diff --git a/src/dev/arm/display.hh b/src/dev/arm/display.hh
index 1359487..91819ff 100644
--- a/src/dev/arm/display.hh
+++ b/src/dev/arm/display.hh
@@ -40,7 +40,7 @@

 #include "sim/sim_object.hh"

-class DisplayParams;
+struct DisplayParams;

 class Display : public SimObject
 {
diff --git a/src/dev/arm/fvp_base_pwr_ctrl.hh  
b/src/dev/arm/fvp_base_pwr_ctrl.hh

index 4b1bc4c..948ad30 100644
--- a/src/dev/arm/fvp_base_pwr_ctrl.hh
+++ b/src/dev/arm/fvp_base_pwr_ctrl.hh
@@ -44,7 +44,7 @@
 #include "dev/io_device.hh"

 class ArmSystem;
-class FVPBasePwrCtrlParams;
+struct FVPBasePwrCtrlParams;
 class ThreadContext;

 /**
diff --git a/src/dev/arm/generic_timer.hh b/src/dev/arm/generic_timer.hh
index 9a6663c..66048cc 100644
--- a/src/dev/arm/generic_timer.hh
+++ b/src/dev/arm/generic_timer.hh
@@ -64,10 +64,10 @@
 /// I2 - System Level Implementation of the Generic Timer

 class Checkpoint;
-class SystemCounterParams;
-class GenericTimerParams;
-class GenericTimerFrameParams;
-class GenericTimerMemParams;
+struct SystemCounterParams;
+struct GenericTimerParams;
+struct GenericTimerFrameParams;
+struct GenericTimerMemParams;

 /// Abstract class for elements whose events depend on the counting speed
 /// of the System Counter
diff --git a/src/dev/arm/gpu_nomali.hh b/src/dev/arm/gpu_nomali.hh
index a096edb..e30f3ed 100644
--- a/src/dev/arm/gpu_nomali.hh
+++ b/src/dev/arm/gpu_nomali.hh
@@ -43,8 +43,8 @@
 #include "dev/io_device.hh"
 #include "libnomali/nomali.h"

-class NoMaliGpuParams;
-class CustomNoMaliGpuParams;
+struct NoMaliGpuParams;
+struct CustomNoMaliGpuParams;
 class RealView;

 class NoMaliGpu : public PioDevice
diff --git a/src/dev/arm/watchdog_generic.hh  
b/src/dev/arm/watchdog_generic.hh

index 24d3999..177df93 100644
--- a/src/dev/arm/watchdog_generic.hh
+++ b/src/dev/arm/watchdog_generic.hh
@@ -42,7 +42,7 @@
 #include "dev/io_device.hh"

 class ArmInterruptPin;
-class GenericWatchdogParams;
+struct GenericWatchdogParams;

 /**
  * @file
diff --git a/src/dev/arm/watchdog_sp805.hh 

[gem5-dev] Change in gem5/gem5[develop]: ext: Fix an operator precedence bug in the nomali library.

2021-02-08 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/40954 )



Change subject: ext: Fix an operator precedence bug in the nomali library.
..

ext: Fix an operator precedence bug in the nomali library.

An expression in that library intended to create a bitmask by checking
if a bit should be set, and then using ?: to select between a bitmask
with that bit, or 0. Unfortunately | is higher precedence than ?:, and
so 0 would be |-ed with the condition of the next ?: instead. This CL
fixes the bug by adding some parenthesis.

Change-Id: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
---
M ext/nomali/lib/jobcontrol.cc
1 file changed, 2 insertions(+), 2 deletions(-)



diff --git a/ext/nomali/lib/jobcontrol.cc b/ext/nomali/lib/jobcontrol.cc
index 558cf3a..c62cd3d 100644
--- a/ext/nomali/lib/jobcontrol.cc
+++ b/ext/nomali/lib/jobcontrol.cc
@@ -132,8 +132,8 @@
 for (int i = 0; i < 16; ++i) {
 const JobSlot (slots[i]);
 if (jobs & (1 << i)) {
-js_state |= slot.active() ? (1 << i) : 0 |
-slot.activeNext() ? (0x1 << i) : 0;
+js_state |= (slot.active() ? (1 << i) : 0) |
+(slot.activeNext() ? (0x1 << i) : 0);
 }
 }
 regs[RegAddr(JOB_IRQ_JS_STATE)] = js_state;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40954
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: Ib7e06f261e07a6ad00b9a96939d07b64c3a50409
Gerrit-Change-Number: 40954
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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] Jenkins build is back to normal : Nightly #213

2021-02-08 Thread jenkins-no-reply--- via gem5-dev
See 
___
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: version of pybind11 without everything in the headers

2021-02-08 Thread Ciro Santilli via gem5-dev
Gabe,

Following a long chain of links from those patches should eventually lead to: 
https://github.com/pybind/pybind11/pull/2445 passing through 
https://gem5.atlassian.net/browse/GEM5-572

The current status is: upstream has said they will merge my split patch at some 
point. But since it conflicts with everything, they are waiting for a good 
moment to do that when their major patches get all merged. Then when tell me to 
rebase, I'll rebase and they will merge immediately, and then I'll send a patch 
into gem5 updating pybind11 and updating the build system to take advantage of 
it.

I've been pinging them on major Western holidays :-)


From: Giacomo Travaglini 
Sent: Thursday, February 4, 2021 12:01 PM
To: gem5 Developer List ; Ciro Santilli 

Cc: Gabe Black 
Subject: RE: [gem5-dev] version of pybind11 without everything in the headers

Hi Gabe,

I believe you are referring to the following ticket:

https://gem5.atlassian.net/browse/GEM5-277

Ciro is currently on vacation and he will be back next week so he will be able 
to update
you on his progresses. IIRC pybind folks are reviewing his contribution but I 
cannot provide
you a timeline (Ciro might)

Kind Regards

Giacomo

> -Original Message-
> From: Gabe Black via gem5-dev 
> Sent: 04 February 2021 09:45
> To: gem5 Developer List ; Ciro Santilli
> 
> Cc: Gabe Black 
> Subject: [gem5-dev] version of pybind11 without everything in the headers
>
> Hey folks and particularly Ciro, I know a while ago there was an attempt to 
> put
> the common contents of pybind11 into a lib. Did that go anywhere? That
> would reduce build time which would be valuable, but from this change it's
> apparent that all those common symbols are *really* blowing up the build
> directory.
>
> https://gem5-review.googlesource.com/c/public/gem5/+/40621/1
>
>
> Gabe
___
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