From 50bbf973b4d631e14bd3cf40fa9dfe39a5c3d2e4 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Mon, 25 Mar 2019 23:49:14 -0700 Subject: Allow naming annotation to work outside builder context (#1051) --- src/test/scala/chiselTests/NamingAnnotationTest.scala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/test/scala/chiselTests/NamingAnnotationTest.scala b/src/test/scala/chiselTests/NamingAnnotationTest.scala index 9fdf0695..aae9123e 100644 --- a/src/test/scala/chiselTests/NamingAnnotationTest.scala +++ b/src/test/scala/chiselTests/NamingAnnotationTest.scala @@ -154,6 +154,11 @@ object NonNamedHelper { val myVal = NamedFunction() myVal } + + @chiselName + def NonBuilderFunction(): Int = { // scalastyle:ignore method.name + 1 + 1 + } } @chiselName @@ -215,4 +220,8 @@ class NamingAnnotationSpec extends ChiselPropSpec { property("NonNamedFunction should elaborate") { elaborate { new NonNamedFunction } } + + property("NonBuilderFunction should run outside a Builder context") { + NonNamedHelper.NonBuilderFunction() should be (2) + } } -- cgit v1.2.3