Skip to content

Commit 2e3d722

Browse files
committed
Add and update files
1 parent 498ac04 commit 2e3d722

27 files changed

+42
-23
lines changed

src/test/scala/chiselTests/AutoNestedCloneSpec.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,19 @@ class AutoNestedCloneSpec extends AnyFlatSpec with Matchers {
126126
val foo = new Bundle {
127127
val x = Input(Vec(n, gen))
128128
}
129-
val bar = Output(Option(new { def mkBundle = new Bundle { val x = Vec(n, gen) } }).get.mkBundle)
129+
trait HasMkBundle { def mkBundle: Bundle }
130+
131+
val mk: HasMkBundle =
132+
new HasMkBundle {
133+
def mkBundle: Bundle = new Bundle { val x = Vec(n, gen) }
134+
}
135+
val bar = Output(mk.mkBundle)
130136
}
131137
val io = IO(new MyBundle(4, UInt(8.W)))
132138
val myWire = WireInit(io.foo)
133139
val myWire2 = WireInit(io.bar)
134140
io.bar.x := io.foo.x
141+
135142
})
136143
}
137144
}

src/test/scala/chiselTests/BlackBox.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ class BlackBoxSpec extends AnyFlatSpec with Matchers with ChiselSim with FileChe
401401
class Bar extends BlackBox {
402402
final val io = IO {
403403
new Bundle {
404-
val a = Output(probe.Probe(Bool(), layers.Verification))
404+
val a = Output(probe.Probe(Bool(), chisel3.layers.Verification))
405405
}
406406
}
407407
}
@@ -411,7 +411,7 @@ class BlackBoxSpec extends AnyFlatSpec with Matchers with ChiselSim with FileChe
411411
class Baz extends BlackBox(knownLayers = Seq(A)) {
412412
final val io = IO {
413413
new Bundle {
414-
val a = Output(probe.Probe(Bool(), layers.Verification))
414+
val a = Output(probe.Probe(Bool(), chisel3.layers.Verification))
415415
}
416416
}
417417
}

src/test/scala/chiselTests/BoolSpec.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import chisel3._
66
import chisel3.simulator.scalatest.ChiselSim
77
import chisel3.simulator.stimulus.RunUntilFinished
88
import org.scalatest.flatspec.AnyFlatSpec
9+
import scala.reflect.Selectable.reflectiveSelectable
910

1011
class BoolSpec extends AnyFlatSpec with ChiselSim {
1112

src/test/scala/chiselTests/BulkConnectSpec.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import chisel3.util.Decoupled
55
import circt.stage.ChiselStage
66
import org.scalatest.matchers.should.Matchers
77
import org.scalatest.propspec.AnyPropSpec
8+
import scala.reflect.Selectable.reflectiveSelectable
89

910
class BulkConnectSpec extends AnyPropSpec with Matchers {
1011
property("Chisel connects should emit FIRRTL bulk connects when possible") {
@@ -73,7 +74,7 @@ class BulkConnectSpec extends AnyPropSpec with Matchers {
7374
val chirrtl = ChiselStage.emitCHIRRTL(new Module {
7475
val io: MyBundle = IO(Flipped(new MyBundle))
7576

76-
val bb = Module(new BlackBox {
77+
val bb = Module[BlackBox { def io: MyBundle }](new BlackBox {
7778
val io: MyBundle = IO(Flipped(new MyBundle))
7879
})
7980

src/test/scala/chiselTests/ClockSpec.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import chisel3.simulator.stimulus.RunUntilFinished
88
import circt.stage.ChiselStage
99
import org.scalatest.propspec.AnyPropSpec
1010
import org.scalatest.matchers.should.Matchers
11+
import scala.reflect.Selectable.reflectiveSelectable
1112

1213
class ClockAsUIntTester extends Module {
1314
assert(true.B.asClock.asUInt === 1.U)

src/test/scala/chiselTests/Decoder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Decoder(bitpats: List[String]) extends Module {
1414
val inst = Input(UInt(32.W))
1515
val matched = Output(Bool())
1616
})
17-
io.matched := VecInit(bitpats.map(BitPat(_) === io.inst)).reduce(_ || _)
17+
io.matched := VecInit(bitpats.map(BitPat(_) === io.inst).reduce(_ || _))
1818
}
1919

2020
class DecoderTester(pairs: List[(String, String)]) extends Module {

src/test/scala/chiselTests/ExtModule.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import chisel3.util.HasExtModuleResource
1111
import circt.stage.ChiselStage
1212
import org.scalatest.flatspec.AnyFlatSpec
1313
import org.scalatest.matchers.should.Matchers
14+
import scala.reflect.Selectable.reflectiveSelectable
1415

1516
// Avoid collisions with regular BlackBox tests by putting ExtModule blackboxes
1617
// in their own scope.

src/test/scala/chiselTests/IntrinsicSpec.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package chiselTests
44

55
import chisel3._
66
import circt.stage.ChiselStage
7+
import chisel3.experimental.{fromIntToIntParam, fromStringToStringParam}
78
import org.scalatest.flatspec.AnyFlatSpec
89
import org.scalatest.matchers.should.Matchers
910

src/test/scala/chiselTests/LiteralToTargetSpec.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ import org.scalatest.freespec.AnyFreeSpec
88
import org.scalatest.matchers.should.Matchers
99

1010
class LiteralToTargetSpec extends AnyFreeSpec with Matchers {
11-
1211
"Literal Data should fail to be converted to ReferenceTarget" in {
13-
14-
(the[ChiselException] thrownBy {
15-
12+
val ex = the[ChiselException] thrownBy {
1613
class Bar extends RawModule {
1714
val a = 1.U
1815
}
@@ -23,6 +20,8 @@ class LiteralToTargetSpec extends AnyFreeSpec with Matchers {
2320
}
2421

2522
ChiselStage.emitCHIRRTL(new Foo)
26-
} should have).message("Illegal component name: UInt<1>(0h1) (note: literals are illegal)")
23+
}
24+
25+
ex.getMessage shouldBe "Illegal component name: UInt<1>(0h1) (note: literals are illegal)"
2726
}
2827
}

src/test/scala/chiselTests/LogUtils.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package chiselTests
44

55
import java.io.{ByteArrayOutputStream, PrintStream}
66
import logger.{LogLevel, LogLevelAnnotation, Logger}
7+
import firrtl.{annoSeqToSeq, seqToAnnoSeq, AnnotationSeq}
78

89
trait LogUtils {
910

0 commit comments

Comments
 (0)