1
0
Fork 0

generator: create annotation file

This commit is contained in:
Wesley W. Terpstra 2017-10-10 23:23:06 -07:00
parent 75345b6048
commit 5d62c321f4
4 changed files with 12 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import freechips.rocketchip.util.GeneratorApp
object Generator extends GeneratorApp {
val longName = names.topModuleProject + "." + names.configs
generateFirrtl
generateAnno
generateTestSuiteMakefrags // TODO: Needed only for legacy make targets
generateArtefacts
}

View File

@ -87,6 +87,7 @@ object Generator extends GeneratorApp {
val longName = names.topModuleProject + "." + names.configs
generateFirrtl
generateAnno
generateTestSuiteMakefrags
generateROMs
generateArtefacts

View File

@ -5,6 +5,7 @@ package freechips.rocketchip.unittest
object Generator extends freechips.rocketchip.util.GeneratorApp {
val longName = names.topModuleProject + "." + names.configs
generateFirrtl
generateAnno
generateTestSuiteMakefrags // TODO: Needed only for legacy make targets
generateArtefacts
}

View File

@ -10,6 +10,8 @@ import freechips.rocketchip.system.{TestGeneration, DefaultTestSuites}
import freechips.rocketchip.config._
import freechips.rocketchip.diplomacy.LazyModule
import java.io.{File, FileWriter}
import net.jcazevedo.moultingyaml._
import firrtl.annotations.AnnotationYamlProtocol._
/** Representation of the information this Generator needs to collect from external sources. */
case class ParsedInputNames(
@ -106,6 +108,13 @@ trait GeneratorApp extends App with HasGeneratorUtilities {
Driver.dumpFirrtl(circuit, Some(new File(td, s"$longName.fir"))) // FIRRTL
}
def generateAnno {
val annotationFile = new File(td, s"$longName.anno")
val af = new FileWriter(annotationFile)
af.write(circuit.annotations.toArray.toYaml.prettyPrint)
af.close()
}
/** Output software test Makefrags, which provide targets for integration testing. */
def generateTestSuiteMakefrags {
addTestSuites