summaryrefslogtreecommitdiff
path: root/chiselFrontend
diff options
context:
space:
mode:
authorJim Lawson2016-08-04 13:40:35 -0700
committerJim Lawson2016-08-04 13:40:35 -0700
commit8e24085e112d595cfaf2dc7d54bce974498521d5 (patch)
treef7bc26ed8170ef598e2842a21c7dd368bd400b96 /chiselFrontend
parentaea135de2a68393ed57d4b01d3debb9003b3634a (diff)
Deal with directions on Clocks.
Diffstat (limited to 'chiselFrontend')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Data.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala
index 8c874070..9115d1ba 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala
@@ -227,6 +227,14 @@ object Wire {
object Clock {
def apply(): Clock = new Clock
+ def apply(dir: Direction): Clock = {
+ val result = apply()
+ dir match {
+ case Direction.Input => Input(result)
+ case Direction.Output => Output(result)
+ case Direction.Unspecified => result
+ }
+ }
}
// TODO: Document this.