diff options
| author | John's Brew | 2019-11-15 20:25:05 +0100 |
|---|---|---|
| committer | Richard Lin | 2019-11-15 11:25:05 -0800 |
| commit | 9406e2bb5fa0a99f26f601a2f77db31f5598fc3b (patch) | |
| tree | d41486d5e355718815c793a531196b19194f32c4 /src/test/scala/chiselTests/NamingAnnotationTest.scala | |
| parent | 041fd3778e779f1d2301e10a5a3dbdfc84f76874 (diff) | |
Enable @chiselName on non-module classes (#1209)
Diffstat (limited to 'src/test/scala/chiselTests/NamingAnnotationTest.scala')
| -rw-r--r-- | src/test/scala/chiselTests/NamingAnnotationTest.scala | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/test/scala/chiselTests/NamingAnnotationTest.scala b/src/test/scala/chiselTests/NamingAnnotationTest.scala index 4576176a..e35c77c1 100644 --- a/src/test/scala/chiselTests/NamingAnnotationTest.scala +++ b/src/test/scala/chiselTests/NamingAnnotationTest.scala @@ -47,6 +47,21 @@ trait NamedModuleTester extends MultiIOModule { failures.toList } } +@chiselName +class OuterNamedNonModule { + val value = Wire(Bool()) +} + +@chiselName +class NonModule { + val value = Wire(Bool()) + @chiselName + class InnerNamedNonModule { + val value = Wire(Bool()) + } + val inner = new InnerNamedNonModule + val outer = new OuterNamedNonModule +} @chiselName class NamedModule extends NamedModuleTester { @@ -84,10 +99,14 @@ class NamedModule extends NamedModuleTester { val noreturn = expectName(1.U + 2.U, "noreturn") } - val test = expectName(FunctionMockup(), "test") val test2 = expectName(test +& 2.U, "test2") val test3 = expectName(ImplicitlyNamed(), "test3") + + val test4 = new NonModule + expectName(test4.value, "test4_value") + expectName(test4.inner.value, "test4_inner_value") + expectName(test4.outer.value, "test4_outer_value") // Test that contents of for loops are named for (i <- 0 until 1) { |
