diff options
| author | Jim Lawson | 2016-10-05 15:54:19 -0700 |
|---|---|---|
| committer | GitHub | 2016-10-05 15:54:19 -0700 |
| commit | 0878b7a7d30038797e3711ad2d44ab0bc753bab1 (patch) | |
| tree | 9d155b3f7bbc02421b1b50d52cbbf8c23f7eafab /chiselFrontend/src/main/scala/chisel3/core/Data.scala | |
| parent | c7ce06493300cf7ffa89ef472cd6a7086443c16f (diff) | |
| parent | b2373ebda5e63fa850de21585307013f8419320a (diff) | |
Merge pull request #316 from ucb-bar/deprecation-warnings
Make asInput/asOutput/flip deprecation warnings dynamic
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Data.scala | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 3f21a34c..922b33a9 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -104,12 +104,21 @@ object Data { } implicit class AddDirectionToData[T<:Data](val target: T) extends AnyVal { - @deprecated("Input(Data) should be used over Data.asInput", "gchisel") - def asInput: T = Input(target) - @deprecated("Output(Data) should be used over Data.asOutput", "gchisel") - def asOutput: T = Output(target) - @deprecated("Flipped(Data) should be used over Data.flip", "gchisel") - def flip(): T = Flipped(target) + def asInput(implicit opts: CompileOptions): T = { + if (opts.deprecateOldDirectionMethods) + Builder.deprecated("Input(Data) should be used over Data.asInput") + Input(target) + } + def asOutput(implicit opts: CompileOptions): T = { + if (opts.deprecateOldDirectionMethods) + Builder.deprecated("Output(Data) should be used over Data.asOutput") + Output(target) + } + def flip()(implicit opts: CompileOptions): T = { + if (opts.deprecateOldDirectionMethods) + Builder.deprecated("Flipped(Data) should be used over Data.flip") + Flipped(target) + } } } |
