aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/transforms
diff options
context:
space:
mode:
authorJack Koenig2018-02-27 18:07:11 -0800
committerGitHub2018-02-27 18:07:11 -0800
commitc7eb1570dfb1c7701ea32d1209982a053f3cec1d (patch)
tree3f509b202d82841c5dad5588d1f953a25d389b44 /src/test/scala/firrtlTests/transforms
parentb90fc784a1819c1d7905910130a7da022214bc22 (diff)
Refactor Annotations (#721)
- Old Annotation renamed to deprecated LegacyAnnotation - Annotation is now a trait that can be extended - New JsonProtocol for Annotation [de]serialization - Replace AnnotationMap with AnnotationSeq - Deprecate Transform.getMyAnnotations - Update Transforms - Turn on deprecation warnings - Remove deprecated Driver.compile - Make AnnotationTests abstract with Legacy and Json subclasses - Add functionality to convert LegacyAnnotations of built-in annos This will give a noisy warning and is more of a best effort than a robust solution. Fixes #475 Closes #609
Diffstat (limited to 'src/test/scala/firrtlTests/transforms')
-rw-r--r--src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala33
-rw-r--r--src/test/scala/firrtlTests/transforms/DedupTests.scala2
2 files changed, 4 insertions, 31 deletions
diff --git a/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala b/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala
index bf294fe9..4c550c46 100644
--- a/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala
+++ b/src/test/scala/firrtlTests/transforms/BlacklBoxSourceHelperSpec.scala
@@ -4,39 +4,12 @@ package firrtlTests.transforms
import firrtl.annotations.{Annotation, CircuitName, ModuleName}
import firrtl.transforms._
-import firrtl.{AnnotationMap, FIRRTLException, Transform, VerilogCompiler}
+import firrtl.{FIRRTLException, Transform, VerilogCompiler}
import firrtlTests.{HighTransformSpec, LowTransformSpec}
import org.scalacheck.Test.Failed
import org.scalatest.{FreeSpec, Matchers, Succeeded}
-/**
- * Tests inline instances transformation
- */
-class BlacklBoxSourceHelperSpec extends FreeSpec with Matchers {
- "BlackBoxSourceAnnotations" - {
- val modName = ModuleName("dog", CircuitName("fox"))
- val resource = "file://somefile.v"
-
- "should parse and unparse" in {
-
- val serialized = BlackBoxResource(resource).serialize
- BlackBoxSource.parse(serialized) match {
- case Some(BlackBoxResource(id)) =>
- id should be (resource)
- Succeeded
- case _ => Failed
- }
- }
- "should fail on unsupported kinds" in {
- intercept[FIRRTLException] {
- BlackBoxSourceAnnotation(modName, "bad value")
- }
- BlackBoxSourceAnnotation(modName, BlackBoxResource(resource).serialize).isInstanceOf[Annotation] should be(true)
- }
- }
-}
-
class BlacklBoxSourceHelperTransformSpec extends LowTransformSpec {
def transform: Transform = new BlackBoxSourceHelper
@@ -79,8 +52,8 @@ class BlacklBoxSourceHelperTransformSpec extends LowTransformSpec {
"annotated external modules" should "appear in output directory" in {
val annos = Seq(
- Annotation(moduleName, classOf[BlackBoxSourceHelper], BlackBoxTargetDir("test_run_dir").serialize),
- Annotation(moduleName, classOf[BlackBoxSourceHelper], BlackBoxResource("/blackboxes/AdderExtModule.v").serialize)
+ BlackBoxTargetDirAnno("test_run_dir"),
+ BlackBoxResourceAnno(moduleName, "/blackboxes/AdderExtModule.v")
)
execute(input, output, annos)
diff --git a/src/test/scala/firrtlTests/transforms/DedupTests.scala b/src/test/scala/firrtlTests/transforms/DedupTests.scala
index 74c4b4e7..e88bd506 100644
--- a/src/test/scala/firrtlTests/transforms/DedupTests.scala
+++ b/src/test/scala/firrtlTests/transforms/DedupTests.scala
@@ -8,7 +8,7 @@ import org.scalatest.Matchers
import org.scalatest.junit.JUnitRunner
import firrtl.ir.Circuit
-import firrtl.{Parser, AnnotationMap}
+import firrtl.Parser
import firrtl.passes.PassExceptions
import firrtl.annotations.{
Named,