implicit final class PrintableHelper extends AnyVal
- Alphabetic
- By Inheritance
- PrintableHelper
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PrintableHelper(sc: StringContext)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def cf(args: Any*): Printable
Custom string interpolator for generating formatted Printables : cf"..."
Custom string interpolator for generating formatted Printables : cf"..."
Enhanced version of scala's
f
interpolator. Each expression (argument) referenced within the string is converted to a particular Printable depending on the format specifier and type.For Chisel types referenced within the String
%n
- Returns Name Printable.%N
- Returns FullName Printable.%b,%d,%x,%c
- Only applicable for types of Bits or dreived from it. - returns (Binary,Decimal, Hexadecimal,Character) Printable respectively.- Default - If no specifier given call Data.toPrintable on the Chisel Type.
For Printable type:
No explicit format specifier supported - just return the Printable.
For regular scala types
Call String.format with the argument and specifier. Default is %s if no specifier is given. Wrap the result in PString Printable.
For the parts of the StringContext
Remove format specifiers and if literal percents (need to be escaped with %) are present convert them into Percent Printable. Rest of the string will be wrapped in PString Printable.
val w1 = 20.U // Chisel UInt type (which extends Bits) val f1 = 30.2 // Scala float type. val pable = cf"w1 = $w1%x f1 = $f1%2.2f. This is 100%% clear" // pable is as follows // Printables(List(PString(w1 = ), Hexadecimal(UInt<5>(20)), PString( f1 = ), PString(30.20), PString(. This is 100), Percent, PString( clear)))
- Exceptions thrown
IllegalArgumentException
if the number ofparts
in the enclosingStringContext
does not exceed the number of argumentsarg
by exactly 1.StringContext.InvalidEscapeException
if aparts
string contains a backslash (\
) character that does not start a valid escape sequence.UnknownFormatConversionException
if literal percent not escaped with % or if the format specifier is not supported for the specific type
Example: - def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def p(args: Any*): Printable
Custom string interpolator for generating Printables: p"..." mimicks s"..." for non-Printable data)
- val sc: StringContext
- def toString(): String
- Definition Classes
- Any
This is the documentation for Chisel.
Package structure
The chisel3 package presents the public API of Chisel. It contains the concrete core types
UInt
,SInt
,Bool
,FixedPoint
,Clock
, andReg
, the abstract typesBits
,Aggregate
, andData
, and the aggregate typesBundle
andVec
.The Chisel package is a compatibility layer that attempts to provide chisel2 compatibility in chisel3.
Utility objects and methods are found in the
util
package.The
testers
package defines the basic interface for chisel testers.