summaryrefslogtreecommitdiff
path: root/src/test/scala/cookbook/Bundle2UInt.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/cookbook/Bundle2UInt.scala')
-rw-r--r--src/test/scala/cookbook/Bundle2UInt.scala31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/test/scala/cookbook/Bundle2UInt.scala b/src/test/scala/cookbook/Bundle2UInt.scala
deleted file mode 100644
index 21d06df7..00000000
--- a/src/test/scala/cookbook/Bundle2UInt.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: Apache-2.0
-
-package cookbook
-
-import chisel3._
-
-/* ### How do I create a UInt from an instance of a Bundle?
- *
- * Call asUInt on the Bundle instance
- */
-class Bundle2UInt extends CookbookTester(1) {
- // Example
- class MyBundle extends Bundle {
- val foo = UInt(4.W)
- val bar = UInt(4.W)
- }
- val bundle = Wire(new MyBundle)
- bundle.foo := 0xc.U
- bundle.bar := 0x3.U
- val uint = bundle.asUInt
- printf(p"$uint") // 195
-
- // Test
- assert(uint === 0xc3.U)
-}
-
-class Bundle2UIntSpec extends CookbookSpec {
- "Bundle2UInt" should "work" in {
- assertTesterPasses { new Bundle2UInt }
- }
-}