[gem5-dev] [S] Change in gem5/gem5[develop]: arch-riscv: Refactor template JumpConstructor

2022-12-18 Thread Roger Chang (Gerrit) via gem5-dev
Roger Chang has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/66811?usp=email )



Change subject: arch-riscv: Refactor template JumpConstructor
..

arch-riscv: Refactor template JumpConstructor

Change-Id: I1b39a6c1dc52c8035f16cc64a1b4c494b14879c0
---
M src/arch/riscv/isa/formats/standard.isa
1 file changed, 17 insertions(+), 3 deletions(-)



diff --git a/src/arch/riscv/isa/formats/standard.isa  
b/src/arch/riscv/isa/formats/standard.isa

index 6be281f..bb500f5 100644
--- a/src/arch/riscv/isa/formats/standard.isa
+++ b/src/arch/riscv/isa/formats/standard.isa
@@ -250,9 +250,14 @@
 %(constructor)s;
 %(imm_code)s;
 if (QUADRANT != 0x3) {
-// Handle "c_jr" instruction, set "IsReturn" flag if RC1 is 1  
or 5

-if (CFUNCT1 == 0 && (RC1 == 1 || RC1 == 5))
-flags[IsReturn] = true;
+if (COPCODE == 4) {
+// Handle "c_jr" instruction, set "IsReturn" flag if RC1  
is 1 or 5

+if (CFUNCT1 == 0 && (RC1 == 1 || RC1 == 5))
+flags[IsReturn] = true;
+// Handle "c_jalr" instruction, set IsReturn if RC1 != ra
+if (CFUNCT1 == 1 && RC1 == 5)
+flags[IsReturn] = true;
+}
 } else {
 bool rd_link = (RD == 1 || RD == 5);
 bool rs1_link = (RS1 == 1 || RS1 == 5);

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/66811?usp=email
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: I1b39a6c1dc52c8035f16cc64a1b4c494b14879c0
Gerrit-Change-Number: 66811
Gerrit-PatchSet: 1
Gerrit-Owner: Roger Chang 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[develop]: base: Fix signature of SatCounter::saturate()

2022-12-18 Thread Daniel Carvalho (Gerrit) via gem5-dev
Daniel Carvalho has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/66791?usp=email )


Change subject: base: Fix signature of SatCounter::saturate()
..

base: Fix signature of SatCounter::saturate()

The variants that use more than 8 bits were broken,
since the size of the difference in those cases
could be larger than 8 bits, and the return value
was only 8-bits long.

Change-Id: I8b75be48f924cc33ebf5e5aeff6d4045fac66bcc
Signed-off-by: Daniel R. Carvalho 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66791
Maintainer: Matt Sinclair 
Reviewed-by: Matt Sinclair 
Tested-by: kokoro 
---
M src/base/sat_counter.hh
M src/base/sat_counter.test.cc
2 files changed, 35 insertions(+), 2 deletions(-)

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




diff --git a/src/base/sat_counter.hh b/src/base/sat_counter.hh
index a607c4c..ecb8df8 100644
--- a/src/base/sat_counter.hh
+++ b/src/base/sat_counter.hh
@@ -318,9 +318,9 @@
  *
  * @ingroup api_sat_counter
  */
-uint8_t saturate()
+T saturate()
 {
-const uint8_t diff = maxVal - counter;
+const T diff = maxVal - counter;
 counter = maxVal;
 return diff;
 }
diff --git a/src/base/sat_counter.test.cc b/src/base/sat_counter.test.cc
index 07a01c7..0a6459c 100644
--- a/src/base/sat_counter.test.cc
+++ b/src/base/sat_counter.test.cc
@@ -149,6 +149,20 @@
 ASSERT_TRUE(counter.isSaturated());
 }

