[gem5-dev] [S] Change in gem5/gem5[develop]: arch-riscv: Correct the IllegalInstFault messege of instruction c.add...

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



Change subject: arch-riscv: Correct the IllegalInstFault messege of  
instruction c.addi4spn

..

arch-riscv: Correct the IllegalInstFault messege of instruction
c.addi4spn

In Riscv Manual Volumn I: Unpriviledged ISA section 18.5, c.addi4spn
will not working if imm == 0, not machInst == 0. It is changed in the
[CL](https://gem5-review.git.corp.google.com/c/public/gem5/+/66732), and  
here is the additional patch to the CL.


Change-Id: I2a3c9660dc43f1399f68e03c4f59207f869807a0
---
M src/arch/riscv/isa/decoder.isa
1 file changed, 15 insertions(+), 1 deletion(-)



diff --git a/src/arch/riscv/isa/decoder.isa b/src/arch/riscv/isa/decoder.isa
index c070392..53d4a4d 100644
--- a/src/arch/riscv/isa/decoder.isa
+++ b/src/arch/riscv/isa/decoder.isa
@@ -48,7 +48,7 @@
   CIMM8<5:2> << 6;
 }}, {{
 if (imm == 0)
-return std::make_shared("zero  
instruction",

+return std::make_shared("immediate = 0",
machInst);
 Rp2 = rvSext(sp + imm);
 }}, uint64_t);

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/66931?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: I2a3c9660dc43f1399f68e03c4f59207f869807a0
Gerrit-Change-Number: 66931
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] Jenkins build is back to normal : nightly #464

2022-12-22 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


[gem5-dev] [M] Change in gem5/gem5[develop]: arch-riscv: Refactor compressed instructions

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


Change subject: arch-riscv: Refactor compressed instructions
..

arch-riscv: Refactor compressed instructions

1. C.JAL should use CJOp format to generate code
2. Use sext function to handle MSB for immediate
3. Add IsCall flags to c.jal, c.jalr
4. Use JumpConstructor to CJOp format

