[gem5-dev] Build failed in Jenkins: Nightly #162

2020-12-17 Thread jenkins-no-reply--- via gem5-dev
See 

Changes:

[gabe.black] dev: Use BitUnions and a RegisterBank in the Uart8250.


--
[...truncated 12.31 KB...]
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... 
(cached) no
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library rt... 
(cached) yes
Checking for C library tcmalloc... (cached) yes
Checking for char temp; backtrace_symbols_fd((void*), 0, 0) in C library 
None... (cached) yes
Checking for C header file fenv.h... (cached) yes
Checking for C header file png.h... (cached) yes
Checking for C header file linux/kvm.h... (cached) yes
Checking for C header file linux/if_tun.h... (cached) yes
Checking size of struct kvm_xsave ... (cached) yes
Checking for member exclude_host in struct perf_event_attr...(cached) yes
Checking for hdf5-serial using pkg-config... yes
Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) yes
Checking for H5::H5File("", 0) in C++ library hdf5_cpp... (cached) yes
Checking whether __i386__ is declared... (cached) no
Checking whether __x86_64__ is declared... (cached) yes
Building in 
Using saved variables file 

scons: done reading SConscript files.
scons: Building targets ...
 [ CXX] POWER/mem/ruby/protocol/DMA_Controller.cc -> .o
 [ CXX] POWER/mem/ruby/protocol/DMA_Wakeup.cc -> .o
 [ CXX] POWER/mem/ruby/protocol/Directory_Controller.cc -> .o
 [ CXX] POWER/mem/ruby/protocol/Directory_Wakeup.cc -> .o
 [ CXX] POWER/mem/ruby/protocol/L1Cache_Controller.cc -> .o
 [ CXX] POWER/mem/ruby/protocol/L1Cache_Wakeup.cc -> .o
 [VER TAGS]  -> POWER/sim/tags.cc
 [ CXX] POWER/python/_m5/param_Uart8250.cc -> .o
 [ CXX] POWER/dev/serial/uart8250.cc -> .o
 [LINK]  -> POWER/mem/ruby/protocol/lib.o.partial
 [ CXX] POWER/sim/tags.cc -> .o
 [LINK]  -> POWER/sim/lib.o.partial
 [LINK]  -> POWER/sim/power/lib.o.partial
 [LINK]  -> POWER/dev/serial/lib.o.partial
 [ CXX] POWER/base/date.cc -> .o
 [LINK]  -> POWER/gem5.opt
scons: done building targets.
*** Summary of Warnings ***
Warning: Your compiler doesn't support incremental linking and lto at the same
 time, so lto is being disabled. To force lto on anyway, use the
 --force-lto option. That will disable partial linking.
[Nightly] $ /bin/sh -xe /tmp/jenkins7055740102451494397.sh
+ pwd
+ pwd
+ pwd
+ docker run -u : --volume 
:
 -w  --rm 
gcr.io/gem5-test/ubuntu-20.04_all-dependencies bash -c scons 
build/RISCV/gem5.opt -j4 || (rm -rf build && scons build/RISCV/gem5.opt -j4)
scons: Reading SConscript files ...
Warning: Your compiler doesn't support incremental linking and lto at the same
 time, so lto is being disabled. To force lto on anyway, use the
 --force-lto option. That will disable partial linking.
Info: Using Python config: python3-config
Checking for C header file Python.h... (cached) yes
Checking for C library python3.8... (cached) yes
Checking for C library crypt... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library dl... (cached) yes
Checking for C library util... (cached) yes
Checking for C library m... (cached) yes
Checking Python version... (cached) 3.8.2
Checking for accept(0,0,0) in C++ library None... (cached) yes
Checking for zlibVersion() in C++ library z... (cached) yes
Checking for GOOGLE_PROTOBUF_VERIFY_VERSION in C++ library protobuf... (cached) 
yes
Checking for C header file valgrind/valgrind.h... (cached) no
Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) yes
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... 
(cached) no
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library rt... 
(cached) yes
Checking for C library tcmalloc... (cached) yes
Checking for char temp; backtrace_symbols_fd((void*), 0, 0) in C library 
None... (cached) yes
Checking for C header file fenv.h... (cached) yes
Checking for C header file png.h... (cached) yes
Checking for C header file linux/kvm.h... (cached) yes
Checking for C header file linux/if_tun.h... (cached) yes
Checking size of struct kvm_xsave ... (cached) yes
Checking for member exclude_host in struct perf_event_attr...(cached) yes
Checking for hdf5-serial using pkg-config... yes
Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) yes
Checking for H5::H5File("", 0) in C++ library hdf5_cpp... (cached) yes
Checking whether __i386__ is declared... (cached) no
Checking whether __x86_64__ is declared... (cached) yes
Building in 
Using saved variables file 

scons: done reading 

[gem5-dev] Change in gem5/gem5[develop]: dev: Use BitUnions and a RegisterBank in the Uart8250.

2020-12-17 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/36818 )


Change subject: dev: Use BitUnions and a RegisterBank in the Uart8250.
..

dev: Use BitUnions and a RegisterBank in the Uart8250.

