summaryrefslogtreecommitdiff
path: root/docs/src/explanations/printing.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src/explanations/printing.md')
-rw-r--r--docs/src/explanations/printing.md14
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/src/explanations/printing.md b/docs/src/explanations/printing.md
index 71a6f5cf..80e9ec70 100644
--- a/docs/src/explanations/printing.md
+++ b/docs/src/explanations/printing.md
@@ -13,11 +13,23 @@ Chisel provides the `printf` function for debugging purposes. It comes in two fl
### Scala-style
-Chisel also supports printf in a style similar to [Scala's String Interpolation](http://docs.scala-lang.org/overviews/core/string-interpolation.html). Chisel provides a custom string interpolator `cf` which follows C-style format specifiers (see section [C-style](#c-style) below). Here's a few examples of using the `cf` interpolator:
+Chisel also supports printf in a style similar to [Scala's String Interpolation](http://docs.scala-lang.org/overviews/core/string-interpolation.html). Chisel provides a custom string interpolator `cf` which follows C-style format specifiers (see section [C-style](#c-style) below).
+
+Note that the Scala s-interpolator is not supported in Chisel constructs and will issue a compile-time warning:
```scala mdoc:invisible
import chisel3._
```
+
+```scala mdoc:warn
+class MyModule extends Module {
+ val in = IO(Input(UInt(8.W)))
+ printf(s"in = $in\n")
+}
+```
+
+Instead, use Chisel's `cf` interpolator as in the following examples:
+
```scala mdoc:compile-only
val myUInt = 33.U
printf(cf"myUInt = $myUInt") // myUInt = 33