Skip to content

Commit d1a6126

Browse files
committed
Bump for 3.2.0 release
2 parents e2fd887 + fafd984 commit d1a6126

File tree

6 files changed

+60
-34
lines changed

6 files changed

+60
-34
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ def javacOptionsVersion(scalaVersion: String): Seq[String] = {
2828
}
2929
}
3030

31-
val defaultVersions = Map("firrtl" -> "1.2-100219-SNAPSHOT")
31+
val defaultVersions = Map("firrtl" -> "1.2.0")
3232

3333
lazy val commonSettings = Seq (
3434
resolvers ++= Seq(
3535
Resolver.sonatypeRepo("snapshots"),
3636
Resolver.sonatypeRepo("releases")
3737
),
3838
organization := "edu.berkeley.cs",
39-
version := "3.2-100219-SNAPSHOT",
39+
version := "3.2.0",
4040
autoAPIMappings := true,
4141
scalaVersion := "2.12.10",
4242
crossScalaVersions := Seq("2.12.10", "2.11.12"),

build.sc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ object chiselCompileOptions {
3535
val crossVersions = Seq("2.12.10", "2.11.12")
3636

3737
// Provide a managed dependency on X if -DXVersion="" is supplied on the command line.
38-
val defaultVersions = Map("firrtl" -> "1.2-100219-SNAPSHOT")
38+
val defaultVersions = Map("firrtl" -> "1.2.0")
3939

4040
def getVersion(dep: String, org: String = "edu.berkeley.cs") = {
4141
val version = sys.env.getOrElse(dep + "Version", defaultVersions(dep))
@@ -67,7 +67,7 @@ trait CommonChiselModule extends SbtModule {
6767

6868
trait PublishChiselModule extends CommonChiselModule with PublishModule {
6969
override def artifactName = "chisel3"
70-
def publishVersion = "3.2-100219-SNAPSHOT"
70+
def publishVersion = "3.2.0"
7171

7272
def pomSettings = PomSettings(
7373
description = artifactName(),

chiselFrontend/src/main/scala/chisel3/Aggregate.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, val length: Int)
156156
child.bind(ChildBinding(this), resolvedDirection)
157157
}
158158

159-
direction = sample_element.direction
159+
// Since all children are the same, we can just use the sample_element rather than all children
160+
// .get is safe because None means mixed directions, we only pass 1 so that's not possible
161+
direction = ActualDirection.fromChildren(Set(sample_element.direction), resolvedDirection).get
160162
}
161163

162164
// Note: the constructor takes a gen() function instead of a Seq to enforce

chiselFrontend/src/main/scala/chisel3/Module.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ package experimental {
221221
/** Desired name of this module. Override this to give this module a custom, perhaps parametric,
222222
* name.
223223
*/
224-
def desiredName: String = this.getClass.getName.split('.').last
224+
def desiredName: String = this.getClass.getName.split("\\.|\\$").last
225225

226226
/** Legalized name of this module. */
227227
final lazy val name = try {

src/test/scala/chiselTests/DataPrint.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ class DataPrintSpec extends ChiselFlatSpec with Matchers {
3333
}
3434

3535
class BoundDataModule extends MultiIOModule { // not in the test to avoid anon naming suffixes
36-
Wire(UInt()).toString should be("UInt(Wire in DataPrintSpec$BoundDataModule)")
37-
Reg(SInt()).toString should be("SInt(Reg in DataPrintSpec$BoundDataModule)")
36+
Wire(UInt()).toString should be("UInt(Wire in BoundDataModule)")
37+
Reg(SInt()).toString should be("SInt(Reg in BoundDataModule)")
3838
val io = IO(Output(Bool())) // needs a name so elaboration doesn't fail
39-
io.toString should be("Bool(IO in unelaborated DataPrintSpec$BoundDataModule)")
39+
io.toString should be("Bool(IO in unelaborated BoundDataModule)")
4040
val m = Mem(4, UInt(2.W))
41-
m(2).toString should be("UInt<2>(MemPort in DataPrintSpec$BoundDataModule)")
42-
(2.U + 2.U).toString should be("UInt<2>(OpResult in DataPrintSpec$BoundDataModule)")
43-
Wire(Vec(3, UInt(2.W))).toString should be ("UInt<2>[3](Wire in DataPrintSpec$BoundDataModule)")
41+
m(2).toString should be("UInt<2>(MemPort in BoundDataModule)")
42+
(2.U + 2.U).toString should be("UInt<2>(OpResult in BoundDataModule)")
43+
Wire(Vec(3, UInt(2.W))).toString should be ("UInt<2>[3](Wire in BoundDataModule)")
4444

4545
class InnerModule extends MultiIOModule {
4646
val io = IO(Output(new Bundle {
4747
val a = UInt(4.W)
4848
}))
4949
}
5050
val inner = Module(new InnerModule)
51-
inner.clock.toString should be ("Clock(IO clock in DataPrintSpec$BoundDataModule$InnerModule)")
52-
inner.io.a.toString should be ("UInt<4>(IO io_a in DataPrintSpec$BoundDataModule$InnerModule)")
51+
inner.clock.toString should be ("Clock(IO clock in InnerModule)")
52+
inner.io.a.toString should be ("UInt<4>(IO io_a in InnerModule)")
5353
}
5454

5555
"Bound data types" should "have a meaningful string representation" in {

src/test/scala/chiselTests/Direction.scala

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -205,27 +205,37 @@ class DirectionSpec extends ChiselPropSpec with Matchers {
205205
val b = Output(Bool())
206206
}
207207

208+
val index = IO(Input(UInt(1.W)))
209+
208210
// Check all permutations of Vec and Flipped.
209-
val regularVec = IO(Vec(1, new MyBundle))
211+
val regularVec = IO(Vec(2, new MyBundle))
210212
regularVec <> DontCare
211213
assert(DataMirror.directionOf(regularVec.head.a) == Direction.Input)
212214
assert(DataMirror.directionOf(regularVec.head.b) == Direction.Output)
215+
assert(DataMirror.directionOf(regularVec(index).a) == Direction.Input)
216+
assert(DataMirror.directionOf(regularVec(index).b) == Direction.Output)
213217

214-
val vecFlipped = IO(Vec(1, Flipped(new MyBundle)))
218+
val vecFlipped = IO(Vec(2, Flipped(new MyBundle)))
215219
vecFlipped <> DontCare
216220
assert(DataMirror.directionOf(vecFlipped.head.a) == Direction.Output)
217221
assert(DataMirror.directionOf(vecFlipped.head.b) == Direction.Input)
222+
assert(DataMirror.directionOf(vecFlipped(index).a) == Direction.Output)
223+
assert(DataMirror.directionOf(vecFlipped(index).b) == Direction.Input)
218224

219-
val flippedVec = IO(Flipped(Vec(1, new MyBundle)))
225+
val flippedVec = IO(Flipped(Vec(2, new MyBundle)))
220226
flippedVec <> DontCare
221227
assert(DataMirror.directionOf(flippedVec.head.a) == Direction.Output)
222228
assert(DataMirror.directionOf(flippedVec.head.b) == Direction.Input)
229+
assert(DataMirror.directionOf(flippedVec(index).a) == Direction.Output)
230+
assert(DataMirror.directionOf(flippedVec(index).b) == Direction.Input)
223231

224232
// Flipped(Vec(Flipped())) should be equal to non-flipped.
225-
val flippedVecFlipped = IO(Flipped(Vec(1, Flipped(new MyBundle))))
233+
val flippedVecFlipped = IO(Flipped(Vec(2, Flipped(new MyBundle))))
226234
flippedVecFlipped <> DontCare
227235
assert(DataMirror.directionOf(flippedVecFlipped.head.a) == Direction.Input)
228236
assert(DataMirror.directionOf(flippedVecFlipped.head.b) == Direction.Output)
237+
assert(DataMirror.directionOf(flippedVecFlipped(index).a) == Direction.Input)
238+
assert(DataMirror.directionOf(flippedVecFlipped(index).b) == Direction.Output)
229239
}
230240

231241
val elaborated = Driver.elaborate(() => new MyModule)
@@ -238,10 +248,10 @@ class DirectionSpec extends ChiselPropSpec with Matchers {
238248
// Chisel Emitter formats spacing a little differently than the
239249
// FIRRTL Emitter :-(
240250
val s = o.replace("{flip a", "{ flip a")
241-
assert(s.contains("output regularVec : { flip a : UInt<1>, b : UInt<1>}[1]"))
242-
assert(s.contains("input vecFlipped : { flip a : UInt<1>, b : UInt<1>}[1]"))
243-
assert(s.contains("input flippedVec : { flip a : UInt<1>, b : UInt<1>}[1]"))
244-
assert(s.contains("output flippedVecFlipped : { flip a : UInt<1>, b : UInt<1>}[1]"))
251+
assert(s.contains("output regularVec : { flip a : UInt<1>, b : UInt<1>}[2]"))
252+
assert(s.contains("input vecFlipped : { flip a : UInt<1>, b : UInt<1>}[2]"))
253+
assert(s.contains("input flippedVec : { flip a : UInt<1>, b : UInt<1>}[2]"))
254+
assert(s.contains("output flippedVecFlipped : { flip a : UInt<1>, b : UInt<1>}[2]"))
245255
} }
246256
}
247257

@@ -252,35 +262,49 @@ class DirectionSpec extends ChiselPropSpec with Matchers {
252262
val b = Output(Bool())
253263
}
254264

255-
val inputVec = IO(Vec(1, Input(new MyBundle)))
265+
val index = IO(Input(UInt(1.W)))
266+
267+
val inputVec = IO(Vec(2, Input(new MyBundle)))
256268
inputVec <> DontCare
257269
assert(DataMirror.directionOf(inputVec.head.a) == Direction.Input)
258270
assert(DataMirror.directionOf(inputVec.head.b) == Direction.Input)
271+
assert(DataMirror.directionOf(inputVec(index).a) == Direction.Input)
272+
assert(DataMirror.directionOf(inputVec(index).b) == Direction.Input)
259273

260-
val vecInput = IO(Input(Vec(1, new MyBundle)))
274+
val vecInput = IO(Input(Vec(2, new MyBundle)))
261275
vecInput <> DontCare
262276
assert(DataMirror.directionOf(vecInput.head.a) == Direction.Input)
263277
assert(DataMirror.directionOf(vecInput.head.b) == Direction.Input)
278+
assert(DataMirror.directionOf(vecInput(index).a) == Direction.Input)
279+
assert(DataMirror.directionOf(vecInput(index).b) == Direction.Input)
264280

265-
val vecInputFlipped = IO(Input(Vec(1, Flipped(new MyBundle))))
281+
val vecInputFlipped = IO(Input(Vec(2, Flipped(new MyBundle))))
266282
vecInputFlipped <> DontCare
267283
assert(DataMirror.directionOf(vecInputFlipped.head.a) == Direction.Input)
268284
assert(DataMirror.directionOf(vecInputFlipped.head.b) == Direction.Input)
285+
assert(DataMirror.directionOf(vecInputFlipped(index).a) == Direction.Input)
286+
assert(DataMirror.directionOf(vecInputFlipped(index).b) == Direction.Input)
269287

270-
val outputVec = IO(Vec(1, Output(new MyBundle)))
288+
val outputVec = IO(Vec(2, Output(new MyBundle)))
271289
outputVec <> DontCare
272290
assert(DataMirror.directionOf(outputVec.head.a) == Direction.Output)
273291
assert(DataMirror.directionOf(outputVec.head.b) == Direction.Output)
292+
assert(DataMirror.directionOf(outputVec(index).a) == Direction.Output)
293+
assert(DataMirror.directionOf(outputVec(index).b) == Direction.Output)
274294

275-
val vecOutput = IO(Output(Vec(1, new MyBundle)))
295+
val vecOutput = IO(Output(Vec(2, new MyBundle)))
276296
vecOutput <> DontCare
277297
assert(DataMirror.directionOf(vecOutput.head.a) == Direction.Output)
278298
assert(DataMirror.directionOf(vecOutput.head.b) == Direction.Output)
299+
assert(DataMirror.directionOf(vecOutput(index).a) == Direction.Output)
300+
assert(DataMirror.directionOf(vecOutput(index).b) == Direction.Output)
279301

280-
val vecOutputFlipped = IO(Output(Vec(1, Flipped(new MyBundle))))
302+
val vecOutputFlipped = IO(Output(Vec(2, Flipped(new MyBundle))))
281303
vecOutputFlipped <> DontCare
282304
assert(DataMirror.directionOf(vecOutputFlipped.head.a) == Direction.Output)
283305
assert(DataMirror.directionOf(vecOutputFlipped.head.b) == Direction.Output)
306+
assert(DataMirror.directionOf(vecOutputFlipped(index).a) == Direction.Output)
307+
assert(DataMirror.directionOf(vecOutputFlipped(index).b) == Direction.Output)
284308
}
285309

286310
val elaborated = Driver.elaborate(() => new MyModule)
@@ -293,12 +317,12 @@ class DirectionSpec extends ChiselPropSpec with Matchers {
293317
// Chisel Emitter formats spacing a little differently than the
294318
// FIRRTL Emitter :-(
295319
val s = o.replace("{a", "{ a")
296-
assert(s.contains("input inputVec : { a : UInt<1>, b : UInt<1>}[1]"))
297-
assert(s.contains("input vecInput : { a : UInt<1>, b : UInt<1>}[1]"))
298-
assert(s.contains("input vecInputFlipped : { a : UInt<1>, b : UInt<1>}[1]"))
299-
assert(s.contains("output outputVec : { a : UInt<1>, b : UInt<1>}[1]"))
300-
assert(s.contains("output vecOutput : { a : UInt<1>, b : UInt<1>}[1]"))
301-
assert(s.contains("output vecOutputFlipped : { a : UInt<1>, b : UInt<1>}[1]"))
320+
assert(s.contains("input inputVec : { a : UInt<1>, b : UInt<1>}[2]"))
321+
assert(s.contains("input vecInput : { a : UInt<1>, b : UInt<1>}[2]"))
322+
assert(s.contains("input vecInputFlipped : { a : UInt<1>, b : UInt<1>}[2]"))
323+
assert(s.contains("output outputVec : { a : UInt<1>, b : UInt<1>}[2]"))
324+
assert(s.contains("output vecOutput : { a : UInt<1>, b : UInt<1>}[2]"))
325+
assert(s.contains("output vecOutputFlipped : { a : UInt<1>, b : UInt<1>}[2]"))
302326
} }
303327
}
304328
}

0 commit comments

Comments
 (0)