Change-Id: I139db4f08f9e6addfed4906ea6c49ee67439d30e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36818
Reviewed-by: Giacomo Travaglini 
Maintainer: Giacomo Travaglini 
Tested-by: kokoro 
---
M src/dev/serial/uart8250.cc
M src/dev/serial/uart8250.hh
2 files changed, 291 insertions(+), 184 deletions(-)

Approvals:
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/dev/serial/uart8250.cc b/src/dev/serial/uart8250.cc
index 9f93024..a6e9bd1 100644
--- a/src/dev/serial/uart8250.cc
+++ b/src/dev/serial/uart8250.cc
@@ -47,14 +47,14 @@
 void
 Uart8250::processIntrEvent(int intrBit)
 {
-if (intrBit & IER) {
+if (intrBit & registers.ier.get()) {
DPRINTF(Uart, "UART InterEvent, interrupting\n");
platform->postConsoleInt();
status |= intrBit;
lastTxInt = curTick();
-}
-else
+} else {
DPRINTF(Uart, "UART InterEvent, not interrupting\n");
+}

 }

@@ -84,89 +84,141 @@


 Uart8250::Uart8250(const Params )
-: Uart(p, 8), IER(0), LCR(0), MCR(0), lastTxInt(0),
+: Uart(p, 8), registers(this, name() + ".registers"), lastTxInt(0),
   txIntrEvent([this]{ processIntrEvent(TX_INT); }, "TX"),
   rxIntrEvent([this]{ processIntrEvent(RX_INT); }, "RX")
 {
 }

+Uart8250::Registers::Registers(Uart8250 *uart, const std::string  
_name) :

+RegisterBankLE(new_name, 0), rbrThr(rbr, thr), rbrThrDll(rbrThr, dll),
+ierDlh(ier, dlh), iirFcr(iir, fcr)
+{
+rbr.reader(uart, ::readRbr);
+thr.writer(uart, ::writeThr);
+ier.writer(uart, ::writeIer);
+iir.reader(uart, ::readIir);
+
+lcr.writer([this](auto , const auto ) {
+reg.update(value);
+rbrThrDll.select(value.dlab);
+ierDlh.select(value.dlab);
+});
+
+mcr.writer([](auto , const auto ) {
+if (value == (UART_MCR_LOOP | 0x0A))
+reg.update(0x9A);
+});
+
+lsr.readonly().
+reader([device = uart->device](auto ) {
+Lsr lsr = 0;
+if (device->dataAvailable())
+lsr.rdr = 1;
+lsr.tbe = 1;
+lsr.txEmpty = 1;
+return lsr;
+});
+
+msr.readonly();
+
+addRegisters({rbrThrDll, ierDlh, iirFcr, lcr, mcr, lsr, msr, sr});
+}
+
+uint8_t
+Uart8250::readRbr(Register8 )
+{
+uint8_t data = 0;
+if (device->dataAvailable())
+data = device->readData();
+else
+DPRINTF(Uart, "empty read of RX register\n");
+
+status &= ~RX_INT;
+platform->clearConsoleInt();
+
+if (device->dataAvailable() && registers.ier.get().rdi)
+scheduleIntr();
+
+return data;
+}
+
+void
+Uart8250::writeThr(Register8 , const uint8_t )
+{
+device->writeData(data);
+platform->clearConsoleInt();
+status &= ~TX_INT;
+if (registers.ier.get().thri)
+scheduleIntr();
+}
+
+Uart8250::Iir
+Uart8250::readIir(Register )
+{
+DPRINTF(Uart, "IIR Read, status = %#x\n", (uint32_t)status);
+
+Iir iir = 0;
+if (status & RX_INT) {
+// Rx data interrupt has a higher priority.
+iir.id = (uint8_t)InterruptIds::Rx;
+} else if (status & TX_INT) {
+iir.id = (uint8_t)InterruptIds::Tx;
+// Tx interrupts are cleared on IIR reads.
+status &= ~TX_INT;
+} else {
+iir.pending = 1;
+}
+return iir;
+}
+
+void
+Uart8250::writeIer(Register , const Ier )
+{
+reg.update(ier);
+
+if (ier.thri) {
+DPRINTF(Uart, "IER: IER_THRI set, scheduling TX intrrupt\n");
+if (curTick() - lastTxInt > 225 * SimClock::Int::ns) {
+DPRINTF(Uart, "-- Interrupting Immediately... %d,%d\n",
+curTick(), lastTxInt);
+txIntrEvent.process();
+} else {
+DPRINTF(Uart, "-- Delaying interrupt... %d,%d\n",
+curTick(), lastTxInt);
+scheduleIntr();
+}
+} else {
+DPRINTF(Uart, "IER: IER_THRI cleared, descheduling TX intrrupt\n");
+if (txIntrEvent.scheduled())
+deschedule(txIntrEvent);
+if (status & TX_INT)
+platform->clearConsoleInt();
+status &= ~TX_INT;
+}
+
+if (ier.rdi && device->dataAvailable()) {
+DPRINTF(Uart, "IER: IER_RDI set, scheduling RX intrrupt\n");
+scheduleIntr();
+} else {
+DPRINTF(Uart, "IER: IER_RDI cleared, descheduling RX intrrupt\n");
+if (rxIntrEvent.scheduled())
+deschedule(rxIntrEvent);
+if (status & RX_INT)
+platform->clearConsoleInt();
+status &= ~RX_INT;
+}
+}
+
 Tick
 Uart8250::read(PacketPtr pkt)
 {

[gem5-dev] Change in gem5/gem5[develop]: scons: move version detection to real Scons entrypoint

2020-12-17 Thread Yu-hsin Wang (Gerrit) via gem5-dev
Yu-hsin Wang has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/38575 )



