Skip to content

Commit f665b8b

Browse files
authored
Merge pull request #3775 from tymcauley/fix-warnings
2 parents 8f1e33b + d9bbb50 commit f665b8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+148
-134
lines changed

dependencies/diplomacy

Submodule diplomacy updated 38 files

src/main/scala/amba/axi4/Fragmenter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class AXI4Fragmenter()(implicit p: Parameters) extends LazyModule
7878

7979
// We don't care about illegal addresses; bursts or no bursts... whatever circuit is simpler (AXI4ToTL will fix it)
8080
// !!! think about this more -- what if illegal?
81-
val sizes1 = (supportedSizes1 zip slave.slaves.map(_.address)).filter(_._1 >= 0).groupBy(_._1).mapValues(_.flatMap(_._2))
81+
val sizes1 = (supportedSizes1 zip slave.slaves.map(_.address)).filter(_._1 >= 0).groupBy(_._1).view.mapValues(_.flatMap(_._2)).toMap
8282
val reductionMask = AddressDecoder(sizes1.values.toList)
8383
val support1 = Mux1H(sizes1.toList.map { case (v, a) => // maximum supported size-1 based on target address
8484
(AddressSet.unify(a.map(_.widen(~reductionMask)).distinct).map(_.contains(addr)).reduce(_||_), v.U)

src/main/scala/amba/axi4/IdIndexer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AXI4IdIndexer(idBits: Int)(implicit p: Parameters) extends LazyModule
5454
val field = if (bits > 0) Seq(AXI4ExtraIdField(bits)) else Nil
5555
mp.copy(
5656
echoFields = field ++ mp.echoFields,
57-
masters = masters.zip(finalNameStrings).map { case (m, n) => m.copy(name = n) })
57+
masters = masters.zip(finalNameStrings).map { case (m, n) => m.copy(name = n) }.toIndexedSeq)
5858
},
5959
slaveFn = { sp => sp
6060
})

src/main/scala/devices/debug/Debug.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ class TLDebugModuleInner(device: Device, getNComponents: () => Int, beatBytes: I
17031703
flags.zipWithIndex.map{case(x, i) => RegField.r(8, x.asUInt, RegFieldDesc(s"debug_flags_$i", "", volatile=true))}
17041704
}),
17051705
ROMBASE -> RegFieldGroup("debug_rom", Some("Debug ROM"),
1706-
(if (cfg.atzero) DebugRomContents() else DebugRomNonzeroContents()).zipWithIndex.map{case (x, i) =>
1706+
(if (cfg.atzero) DebugRomContents() else DebugRomNonzeroContents()).toIndexedSeq.zipWithIndex.map{case (x, i) =>
17071707
RegField.r(8, (x & 0xFF).U(8.W), RegFieldDesc(s"debug_rom_$i", "", reset=Some(x)))})
17081708
)
17091709

src/main/scala/devices/tilelink/BootROM.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ object BootROM {
9999
}
100100

101101
val bootrom = bootROMDomainWrapper {
102-
LazyModule(new TLROM(params.address, params.size, contents, true, tlbus.beatBytes))
102+
LazyModule(new TLROM(params.address, params.size, contents.toIndexedSeq, true, tlbus.beatBytes))
103103
}
104104

105105
bootrom.node := tlbus.coupleTo(params.name){ TLFragmenter(tlbus, Some(params.name)) := _ }

src/main/scala/devices/tilelink/BusBypass.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ package freechips.rocketchip.devices.tilelink
44

55
import chisel3._
66
import org.chipsalliance.cde.config.Parameters
7-
import freechips.rocketchip.diplomacy._
7+
import org.chipsalliance.diplomacy.ValName
8+
import org.chipsalliance.diplomacy.lazymodule._
9+
import org.chipsalliance.diplomacy.nodes.NodeHandle
10+
import freechips.rocketchip.diplomacy.{AddressSet, RegionType}
811
import freechips.rocketchip.tilelink._
912

1013
abstract class TLBusBypassBase(beatBytes: Int, deadlock: Boolean = false, bufferError: Boolean = true, maxAtomic: Int = 16, maxTransfer: Int = 4096)

src/main/scala/devices/tilelink/Deadlock.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package freechips.rocketchip.devices.tilelink
44

