Skip to content

Commit

Permalink
Update in light of annotations refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
ucbjrl committed Mar 1, 2018
1 parent bf59b6a commit 7c7eaf1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
5 changes: 2 additions & 3 deletions src/main/scala/chisel3/iotesters/ChiselMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@ object chiselMain {
(new firrtl.LowFirrtlEmitter).emit(firrtl.CircuitState(chirrtl, firrtl.ChirrtlForm), writer)
writer.close()
case _ if context.isGenVerilog =>
val annotations = firrtl.AnnotationMap(Seq(
firrtl.passes.memlib.InferReadWriteAnnotation(name)))
val annotations = Seq(firrtl.passes.memlib.InferReadWriteAnnotation)
val writer = new FileWriter(verilogFile)
val compileResult = (new firrtl.VerilogCompiler).compileAndEmit(
firrtl.CircuitState(chirrtl, firrtl.ChirrtlForm, Some(annotations)),
firrtl.CircuitState(chirrtl, firrtl.ChirrtlForm, annotations),
List(new firrtl.passes.memlib.InferReadWrite)
)
writer.write(compileResult.getEmittedCircuit.value)
Expand Down
10 changes: 5 additions & 5 deletions src/main/scala/chisel3/iotesters/VCSBackend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import chisel3.core.{ActualDirection, DataMirror}
import chisel3.{ChiselExecutionFailure, ChiselExecutionSuccess}
import firrtl.{ChirrtlForm, CircuitState}
import firrtl.annotations.CircuitName
import firrtl.transforms.{BlackBoxSourceHelper, BlackBoxTargetDir}
import firrtl.transforms.{BlackBoxSourceHelper, BlackBoxTargetDirAnno}

/**
* Copies the necessary header files used for verilator compilation to the specified destination folder
Expand Down Expand Up @@ -136,13 +136,13 @@ private[iotesters] object setupVCSBackend {
The following block adds an annotation that tells the black box helper where the
current build directory is, so that it can copy verilog resource files into the right place
*/
val annotationMap = firrtl.AnnotationMap(optionsManager.firrtlOptions.annotations ++ List(
val annotations = optionsManager.firrtlOptions.annotations ++ List(
firrtl.annotations.Annotation(
CircuitName(circuit.name),
classOf[BlackBoxSourceHelper],
BlackBoxTargetDir(optionsManager.targetDirName).serialize
BlackBoxTargetDirAnno(optionsManager.targetDirName).serialize
)
))
)

val transforms = optionsManager.firrtlOptions.customTransforms

Expand All @@ -151,7 +151,7 @@ private[iotesters] object setupVCSBackend {
val verilogWriter = new FileWriter(verilogFile)

val compileResult = (new firrtl.VerilogCompiler).compileAndEmit(
CircuitState(chirrtl, ChirrtlForm, Some(annotationMap)),
CircuitState(chirrtl, ChirrtlForm, annotations),
customTransforms = transforms
)
val compiledStuff = compileResult.getEmittedCircuit
Expand Down
10 changes: 5 additions & 5 deletions src/main/scala/chisel3/iotesters/VerilatorBackend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ private[iotesters] object setupVerilatorBackend {
The following block adds an annotation that tells the black box helper where the
current build directory is, so that it can copy verilog resource files into the right place
*/
val annotationMap = firrtl.AnnotationMap(optionsManager.firrtlOptions.annotations ++ List(
val annotations = optionsManager.firrtlOptions.annotations ++ List(
firrtl.annotations.Annotation(
CircuitName(circuit.name),
classOf[BlackBoxSourceHelper],
BlackBoxTargetDir(optionsManager.targetDirName).serialize
BlackBoxTargetDirAnno(optionsManager.targetDirName).serialize
)
))
)

val transforms = optionsManager.firrtlOptions.customTransforms

Expand All @@ -232,7 +232,7 @@ private[iotesters] object setupVerilatorBackend {
val verilogWriter = new FileWriter(verilogFile)

val compileResult = (new firrtl.VerilogCompiler).compileAndEmit(
CircuitState(chirrtl, ChirrtlForm, Some(annotationMap)),
CircuitState(chirrtl, ChirrtlForm, annotations),
customTransforms = transforms
)
val compiledStuff = compileResult.getEmittedCircuit
Expand All @@ -245,7 +245,7 @@ private[iotesters] object setupVerilatorBackend {
val cppHarnessWriter = new FileWriter(cppHarnessFile)
val vcdFile = new File(dir, s"${circuit.name}.vcd")
val emittedStuff = VerilatorCppHarnessGenerator.codeGen(
dut, CircuitState(chirrtl, ChirrtlForm, Some(annotationMap)), vcdFile.toString
dut, CircuitState(chirrtl, ChirrtlForm, annotations), vcdFile.toString
)
cppHarnessWriter.append(emittedStuff)
cppHarnessWriter.close()
Expand Down

0 comments on commit 7c7eaf1

Please sign in to comment.