Change subject: scons: move version detection to real Scons entrypoint
..

scons: move version detection to real Scons entrypoint

scons 4.0.0 changes the behvior about creating default environment. When
calling EnsureSConsVersion and EnsurePythonVersion, scons creates
default environment and use it as these two functions' execution scope.
However, in scons 4.0.0, it would *really* create the *default*
environment specifying under site_scons/site_tools. Furthermore, the
default environment also creates the git environment. However, the git
environment depends on m5 utility which path should be set after the
version checks in site_tools.py. It becomes a chicken egg problem.

To solve this, I move the version checks into Sconstruct which is the
entrypoint of the build system.

Change-Id: I09e3014c30a944e812342435bf947637b4403e47
---
M SConstruct
M site_scons/site_init.py
2 files changed, 44 insertions(+), 44 deletions(-)



diff --git a/SConstruct b/SConstruct
index 5033344..a2c0e07 100755
--- a/SConstruct
+++ b/SConstruct
@@ -141,6 +141,50 @@

 main = Environment()

+# Check for recent-enough Python and SCons versions.
+try:
+EnsureSConsVersion(3, 0, 0)
+except SystemExit as e:
+print("""
+For more details, see:
+http://gem5.org/documentation/general_docs/building
+""")
+raise
+
+
+# Check for the python version. Python 2 is no longer supported.
+try:
+EnsurePythonVersion(3, 0)
+except SystemExit as e:
+print("""\033[93m
+Python 3 is now required.
+
+The following are steps to compile gem5 in Python 3 environment,
+
+*Step 1*: ensure Python 3 is installed. On Ubuntu like systems, you can  
try \

+this command:
+
+sudo apt-get install python3 python3-six python-is-python3  
python3-pydot

+
+To run Python 3 from a container, you can try the Docker files in \
+util/dockerfiles folder.
+
+*Step 2*: ensure that scons is run in the Python 3 environment. If scons \
+isn't run automatically with Python 3, you can force it by replacing  
`scons` \

+by the following phrase,
+
+/usr/bin/env python3 $(which scons)
+
+For example, the following command will let scons compile gem5/X86 in the \
+Python 3 environment,
+
+   /usr/bin/env python3 $(which scons) build/X86/gem5.opt
+
+(Optional) For convenience reasons, you can set up an alias for the  
Python3 \

+scons phrase in your environment. \033[0m
+""")
+raise
+
 from gem5_scons.util import get_termcap
 termcap = get_termcap()

diff --git a/site_scons/site_init.py b/site_scons/site_init.py
index 2f7cbf1..ee19b56 100644
--- a/site_scons/site_init.py
+++ b/site_scons/site_init.py
@@ -41,48 +41,4 @@
 from __future__ import print_function
 from gem5_python_paths import extra_python_paths

-# Check for recent-enough Python and SCons versions.
-try:
-EnsureSConsVersion(3, 0, 0)
-except SystemExit as e:
-print("""
-For more details, see:
-http://gem5.org/documentation/general_docs/building
-""")
-raise
-
-
-# Check for the python version. Python 2 is no longer supported.
-try:
-EnsurePythonVersion(3, 0)
-except SystemExit as e:
-print("""\033[93m
-Python 3 is now required.
-
-The following are steps to compile gem5 in Python 3 environment,
-
-*Step 1*: ensure Python 3 is installed. On Ubuntu like systems, you can  
try \

-this command:
-
-sudo apt-get install python3 python3-six python-is-python3  
python3-pydot

-
-To run Python 3 from a container, you can try the Docker files in \
-util/dockerfiles folder.
-
-*Step 2*: ensure that scons is run in the Python 3 environment. If scons \
-isn't run automatically with Python 3, you can force it by replacing  
`scons` \

-by the following phrase,
-
-/usr/bin/env python3 $(which scons)
-
-For example, the following command will let scons compile gem5/X86 in the \
-Python 3 environment,
-
-   /usr/bin/env python3 $(which scons) build/X86/gem5.opt
-
-(Optional) For convenience reasons, you can set up an alias for the  
Python3 \

-scons phrase in your environment. \033[0m
-""")
-raise
-
 sys.path[1:1] = extra_python_paths

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38575
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: I09e3014c30a944e812342435bf947637b4403e47
Gerrit-Change-Number: 38575
Gerrit-PatchSet: 1
Gerrit-Owner: Yu-hsin Wang 
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