diff options
| author | Andrew Waterman | 2016-09-21 16:16:25 -0700 |
|---|---|---|
| committer | GitHub | 2016-09-21 16:16:25 -0700 |
| commit | b18e98ba2d058c7dd24f96f005486b70c856aeca (patch) | |
| tree | 568c644051035a81f17f6a8e70938ff55ee21cb7 /src/test/scala/chiselTests/Clock.scala | |
| parent | a2cb95bfe9e9c30b73284e97048fa0187ab0ee1d (diff) | |
Expose FIRRTL asClock construct
Additionally, fix Clock.asUInt (previously, it threw an esoteric exception), and add a simple test of both.
Diffstat (limited to 'src/test/scala/chiselTests/Clock.scala')
| -rw-r--r-- | src/test/scala/chiselTests/Clock.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/Clock.scala b/src/test/scala/chiselTests/Clock.scala new file mode 100644 index 00000000..79dd2de4 --- /dev/null +++ b/src/test/scala/chiselTests/Clock.scala @@ -0,0 +1,22 @@ +// See LICENSE for license details. + +package chiselTests + +import org.scalatest._ +import org.scalatest.prop._ + +import chisel3._ +import chisel3.testers.BasicTester +import chisel3.util._ + +class ClockAsUIntTester extends BasicTester { + assert(Bool(true).asClock.asUInt === UInt(1)) + stop() +} + + +class ClockSpec extends ChiselPropSpec { + property("Bool.asClock.asUInt should pass a signal through unaltered") { + assertTesterPasses { new ClockAsUIntTester } + } +} |
