Unverified Commit 97fde23f authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Add formatted Printable interpolator `cf` (#2528) (#2553)

This is a formatted version of the p"..." interpolator analogous to
Scala's f"..." interpolator. The primary difference is that it supports
formatting interpolated variables by following the variable with
"%<specifier>". For example:

printf(cf"myWire = $myWire%x\n")

This will format the hardware value "myWire" as a hexidecimal value in
the emitted Verilog. Note that literal "%" must be escaped as "%%".

Scala types and format specifiers are supported and are handled in the
same manner as in standard Scala f"..." interpolators.

(cherry picked from commit 037f7b2f

)

Co-authored-by: default avatarGirish Pai <girish.pai@sifive.com>
parent 0c811b49
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment