Debug.scala 327 字节
Newer Older
L
LinJiawei 已提交
1
package utils
Z
Zihao Yu 已提交
2 3

import chisel3._
L
LinJiawei 已提交
4 5 6
import chisel3.util._

import noop.NOOPConfig
Z
Zihao Yu 已提交
7 8

object Debug {
L
LinJiawei 已提交
9 10
  def apply(flag: Boolean = NOOPConfig().EnableDebug, cond: Bool = true.B)(body: => Unit): Any =
    if (flag) { when (cond && GTimer() > 100.U) { body } }
Z
Zihao Yu 已提交
11
}
12 13 14

object ShowType {
  def apply[T: Manifest](t: T) = println(manifest[T])
Z
Zihao Yu 已提交
15
}