1
0

Async covers (#1085)

* cover: support covering cross-product of ready-valid

* tilelink: AsyncCrossing now has covers for all flow control logic
This commit is contained in:
Wesley W. Terpstra
2017-11-01 11:03:45 -07:00
committed by GitHub
parent 9e77045213
commit 4ccdbecb63
2 changed files with 18 additions and 1 deletions

View File

@ -4,6 +4,7 @@ package freechips.rocketchip.util.property
import Chisel._
import chisel3.internal.sourceinfo.{SourceInfo, SourceLine}
import chisel3.util.{ReadyValidIO}
import freechips.rocketchip.config.{Field, Parameters}
case object PropertyLibrary extends Field[BasePropertyLibrary](new DefaultPropertyLibrary)
@ -54,5 +55,10 @@ object cover {
def apply(cond: Bool, label: String, message: String)(implicit sourceInfo: SourceInfo, p: Parameters): Unit = {
p(PropertyLibrary).generateProperty(CoverPropertyParameters(cond, label, message))
}
def apply[T <: Data](rv: ReadyValidIO[T], label: String, message: String)(implicit sourceInfo: SourceInfo, p: Parameters): Unit = {
apply( rv.valid && rv.ready, label + "_FIRE", message + ": valid and ready")
apply( rv.valid && !rv.ready, label + "_STALL", message + ": valid and not ready")
apply(!rv.valid && rv.ready, label + "_IDLE", message + ": not valid and ready")
apply(!rv.valid && !rv.ready, label + "_FULL", message + ": not valid and not ready")
}
}