Change-Id: Id01c0d7cc1a3e17776890268879c568fc9996bc5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66732
Reviewed-by: Yu-hsin Wang 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M src/arch/riscv/isa/decoder.isa
M src/arch/riscv/isa/formats/compressed.isa
2 files changed, 90 insertions(+), 94 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Yu-hsin Wang: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/riscv/isa/decoder.isa b/src/arch/riscv/isa/decoder.isa
index 458327e..c070392 100644
--- a/src/arch/riscv/isa/decoder.isa
+++ b/src/arch/riscv/isa/decoder.isa
@@ -47,7 +47,7 @@
   CIMM8<7:6> << 4 |
   CIMM8<5:2> << 6;
 }}, {{
-if (machInst == 0)
+if (imm == 0)
 return std::make_shared("zero  
instruction",

machInst);
 Rp2 = rvSext(sp + imm);
@@ -147,91 +147,71 @@
 }
 }
 0x1: decode COPCODE {
-format CIOp {
-0x0: c_addi({{
-imm = CIMM5;
-if (CIMM1 > 0)
-imm |= ~((uint64_t)0x1F);
-}}, {{
-if ((RC1 == 0) != (imm == 0)) {
-if (RC1 == 0) {
-return std::make_shared(
-"source reg x0", machInst);
-} else { // imm == 0
-return std::make_shared(
-"immediate = 0", machInst);
-}
+0x0: CIOp::c_addi({{
+imm = sext<6>(CIMM5 | (CIMM1 << 5));
+}}, {{
+if ((RC1 == 0) != (imm == 0)) {
+if (RC1 == 0) {
+return std::make_shared(
+"source reg x0", machInst);
+} else { // imm == 0
+return std::make_shared(
+"immediate = 0", machInst);
 }
-Rc1_sd = rvSext(Rc1_sd + imm);
-}});
-0x1: decode RVTYPE {
-0x0: c_jal({{
-imm = sext<12>((CJUMPIMM3TO1 << 1) |
-   (CJUMPIMM4TO4 << 4) |
-   (CJUMPIMM5TO5 << 5) |
-   (CJUMPIMM6TO6 << 6) |
-   (CJUMPIMM7TO7 << 7) |
-   (CJUMPIMM9TO8 << 8) |
-   (CJUMPIMM10TO10 << 10) |
-   (CJUMPIMMSIGN << 11));
-}}, {{
-ra_sw = NPC_uw;
-NPC_uw = PC_uw + imm;
-}});
-0x1: c_addiw({{
-imm = CIMM5;
-if (CIMM1 > 0)
-imm |= ~((uint64_t)0x1F);
-}}, {{
-if (RC1 == 0) {
-return std::make_shared(
-"source reg x0", machInst);
-}
-Rc1_sw = (int32_t)(Rc1_sw + imm);
-}});
 }
-0x2: c_li({{
-imm = CIMM5;
-if (CIMM1 > 0)
-imm |= ~((uint64_t)0x1F);
+Rc1_sd = rvSext(Rc1_sd + imm);
+}});
+0x1: decode RVTYPE {
+0x0: CJOp::c_jal({{
+ra_sw = NPC_uw;
+NPC_uw = PC_uw + imm;
+}}, IsDirectControl, IsUncondControl, IsCall);
+0x1: CIOp::c_addiw({{
+imm = sext<6>(CIMM5 | (CIMM1 << 5));
 }}, {{
 if (RC1 == 0) {
 return std::make_shared(
 "source reg x0", machInst);
 }
+Rc1_sw = (int32_t)(Rc1_sw + imm);
+}});
+}
+0x2: CIOp::c_li({{
+imm = sext<6>(CIMM5 | (CIMM1 << 5));
+}}, {{
+if (RC1 == 0) {
+return std::make_shared(
+"source reg x0", machInst);
+}
+Rc1_sd = imm;
+}});
+0x3: decode RC1 {
+0x2: CIOp::c_addi16sp({{
+imm = sext<10>((CIMM5<4:4> << 4) |
+   (CIMM5<0:0> << 5) |
+   (CIMM5<3:3> << 6) |
+   (CIMM5<2:1> << 7) |
+   (CIMM1 << 

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

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


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

arch-riscv: Refactor template JumpConstructor

Add COPCODE == 4 condition to ensure the available instruction is either  
c_jr or c_jalr and the flag IsReturn should set for instruction c_jalr if  
RC1 == t0


Change-Id: I1b39a6c1dc52c8035f16cc64a1b4c494b14879c0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66811
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
Reviewed-by: Yu-hsin Wang 
---
M src/arch/riscv/isa/formats/standard.isa
1 file changed, 23 insertions(+), 3 deletions(-)

Approvals:
  Yu-hsin Wang: Looks good to me, approved
  kokoro: Regressions pass
  Jason Lowe-Power: Looks good to me, approved




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: 5
Gerrit-Owner: Roger Chang 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Roger Chang 
Gerrit-Reviewer: Yu-hsin Wang 
Gerrit-Reviewer: kokoro 
Gerrit-CC: Earl Ou 
Gerrit-CC: Jui-min Lee 
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 #462

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

Changes:


--
[...truncated 1.03 KB...]
 > git checkout -f 7fb2fda841be0d61b00569c5a456fcdc0ab75bb1 # timeout=10
Commit message: "base: Fix signature of SatCounter::saturate()"
 > git rev-list --no-walk 7fb2fda841be0d61b00569c5a456fcdc0ab75bb1 # timeout=10
[Checks API] No suitable checks publisher found.
[compiler-checks] $ /bin/sh -xe /tmp/jenkins14717547226982762932.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 'MIPS.opt' with 'gcc-version-12'...
Done.
  * Building target 'MIPS.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 'ARM_MOESI_hammer.opt' with 'gcc-version-12'...
Done.
  * Building target 'ARM_MOESI_hammer.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 'X86.opt' with 'gcc-version-12'...
Done.
  * Building target 'X86.fast' with 'gcc-version-12'...
Done.
  * Building target 'GCN3_X86.opt' with 'gcc-version-12'...
Done.
  * Building target 'GCN3_X86.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 'ARM.opt' with 'gcc-version-12'...
Done.
  * Building target 'ARM.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 '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 'NULL_MOESI_CMP_directory.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MOESI_CMP_directory.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_MESI_Two_Level.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL_MESI_Two_Level.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 '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 'NULL.opt' with 'gcc-version-12'...
Done.
  * Building target 'NULL.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 'POWER.opt' with 'gcc-version-12'...
Done.
  * Building target 'POWER.fast' with 'gcc-version-12'...
Done.
Starting build tests with 'gcc-version-11'...
  * Building target 'NULL_MOESI_hammer.opt' with 'gcc-version-11'...
Done.
  * Building target 'NULL_MOESI_hammer.fast' with 'gcc-version-11'...
Done.
Starting build tests with 'gcc-version-10'...
  * Building target 'NULL_MOESI_hammer.opt' with 'gcc-version-10'...
Done.
  * Building target 'NULL_MOESI_hammer.fast' with 'gcc-version-10'...
Done.
Starting build tests with 'gcc-version-9'...
  * Building target 'RISCV.opt' with 'gcc-version-9'...
Done.
  * Building target 'RISCV.fast' with 'gcc-version-9'...
Done.
Starting build tests with 'gcc-version-8'...
  * Building target 'NULL_MOESI_hammer.opt' with 'gcc-version-8'...
Done.
  * Building target 'NULL_MOESI_hammer.fast' with 'gcc-version-8'...
Done.
Starting build tests with 'gcc-version-7'...
  * Building target 'NULL_MOESI_hammer.opt' with 'gcc-version-7'...
  ! Failed with exit code 2.
  * Building target 'NULL_MOESI_hammer.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 'NULL_MOESI_CMP_directory.opt' with 'clang-version-14'...
Done.
  * Building target 'NULL_MOESI_CMP_directory.fast' with 'clang-version-14'...
Done.
  * Building target 'X86_MI_example.opt' with 'clang-version-14'...
Done.
  * Building target 'X86_MI_example.fast' with 'clang-version-14'...
Done.
  * Building target 

[gem5-dev] [S] Change in gem5/gem5[develop]: dev: Fix -Wunused-variable in structured binding

2022-12-22 Thread Giacomo Travaglini (Gerrit) via gem5-dev
Giacomo Travaglini has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/66891?usp=email )


Change subject: dev: Fix -Wunused-variable in structured binding
..

dev: Fix -Wunused-variable in structured binding

Change-Id: Ia244767dd9d1dd7b72c320fb78e48f206694f5a2
Signed-off-by: Giacomo Travaglini 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66891
Tested-by: kokoro 
Reviewed-by: Yu-hsin Wang 
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
---
M src/dev/reg_bank.hh
1 file changed, 17 insertions(+), 2 deletions(-)

Approvals:
  Yu-hsin Wang: Looks good to me, approved
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/dev/reg_bank.hh b/src/dev/reg_bank.hh
index 66d668b..32d9058 100644
--- a/src/dev/reg_bank.hh
+++ b/src/dev/reg_bank.hh
@@ -1018,8 +1018,8 @@
 virtual void
 reset()
 {
-for (auto &[offset, reg]: _offsetMap)
-reg.get().reset();
+for (auto : _offsetMap)
+it.second.get().reset();
 }
 };


--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/66891?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: Ia244767dd9d1dd7b72c320fb78e48f206694f5a2
Gerrit-Change-Number: 66891
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Yu-hsin Wang 
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