chisel icon indicating copy to clipboard operation
chisel copied to clipboard

Verification Statements do not support Printable

Open ekiwi opened this issue 4 years ago • 1 comments

Type of issue: feature request

Impact: API addition (no impact on existing code)

Currently the Verification Statements (i.e. assert and assume) can take additional arguments that will result in a message being printed when the condition is violated. However, it only supports the "C"-style printing, i.e.: assert(a, "a=%d", a). In addition it would be nice if it also supported the Scala/Python style of printing like printf already does, i.e. assert(a, p"a=$a").

ekiwi avatar Jan 13 '22 19:01 ekiwi

Agreed, it would also be nice to have Printable support format strings like the Scala f interpolator: https://docs.scala-lang.org/overviews/core/string-interpolation.html.

Maybe pf"a=0x$a%x" rather than the current (horrible) p"a=0x${Hexadecimal(a)}"

jackkoenig avatar Jan 13 '22 19:01 jackkoenig