Fix for firrtl issue 459, reworking annotation API

This commit is contained in:
Adam Izraelevitz
2017-02-23 13:41:17 -08:00
parent f1c437f830
commit e8dc1035bf
6 changed files with 7 additions and 7 deletions

View File

@@ -31,6 +31,6 @@ class ConvertToExtMod(classify: (Module) => Boolean) extends Transform with Pass
def passSeq = Seq(new ConvertToExtModPass(classify))
def execute(state: CircuitState): CircuitState = {
CircuitState(runPasses(state.circuit), state.form)
state.copy(circuit = runPasses(state.circuit))
}
}

View File

@@ -27,6 +27,6 @@ class EnumerateModules(enumerate: (Module) => Unit) extends Transform with PassB
def passSeq = Seq(new EnumerateModulesPass(enumerate))
def execute(state: CircuitState): CircuitState = {
CircuitState(runPasses(state.circuit), state.form)
state.copy(circuit = runPasses(state.circuit))
}
}

View File

@@ -21,6 +21,6 @@ class ReParentCircuit(newTopName: String) extends Transform with PassBased {
def passSeq = Seq(new ReParentCircuitPass(newTopName))
def execute(state: CircuitState): CircuitState = {
CircuitState(runPasses(state.circuit), state.form)
state.copy(circuit = runPasses(state.circuit))
}
}

View File

@@ -54,6 +54,6 @@ class RemoveUnusedModules extends Transform with PassBased {
def passSeq = Seq(new RemoveUnusedModulesPass)
def execute(state: CircuitState): CircuitState = {
CircuitState(runPasses(state.circuit), state.form)
state.copy(circuit = runPasses(state.circuit))
}
}

View File

@@ -37,6 +37,6 @@ class RenameModulesAndInstances(rename: (String) => String) extends Transform wi
def passSeq = Seq(new RenameModulesAndInstancesPass(rename))
def execute(state: CircuitState): CircuitState = {
CircuitState(runPasses(state.circuit), state.form)
state.copy(circuit = runPasses(state.circuit))
}
}

View File

@@ -48,9 +48,9 @@ class ResetInverterTransform extends Transform {
override def execute(state: CircuitState): CircuitState = {
getMyAnnotations(state) match {
case Nil => CircuitState(state.circuit, LowForm)
case Nil => state
case Seq(ResetInverterAnnotation(ModuleName(state.circuit.main, CircuitName(_)))) =>
CircuitState(ResetN.run(state.circuit), LowForm)
state.copy(circuit = ResetN.run(state.circuit))
case annotations =>
throw new Exception(s"There should be only one InvertReset annotation: got ${annotations.mkString(" -- ")}")
}