summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Printf.scala
diff options
context:
space:
mode:
authorJack Koenig2016-09-07 14:18:29 -0700
committerGitHub2016-09-07 14:18:29 -0700
commit0ed5eb48cdb916b644aaf9e5dbf48f6cfb6c60f4 (patch)
tree71829e27aa3c57e682c8231c27027b3efbd2918d /src/test/scala/chiselTests/Printf.scala
parent16426b3a68d85ce7dd9655b0ce773431eb69fc74 (diff)
Add Printable (#270)
Printable is a new type that changes how printing of Chisel types is represented It uses an ordered collection rather than a format string and specifiers Features: - Custom String Interpolator for Scala-like printf - String-like manipulation of "hardware strings" for custom pretty-printing - Default pretty-printing for Chisel data types
Diffstat (limited to 'src/test/scala/chiselTests/Printf.scala')
-rw-r--r--src/test/scala/chiselTests/Printf.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/Printf.scala b/src/test/scala/chiselTests/Printf.scala
index c872fde4..28b6132b 100644
--- a/src/test/scala/chiselTests/Printf.scala
+++ b/src/test/scala/chiselTests/Printf.scala
@@ -4,6 +4,7 @@ package chiselTests
import org.scalatest._
import chisel3._
+import chisel3.util._
import chisel3.testers.BasicTester
class SinglePrintfTester() extends BasicTester {
@@ -24,6 +25,11 @@ class MultiPrintfTester() extends BasicTester {
stop()
}
+class ASCIIPrintableTester extends BasicTester {
+ printf(PString((0x20 to 0x7e) map (_.toChar) mkString ""))
+ stop()
+}
+
class PrintfSpec extends ChiselFlatSpec {
"A printf with a single argument" should "run" in {
assertTesterPasses { new SinglePrintfTester }
@@ -34,4 +40,7 @@ class PrintfSpec extends ChiselFlatSpec {
"A printf with ASCII characters 1-127" should "run" in {
assertTesterPasses { new ASCIIPrintfTester }
}
+ "A printf with Printable ASCII characters 1-127" should "run" in {
+ assertTesterPasses { new ASCIIPrintableTester }
+ }
}