55
import chisel3._
66
import org.chipsalliance.cde.config.Parameters
7-
import freechips.rocketchip.diplomacy._
7+
import org.chipsalliance.diplomacy.lazymodule._
88
import freechips.rocketchip.resources.{SimpleDevice}
99

1010
/** Adds a /dev/null slave that does not raise ready for any incoming traffic.

src/main/scala/diplomacy/AddressDecoder.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ object AddressDecoder
1212
type Partitions = Seq[Partition]
1313

1414
val addressOrder = Ordering.ordered[AddressSet]
15-
val portOrder = Ordering.Iterable(addressOrder)
16-
val partitionOrder = Ordering.Iterable(portOrder)
15+
import Ordering.Implicits._
16+
val portOrder = Ordering[Seq[AddressSet]]
17+
val partitionOrder = Ordering[Seq[Seq[AddressSet]]]
1718

1819
// Find the minimum subset of bits needed to disambiguate port addresses.
1920
// ie: inspecting only the bits in the output, you can look at an address
@@ -126,7 +127,7 @@ object AddressDecoder
126127
println(" For bit %x, %s".format(bit, score.toString))
127128
(score, bit, result)
128129
}
129-
val (bestScore, bestBit, bestPartitions) = candidates.min(Ordering.by[(Seq[Int], BigInt, Partitions), Iterable[Int]](_._1.toIterable))
130+
val (bestScore, bestBit, bestPartitions) = candidates.min(Ordering.by[(Seq[Int], BigInt, Partitions), Seq[Int]](_._1))
130131
if (debug) println("=> Selected bit 0x%x".format(bestBit))
131132
bestBit +: recurse(bestPartitions, bits.filter(_ != bestBit))
132133
}

src/main/scala/diplomacy/Main.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import chisel3.stage.ChiselGeneratorAnnotation
55
import chisel3.stage.phases.{Elaborate, Convert}
66
import firrtl.AnnotationSeq
77
import firrtl.options.TargetDirAnnotation
8-
import freechips.rocketchip.diplomacy.LazyModule
8+
import org.chipsalliance.diplomacy.lazymodule.LazyModule
99
import org.chipsalliance.cde.config.{Config, Parameters}
1010
import mainargs._
1111

@@ -22,7 +22,7 @@ object Main {
2222
.getConstructor(classOf[Parameters])
2323
.newInstance(new Config(config.foldRight(Parameters.empty) {
2424
case (currentName, config) =>
25-
val currentConfig = Class.forName(currentName).newInstance.asInstanceOf[Config]
25+
val currentConfig = Class.forName(currentName).getDeclaredConstructor().newInstance().asInstanceOf[Config]
2626
currentConfig ++ config
2727
})) match {
2828
case m: RawModule => m
@@ -51,6 +51,6 @@ object Main {
5151
freechips.rocketchip.util.ElaborationArtefacts.files.foreach{ case (ext, contents) => os.write.over(os.Path(dir) / s"${config.mkString("_")}.${ext}", contents()) }
5252
}
5353

54-
def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
54+
def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq)
5555
}
5656

src/main/scala/diplomacy/Parameters.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
package freechips.rocketchip.diplomacy
44

5+
import scala.language.implicitConversions
6+
57
import chisel3._
68
import chisel3.util.{DecoupledIO, Queue, ReadyValidIO, isPow2, log2Ceil, log2Floor}
79
import freechips.rocketchip.util.ShiftQueue
@@ -30,8 +32,8 @@ case class IdRange(start: Int, end: Int) extends Ordered[IdRange]
3032
require (start <= end, "Id ranges cannot be negative.")
3133

3234
def compare(x: IdRange) = {
33-
val primary = (this.start - x.start).signum
34-
val secondary = (x.end - this.end).signum
35+
val primary = (this.start - x.start).sign
36+
val secondary = (x.end - this.end).sign
3537
if (primary != 0) primary else secondary
3638
}
3739

@@ -119,7 +121,7 @@ object TransferSizes {
119121
def mincover(seq: Seq[TransferSizes]) = seq.foldLeft(none)(_ mincover _)
120122
def intersect(seq: Seq[TransferSizes]) = seq.reduce(_ intersect _)
121123

122-
implicit def asBool(x: TransferSizes) = !x.none
124+
implicit def asBool(x: TransferSizes): Boolean = !x.none
123125
}
124126

125127
// AddressSets specify the address space managed by the manager

0 commit comments

Comments
 (0)