merge master

This commit is contained in:
joey0320
2023-03-01 10:48:20 -08:00
4 changed files with 5 additions and 56 deletions

View File

@@ -14,7 +14,7 @@ class ExtraLowTransforms extends Transform with DependencyAPIMigration {
// this PropagatePresetAnnotations is needed to run the RemoveValidIf pass (that is removed from CIRCT).
// additionally, since that pass isn't explicitly a prereq of the LowFormEmitter it
// needs to wrapped in this xform
override def prerequisites: Seq[TransformDependency] = Forms.LowForm :+
override def prerequisites: Seq[TransformDependency] = Forms.LowForm :+
Dependency[firrtl.transforms.PropagatePresetAnnotations]
override def optionalPrerequisites: Seq[TransformDependency] = Forms.LowFormOptimized
override def optionalPrerequisiteOf: Seq[TransformDependency] = Forms.LowEmitters

View File

@@ -1,50 +0,0 @@
// See LICENSE for license details.
package barstools.tapeout.transforms
import chisel3._
import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}
import firrtl.{EmittedFirrtlCircuitAnnotation, EmittedFirrtlModuleAnnotation}
import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers
class ExampleModuleNeedsResetInverted extends Module with ResetInverter {
val io = IO(new Bundle {
val out = Output(UInt(32.W))
})
val r = RegInit(0.U)
io.out := r
invert(this)
}
class ResetNSpec extends AnyFreeSpec with Matchers {
"Inverting reset needs to be done throughout module in Chirrtl" in {
val chirrtl = (new ChiselStage)
.emitChirrtl(new ExampleModuleNeedsResetInverted, Array("--target-dir", "test_run_dir/reset_n_spec"))
chirrtl should include("input reset :")
(chirrtl should not).include("input reset_n :")
(chirrtl should not).include("node reset = not(reset_n)")
}
"Inverting reset needs to be done throughout module when generating firrtl" in {
// generate low-firrtl
val firrtl = (new ChiselStage)
.execute(
Array("-X", "low", "--target-dir", "test_run_dir/reset_inverting_spec"),
Seq(ChiselGeneratorAnnotation(() => new ExampleModuleNeedsResetInverted))
)
.collect {
case EmittedFirrtlCircuitAnnotation(a) => a
case EmittedFirrtlModuleAnnotation(a) => a
}
.map(_.value)
.mkString("")
firrtl should include("input reset_n :")
firrtl should include("node reset = not(reset_n)")
(firrtl should not).include("input reset :")
}
}