diff options
| author | Jack Koenig | 2020-08-12 21:17:14 -0700 |
|---|---|---|
| committer | GitHub | 2020-08-13 04:17:14 +0000 |
| commit | 39f510a9081d09d94d56eb89ceb97a678993fda1 (patch) | |
| tree | 02dcadb37c768d5763f6eae87b84b5aeeead6df1 /src/main/scala/firrtl/annotations/AnnotationYamlProtocol.scala | |
| parent | e1d3a0c64a48b4c9999ad59f15922db7c155c361 (diff) | |
Remove LegacyAnnotation and [most] MoultingYaml (#1833)
* Remove LegacyAnnotation and MoultingYaml
It has been deprecated since 1.1
* Remove all uses of ConvertLegacyAnnotations
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/scala/firrtl/annotations/AnnotationYamlProtocol.scala')
| -rw-r--r-- | src/main/scala/firrtl/annotations/AnnotationYamlProtocol.scala | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/main/scala/firrtl/annotations/AnnotationYamlProtocol.scala b/src/main/scala/firrtl/annotations/AnnotationYamlProtocol.scala deleted file mode 100644 index 4bb643b3..00000000 --- a/src/main/scala/firrtl/annotations/AnnotationYamlProtocol.scala +++ /dev/null @@ -1,45 +0,0 @@ -// See LICENSE for license details. - -package firrtl -package annotations - -import net.jcazevedo.moultingyaml._ - -object AnnotationYamlProtocol extends DefaultYamlProtocol { - // bottom depends on top - implicit object AnnotationYamlFormat extends YamlFormat[LegacyAnnotation] { - def write(a: LegacyAnnotation) = YamlObject( - YamlString("targetString") -> YamlString(a.targetString), - YamlString("transformClass") -> YamlString(a.transformClass), - YamlString("value") -> YamlString(a.value) - ) - - def read(yamlValue: YamlValue): LegacyAnnotation = { - try { - yamlValue.asYamlObject.getFields( - YamlString("targetString"), - YamlString("transformClass"), - YamlString("value")) match { - case Seq(YamlString(targetString), YamlString(transformClass), YamlString(value)) => - LegacyAnnotation(toTarget(targetString), - Class.forName(transformClass).asInstanceOf[Class[_ <: Transform]], - value) - case _ => deserializationError("LegacyAnnotation expected") - } - } - catch { - case annotationException: AnnotationException => - Utils.error( - s"Error: ${annotationException.getMessage} while parsing annotation from yaml\n${yamlValue.prettyPrint}") - } - } - def toTarget(string: String): Named = string.split("""\.""", -1).toSeq match { - case Seq(c) => CircuitName(c) - case Seq(c, m) => ModuleName(m, CircuitName(c)) - case Nil => Utils.error("BAD") - case s => - val componentString = s.drop(2).mkString(".") - ComponentName(componentString, ModuleName(s.tail.head, CircuitName(s.head))) - } - } -} |