+TEST(SatCounterTest, Saturate16)
+{
+const unsigned bits = 14;
+const unsigned max_value = (1 << bits) - 1;
+SatCounter16 counter(bits);
+counter++;
+ASSERT_FALSE(counter.isSaturated());
+
+// Make sure the value added is what was missing to saturate
+const unsigned diff = counter.saturate();
+ASSERT_EQ(diff, max_value - 1);
+ASSERT_TRUE(counter.isSaturated());
+}
+
 /**
  * Test back and forth against an int.
  */

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/66791?usp=email
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: I8b75be48f924cc33ebf5e5aeff6d4045fac66bcc
Gerrit-Change-Number: 66791
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Carvalho 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Daniel Carvalho 
Gerrit-Reviewer: Matt Sinclair 
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


[gem5-dev] Build failed in Jenkins: compiler-checks #458

2022-12-18 Thread jenkins-no-reply--- via gem5-dev
See 


Changes:

[Bobby R. Bruce] tests: Remove get_runtime_isa() from parsec_disk_run.py

[Jason Lowe-Power] tests: Fix compiler-tests.sh build args passing


--
[...truncated 1.03 KB...]
 > git checkout -f 06f18242fedb67280c425e9e7b533326445580b1 # timeout=10
Commit message: "tests: Fix compiler-tests.sh build args passing"
 > git rev-list --no-walk af2cecf59e9cffbbc96bb88b9137da8ef6c74410 # timeout=10
[Checks API] No suitable checks publisher found.
[compiler-checks] $ /bin/sh -xe /tmp/jenkins5832545877063719020.sh
+ ./tests/compiler-tests.sh -j 16
Starting build tests with 'gcc-version-12'...
'gcc-version-12' was found in the comprehensive tests. All ISAs will be built.
  * Building target 'GCN3_X86.opt' with 'gcc-version-12'...
Done.
  * Building target 'GCN3_X86.fast' with 'gcc-version-12'...
Done.
  * Building target 'ALL.opt' with 'gcc-version-12'...
Done.
  * Building target 'ALL.fast' with 'gcc-version-12'...
Done.
  * Building target 'MIPS.opt' with 'gcc-version-12'...
Done.
  * Building target 'MIPS.fast' with 'gcc-version-12'...
Done.
  * Building target 'POWER.opt' with 'gcc-version-12'...
Done.
  * Building target 'POWER.fast' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MESI_Three_Level_HTM.opt' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MESI_Three_Level_HTM.fast' with 'gcc-version-12'...
Done.
  * Building target 'RISCV.opt' with 'gcc-version-12'...
Done.
  * Building target 'RISCV.fast' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_CMP_token.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_CMP_token.fast' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_CMP_directory.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_CMP_directory.fast' with 'gcc-version-12'...
Done.
  * Building target 'NULL.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL.fast' with 'gcc-version-12'...
Done.
  * Building target 'ARM.opt' with 'gcc-version-12'...
Done.
  * Building target 'ARM.fast' with 'gcc-version-12'...
Done.
  * Building target 'SPARC.opt' with 'gcc-version-12'...
Done.
  * Building target 'SPARC.fast' with 'gcc-version-12'...
Done.
  * Building target 'X86.opt' with 'gcc-version-12'...
Done.
  * Building target 'X86.fast' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MESI_Three_Level.opt' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MESI_Three_Level.fast' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_hammer.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_hammer.fast' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MOESI_hammer.opt' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MOESI_hammer.fast' with 'gcc-version-12'...
Done.
  * Building target 'Garnet_standalone.opt' with 'gcc-version-12'...
Done.
  * Building target 'Garnet_standalone.fast' with 'gcc-version-12'...
Done.
  * Building target 'X86_MOESI_AMD_Base.opt' with 'gcc-version-12'...
Done.
  * Building target 'X86_MOESI_AMD_Base.fast' with 'gcc-version-12'...
Done.
  * Building target 'X86_MI_example.opt' with 'gcc-version-12'...
Done.
  * Building target 'X86_MI_example.fast' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MESI_Two_Level.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MESI_Two_Level.fast' with 'gcc-version-12'...
