Printable

chisel3.Printable
See thePrintable companion object
sealed abstract class Printable

Superclass of things that can be printed in the resulting circuit

Usually created using the custom string interpolator p"...". Printable string interpolation is similar to String interpolation in Scala For example:

 printf(p"The value of wire = $wire\n")

This is equivalent to writing:

 printf("The value of wire = %d\n", wire)

All Chisel data types have a method .toPrintable that gives a default pretty print that can be accessed via p"...". This works even for aggregate types, for example:

 val myVec = VecInit(5.U, 10.U, 13.U)
 printf(p"myVec = $myVec\n")
 // myVec = Vec(5, 10, 13)

 val myBundle = Wire(new Bundle {
   val foo = UInt()
   val bar = UInt()
 })
 myBundle.foo := 3.U
 myBundle.bar := 11.U
 printf(p"myBundle = $myBundle\n")
 // myBundle = Bundle(a -> 3, b -> 11)

Users can override the default behavior of .toPrintable in custom Bundle and Record types.

Attributes

Companion
object
Source
Printable.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FirrtlFormat
class Binary
class Character
class Decimal
class Hexadecimal
class FullName
class Name
class PString
object Percent
class Printables
Show all

Members list

Value members

Abstract methods

def unpack: (String, Seq[Data])

Unpack into format String and a List of Data arguments

Unpack into format String and a List of Data arguments

Attributes

Source
Printable.scala

Concrete methods

def +(that: Printable): Printables

Allow for appending Printables like Strings

Allow for appending Printables like Strings

Attributes

Source
Printable.scala
final def +(that: String): Printables

Allow for appending Strings to Printables

Allow for appending Strings to Printables

Attributes

Source
Printable.scala
Implicitly added by Extensions

Build a new Printable by applying a function to all sub-Printables

Build a new Printable by applying a function to all sub-Printables

Attributes

Note

This is an extension method instead of normal method to avoid conflicts with the implicit conversion from String to Printable

Source
Printable.scala

Deprecated methods

def unpack(ctx: Component)(implicit info: SourceInfo): (String, Iterable[String])

Unpack into format String and a List of String arguments (identifiers)

Unpack into format String and a List of String arguments (identifiers)

Attributes

Note

This must be called after elaboration when Chisel nodes actually have names

Deprecated
[Since version Chisel 7.0.0] Use unpack with no arguments instead.
Source
Printable.scala
def unpackArgs: Seq[Bits]

Unpack into a Seq of captured Bits arguments

Unpack into a Seq of captured Bits arguments

Attributes

Deprecated
[Since version Chisel 7.0.0] Use unpack with no arguments instead.
Source
Printable.scala