aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/Driver.scala
diff options
context:
space:
mode:
authorChick Markley2017-01-31 09:25:32 -0800
committerGitHub2017-01-31 09:25:32 -0800
commit568f25b221884eeb0db362c902c933f734c7e47e (patch)
tree5c0974d82d494a44deb47e2cec8e8550f4dbe3e3 /src/main/scala/firrtl/Driver.scala
parentbb389aa69f0b6a99c3daecbf02e4df1e303ec636 (diff)
Blackboxhelper (#418)
* First pass at implementing a annotation based mechanism to move black box verilator files into the target directory * A little bit of style cleanup * A little bit of style cleanup * Fix the driver, wasn't appending targetDir properly Add some docs * test had wrong value now that targetdir is added to annnos * Now saves a list of all black box verilog files moved into target directory. Then creates a file black_box_verilog_files.f that contains this list with -v prepended to each line * Made black box source helper be low to low form Added it to the verilog compiler transforms Added a test to make sure it got there * targetDir annotation is targeted to a CircuitName("All")
Diffstat (limited to 'src/main/scala/firrtl/Driver.scala')
-rw-r--r--src/main/scala/firrtl/Driver.scala19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/Driver.scala b/src/main/scala/firrtl/Driver.scala
index 75a87789..238906c8 100644
--- a/src/main/scala/firrtl/Driver.scala
+++ b/src/main/scala/firrtl/Driver.scala
@@ -5,11 +5,13 @@ package firrtl
import scala.collection._
import scala.io.Source
import java.io.{File, FileNotFoundException}
+
import net.jcazevedo.moultingyaml._
import logger.Logger
-import Parser.{InfoMode, IgnoreInfo}
+import Parser.{IgnoreInfo, InfoMode}
import annotations._
import firrtl.annotations.AnnotationYamlProtocol._
+import firrtl.transforms.{BlackBoxSourceHelper, BlackBoxTargetDir}
/**
@@ -90,7 +92,20 @@ object Driver {
val annotationFile = new File(annotationFileName)
if (annotationFile.exists) {
val annotationsYaml = io.Source.fromFile(annotationFile).getLines().mkString("\n").parseYaml
- val annotationArray = annotationsYaml.convertTo[Array[Annotation]]
+ val annotationArray = {
+ val annos = annotationsYaml.convertTo[Array[Annotation]]
+
+ if (annos.nonEmpty) {
+ annos ++ List(Annotation(
+ CircuitName("All"),
+ classOf[BlackBoxSourceHelper],
+ BlackBoxTargetDir(optionsManager.targetDirName).serialize
+ ))
+ }
+ else {
+ annos
+ }
+ }
optionsManager.firrtlOptions = firrtlConfig.copy(annotations = firrtlConfig.annotations ++ annotationArray)
}
}