diff options
| author | Jim Lawson | 2016-08-04 13:40:35 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-08-04 13:40:35 -0700 |
| commit | 8e24085e112d595cfaf2dc7d54bce974498521d5 (patch) | |
| tree | f7bc26ed8170ef598e2842a21c7dd368bd400b96 /chiselFrontend | |
| parent | aea135de2a68393ed57d4b01d3debb9003b3634a (diff) | |
Deal with directions on Clocks.
Diffstat (limited to 'chiselFrontend')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Data.scala | 8 |
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. |
