summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/experimental/hierarchy/IsInstantiable.scala
blob: 27e06d926f95faabb0b2ee99a2a58ea3fd7ea346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: Apache-2.0

package chisel3.experimental.hierarchy

/** While this is public, it is not recommended for users to extend directly.
  * Instead, use the [[@instantiable]] annotation on your trait or class.
  *
  * This trait indicates whether a class can be returned from an Instance.
  */
trait IsInstantiable

object IsInstantiable {
  implicit class IsInstantiableExtensions[T <: IsInstantiable](i: T) {
    def toInstance: Instance[T] = new Instance(Proto(i))
  }
}