SimLog

chisel3.SimLog
See theSimLog companion object
sealed trait SimLog

A file or I/O device to print to in simulation

val log = SimLog.file("logfile.log")
log.printf(cf"in = $in%0d\n")

val stderr = SimLog.StdErr
stderr.printf(cf"in = $in%0d\n")

// SimLog filenames themselves can be Printable.
// Be careful to avoid uninitialized registers.
val idx = Wire(UInt(8.W))
val log2 = SimLog.file(cf"logfile_$idx%0d.log")
log2.printf(cf"in = $in%0d\n")

Attributes

Companion
object
Source
SimLog.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def flush()(implicit sourceInfo: SourceInfo): Unit

Flush any buffered output immediately

Flush any buffered output immediately

Attributes

Source
SimLog.scala
def printf(pable: Printable)(implicit sourceInfo: SourceInfo): Printf

Prints a message in simulation

Prints a message in simulation

Prints a message every cycle. If defined within the scope of a when block, the message will only be printed on cycles that the when condition is true.

Does not fire when in reset (defined as the encapsulating Module's reset). If your definition of reset is not the encapsulating Module's reset, you will need to gate this externally.

May be called outside of a Module (like defined in a function), uses the current default clock and reset. These can be overriden with withClockAndReset.

Value parameters

pable

Printable to print

Attributes

See also

Printable documentation

Source
SimLog.scala