Done.
Starting build tests with 'gcc-version-11'...
  * Building target 'MIPS.opt' with 'gcc-version-11'...
Done.
  * Building target 'MIPS.fast' with 'gcc-version-11'...
Done.
Starting build tests with 'gcc-version-10'...
  * Building target 'X86.opt' with 'gcc-version-10'...
Done.
  * Building target 'X86.fast' with 'gcc-version-10'...
Done.
Starting build tests with 'gcc-version-9'...
  * Building target 'ARM_MESI_Three_Level.opt' with 'gcc-version-9'...
Done.
  * Building target 'ARM_MESI_Three_Level.fast' with 'gcc-version-9'...
Done.
Starting build tests with 'gcc-version-8'...
  * Building target 'ARM_MESI_Three_Level.opt' with 'gcc-version-8'...
Done.
  * Building target 'ARM_MESI_Three_Level.fast' with 'gcc-version-8'...
Done.
Starting build tests with 'gcc-version-7'...
  * Building target 'RISCV.opt' with 'gcc-version-7'...
  ! Failed with exit code 2.
  * Building target 'RISCV.fast' with 'gcc-version-7'...
  ! Failed with exit code 2.
Starting build tests with 'clang-version-14'...
'clang-version-14' was found in the comprehensive tests. All ISAs will be built.
  * Building target 'X86_MOESI_AMD_Base.opt' with 'clang-version-14'...
Done.
  * Building target 'X86_MOESI_AMD_Base.fast' with 'clang-version-14'...
Done.
  * Building target 'NULL_MOESI_hammer.opt' with 'clang-version-14'...
Done.

[gem5-dev] [S] Change in gem5/gem5[develop]: base: Fix signature of SatCounter::saturate()

2022-12-18 Thread Daniel Carvalho (Gerrit) via gem5-dev
Daniel Carvalho has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/66791?usp=email )



Change subject: base: Fix signature of SatCounter::saturate()
..

base: Fix signature of SatCounter::saturate()

The variants that use more than 8 bits were broken,
since the size of the difference in those cases
could be larger than 8 bits, and the return value
was only 8-bits long.

Change-Id: I8b75be48f924cc33ebf5e5aeff6d4045fac66bcc
Signed-off-by: Daniel R. Carvalho 
---
M src/base/sat_counter.hh
M src/base/sat_counter.test.cc
2 files changed, 31 insertions(+), 2 deletions(-)



diff --git a/src/base/sat_counter.hh b/src/base/sat_counter.hh
index a607c4c..ecb8df8 100644
--- a/src/base/sat_counter.hh
+++ b/src/base/sat_counter.hh
@@ -318,9 +318,9 @@
  *
  * @ingroup api_sat_counter
  */
-uint8_t saturate()
+T saturate()
 {
-const uint8_t diff = maxVal - counter;
+const T diff = maxVal - counter;
 counter = maxVal;
 return diff;
 }
diff --git a/src/base/sat_counter.test.cc b/src/base/sat_counter.test.cc
index 07a01c7..0a6459c 100644
--- a/src/base/sat_counter.test.cc
+++ b/src/base/sat_counter.test.cc
@@ -149,6 +149,20 @@
 ASSERT_TRUE(counter.isSaturated());
 }

+TEST(SatCounterTest, Saturate16)
+{
+const unsigned bits = 14;
+const unsigned max_value = (1 << bits) - 1;
+SatCounter16 counter(bits);
+counter++;
+ASSERT_FALSE(counter.isSaturated());
+
+// Make sure the value added is what was missing to saturate
+const unsigned diff = counter.saturate();
+ASSERT_EQ(diff, max_value - 1);
+ASSERT_TRUE(counter.isSaturated());
+}
+
 /**
  * Test back and forth against an int.
  */

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/66791?usp=email
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: I8b75be48f924cc33ebf5e5aeff6d4045fac66bcc
Gerrit-Change-Number: 66791
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org