diff options
| author | Aditya Naik | 2023-11-23 03:11:56 -0800 |
|---|---|---|
| committer | Aditya Naik | 2023-11-23 03:11:56 -0800 |
| commit | af415532cf160e63e971ceb301833b8433c18a50 (patch) | |
| tree | 1fef70139846f57298c8e24a590490a74249f7dd /src/test/scala/chiselTests/TransitNameSpec.scala | |
| parent | 8200c0cdf1d471453946d5ae24bc99757b2ef02d (diff) | |
cleanup
Diffstat (limited to 'src/test/scala/chiselTests/TransitNameSpec.scala')
| -rw-r--r-- | src/test/scala/chiselTests/TransitNameSpec.scala | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/test/scala/chiselTests/TransitNameSpec.scala b/src/test/scala/chiselTests/TransitNameSpec.scala deleted file mode 100644 index ae08336d..00000000 --- a/src/test/scala/chiselTests/TransitNameSpec.scala +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -package chiselTests - -import chisel3._ -import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage} -import chisel3.util.TransitName - -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers - -class TransitNameSpec extends AnyFlatSpec with Matchers { - - class MyModule extends RawModule { - val io = IO(new Bundle {}) - override val desiredName: String = "MyModule" - } - - /** A top-level module that instantiates three copies of MyModule */ - class Top extends RawModule { - - /* Assign the IO of a new MyModule instance to value "foo". The instance will be named "MyModule". */ - val foo = Module(new MyModule).io - - /* Assign the IO of a new MyModule instance to value "bar". The instance will be named "bar". */ - val bar = { - val x = Module(new MyModule) - TransitName(x.io, x) // TransitName returns the first argument - } - - /* Assign the IO of a new MyModule instance to value "baz". The instance will be named "baz_generated". */ - val baz = { - val x = Module(new MyModule) - TransitName.withSuffix("_generated")(x.io, x) // TransitName returns the first argument - } - - } - - it should "transit a name" in { - - val firrtl = (new ChiselStage) - .emitFirrtl(new Top, Array("--target-dir", "test_run_dir/TransitNameSpec")) - - info("""output FIRRTL includes "inst MyModule"""") - firrtl should include("inst MyModule of MyModule") - - info("""output FIRRTL includes "inst bar"""") - firrtl should include("inst bar of MyModule") - - info("""output FIRRTL includes "inst baz_generated"""") - firrtl should include("inst baz_generated of MyModule") - } - -} |
