summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/RecordSpec.scala
diff options
context:
space:
mode:
authorJack2022-03-15 19:37:37 +0000
committerJack2022-03-15 19:37:37 +0000
commit2f21943ff772da2171df866d4cee71dfa8127bf8 (patch)
treed00c9059c9361920036e784425641288782515d5 /src/test/scala/chiselTests/RecordSpec.scala
parent1876e740a48be2e5ff5bd4fd6c2018927f1dcec2 (diff)
parentf26df23bbe0ae9b7162ed70369f24b01d75a1493 (diff)
Merge branch '3.5.x' into 3.5-release
Diffstat (limited to 'src/test/scala/chiselTests/RecordSpec.scala')
-rw-r--r--src/test/scala/chiselTests/RecordSpec.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/RecordSpec.scala b/src/test/scala/chiselTests/RecordSpec.scala
index da3840dd..30b55812 100644
--- a/src/test/scala/chiselTests/RecordSpec.scala
+++ b/src/test/scala/chiselTests/RecordSpec.scala
@@ -27,6 +27,17 @@ trait RecordSpecUtils {
io.out <> io.in
}
+ class ConnectionTestModule(output: => Record, input: => Record) extends Module {
+ val io = IO(new Bundle {
+ val inMono = Input(input)
+ val outMono = Output(output)
+ val inBi = Input(input)
+ val outBi = Output(output)
+ })
+ io.outMono := io.inMono
+ io.outBi <> io.inBi
+ }
+
class RecordSerializationTest extends BasicTester {
val recordType = new CustomBundle("fizz" -> UInt(16.W), "buzz" -> UInt(16.W))
val record = Wire(recordType)
@@ -110,6 +121,14 @@ class RecordSpec extends ChiselFlatSpec with RecordSpecUtils with Utils {
ChiselStage.elaborate { new MyModule(new MyBundle, fooBarType) }
}
+ they should "emit FIRRTL bulk connects when possible" in {
+ val chirrtl = (new ChiselStage).emitChirrtl(
+ gen = new ConnectionTestModule(fooBarType, fooBarType)
+ )
+ chirrtl should include("io.outMono <= io.inMono @[RecordSpec.scala")
+ chirrtl should include("io.outBi <= io.inBi @[RecordSpec.scala")
+ }
+
they should "not allow aliased fields" in {
class AliasedFieldRecord extends Record {
val foo = UInt(8.W)