diff --git a/build.sc b/build.sc index 3dd2b6a65..86b3d745c 100644 --- a/build.sc +++ b/build.sc @@ -2,7 +2,7 @@ import mill._, scalalib._ import coursier.maven.MavenRepository object ivys { - val scala = "2.12.13" + val scala = "2.13.10" val chisel3 = ivy"edu.berkeley.cs::chisel3:3.5.6" val chisel3Plugin = ivy"edu.berkeley.cs:::chisel3-plugin:3.5.6" } @@ -10,7 +10,7 @@ object ivys { trait CommonModule extends ScalaModule { override def scalaVersion = ivys.scala - override def scalacOptions = Seq("-Xsource:2.11") + override def scalacOptions = Seq("-Ymacro-annotations") } trait HasChisel3 extends ScalaModule { @@ -25,7 +25,7 @@ trait HasChisel3 extends ScalaModule { trait HasChiselTests extends SbtModule { object test extends SbtModuleTests with TestModule.ScalaTest { - override def ivyDeps = Agg(ivy"edu.berkeley.cs::chisel-iotesters:1.2+") + override def ivyDeps = Agg(ivy"edu.berkeley.cs::chiseltest:0.5.4") } } diff --git a/src/main/scala/nutcore/Decode.scala b/src/main/scala/nutcore/Decode.scala index abec00abe..7c772c041 100644 --- a/src/main/scala/nutcore/Decode.scala +++ b/src/main/scala/nutcore/Decode.scala @@ -1,17 +1,17 @@ /************************************************************************************** * Copyright (c) 2020 Institute of Computing Technology, CAS * Copyright (c) 2020 University of Chinese Academy of Sciences -* +* * NutShell is licensed under Mulan PSL v2. -* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. * You may obtain a copy of Mulan PSL v2 at: -* http://license.coscl.org.cn/MulanPSL2 -* -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR -* FIT FOR A PARTICULAR PURPOSE. +* http://license.coscl.org.cn/MulanPSL2 +* +* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR +* FIT FOR A PARTICULAR PURPOSE. * -* See the Mulan PSL v2 for more details. +* See the Mulan PSL v2 for more details. ***************************************************************************************/ package nutcore @@ -73,8 +73,8 @@ object Instructions extends HasInstrType with HasNutCoreParameter { def NOP = 0x00000013.U val DecodeDefault = List(InstrN, FuType.csr, CSROpType.jmp) def DecodeTable = RVIInstr.table ++ NutCoreTrap.table ++ - (if (HasMExtension) RVMInstr.table else Nil) ++ - (if (HasCExtension) RVCInstr.table else Nil) ++ + (if (HasMExtension) RVMInstr.table else Array.empty) ++ + (if (HasCExtension) RVCInstr.table else Array.empty) ++ Priviledged.table ++ RVAInstr.table ++ RVZicsrInstr.table ++ RVZifenceiInstr.table diff --git a/src/main/scala/nutcore/isa/Priviledged.scala b/src/main/scala/nutcore/isa/Priviledged.scala index af483ee18..be7fe9d6d 100644 --- a/src/main/scala/nutcore/isa/Priviledged.scala +++ b/src/main/scala/nutcore/isa/Priviledged.scala @@ -42,5 +42,5 @@ object Priviledged extends HasInstrType { FENCE -> List(InstrS, FuType.mou, MOUOpType.fence), // nop InstrS -> !wen WFI -> List(InstrI, FuType.alu, ALUOpType.add) // nop // FENCE -> List(InstrB, FuType.mou, MOUOpType.fencei) - ) ++ (if (!Settings.get("MmodeOnly")) table_s else Nil) + ) ++ (if (!Settings.get("MmodeOnly")) table_s else Array.empty) } diff --git a/src/main/scala/nutcore/isa/RVI.scala b/src/main/scala/nutcore/isa/RVI.scala index bdd214b64..4690b230b 100644 --- a/src/main/scala/nutcore/isa/RVI.scala +++ b/src/main/scala/nutcore/isa/RVI.scala @@ -167,5 +167,5 @@ object RV64IInstr extends HasInstrType { object RVIInstr extends HasNutCoreParameter { val table = RV32I_ALUInstr.table ++ RV32I_BRUInstr.table ++ RV32I_LSUInstr.table ++ - (if (XLEN == 64) RV64IInstr.table else Nil) + (if (XLEN == 64) RV64IInstr.table else Array.empty) } diff --git a/src/main/scala/nutcore/isa/RVM.scala b/src/main/scala/nutcore/isa/RVM.scala index 501e242dd..7fe1a2d9c 100644 --- a/src/main/scala/nutcore/isa/RVM.scala +++ b/src/main/scala/nutcore/isa/RVM.scala @@ -46,7 +46,7 @@ object RV32MInstr extends HasInstrType with HasNutCoreParameter { REM -> List(InstrR, FuType.mdu, MDUOpType.rem), REMU -> List(InstrR, FuType.mdu, MDUOpType.remu) ) - val table = mulTable ++ (if (HasDiv) divTable else Nil) + val table = mulTable ++ (if (HasDiv) divTable else Array.empty) } object RV64MInstr extends HasInstrType with HasNutCoreParameter { @@ -65,9 +65,9 @@ object RV64MInstr extends HasInstrType with HasNutCoreParameter { REMW -> List(InstrR, FuType.mdu, MDUOpType.remw), REMUW -> List(InstrR, FuType.mdu, MDUOpType.remuw) ) - val table = mulTable ++ (if (HasDiv) divTable else Nil) + val table = mulTable ++ (if (HasDiv) divTable else Array.empty) } object RVMInstr extends HasNutCoreParameter { - val table = RV32MInstr.table ++ (if (XLEN == 64) RV64MInstr.table else Nil) + val table = RV32MInstr.table ++ (if (XLEN == 64) RV64MInstr.table else Array.empty) }