Packages

sealed class DataView[T, V <: Data] extends AnyRef

Mapping between a target type T and a view type V

Enables calling .viewAs[T] on instances of the target type.

Detailed documentation

T

Target type (must have an implementation of DataProduct)

V

View type

Annotations
@implicitNotFound()
Source
DataView.scala
Example:
  1. class Foo(val w: Int) extends Bundle {
      val a = UInt(w.W)
    }
    class Bar(val w: Int) extends Bundle {
      val b = UInt(w.W)
    }
    // DataViews are created using factory methods in the companion object
    implicit val view = DataView[Foo, Bar](
      // The first argument is a function constructing a Foo from a Bar
      foo => new Bar(foo.w)
      // The remaining arguments are a variable number of field pairings
      _.a -> _.b
    )
See also

object DataView for factory methods

object PartialDataView for defining non-total DataViews

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DataView
  2. AnyRef
  3. Any
Implicitly
  1. by InvertibleDataView
  2. by DataViewable
  3. by any2stringadd
  4. by StringFormat
  5. by Ensuring
  6. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toany2stringadd[DataView[T, V]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (DataView[T, V], B)
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toArrowAssoc[DataView[T, V]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def andThen[V2 <: Data](g: DataView[V, V2])(implicit sourceInfo: SourceInfo): DataView[T, V2]

    Compose two DataViews together to construct a view from the target of this DataView to the view type of the second DataView

    Compose two DataViews together to construct a view from the target of this DataView to the view type of the second DataView

    V2

    View type of DataView g

    g

    a DataView from V to new view-type V2

    returns

    a new DataView from the original T to new view-type V2

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def ensuring(cond: (DataView[T, V]) => Boolean, msg: => Any): DataView[T, V]
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toEnsuring[DataView[T, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (DataView[T, V]) => Boolean): DataView[T, V]
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toEnsuring[DataView[T, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: => Any): DataView[T, V]
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toEnsuring[DataView[T, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): DataView[T, V]
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toEnsuring[DataView[T, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def invert(mkView: (V) => T): DataView[V, T]
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toInvertibleDataView[T, V] performed by method InvertibleDataView in chisel3.experimental.dataview.DataView.
    This conversion will take place only if all of the following constraints are met:
    1. T is accompanied by a WeakTypeTag, which is a runtime representation of its type that survives erasure (T: WeakTypeTag)
    2. V is accompanied by a WeakTypeTag, which is a runtime representation of its type that survives erasure (V: WeakTypeTag)
    3. T is a subclass of Data (T <: Data)
    4. V is a subclass of Data (V <: Data)
    Definition Classes
    InvertibleDataView
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    DataView → AnyRef → Any
  25. def total: Boolean

    Indicates if the mapping contains every field of the target

  26. def viewAs[V <: Data](implicit dataproduct: DataProduct[DataView[T, V]], dataView: DataView[DataView[T, V], V], sourceInfo: SourceInfo): V
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toDataViewable[DataView[T, V]] performed by method DataViewable in chisel3.experimental.dataview.
    Definition Classes
    DataViewable
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toStringFormat[DataView[T, V]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  2. def [B](y: B): (DataView[T, V], B)
    Implicit
    This member is added by an implicit conversion from DataView[T, V] toArrowAssoc[DataView[T, V]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion InvertibleDataView fromDataView[T, V] to InvertibleDataView[T, V]

Inherited by implicit conversion DataViewable fromDataView[T, V] to DataViewable[DataView[T, V]]

Inherited by implicit conversion any2stringadd fromDataView[T, V] to any2stringadd[DataView[T, V]]

Inherited by implicit conversion StringFormat fromDataView[T, V] to StringFormat[DataView[T, V]]

Inherited by implicit conversion Ensuring fromDataView[T, V] to Ensuring[DataView[T, V]]

Inherited by implicit conversion ArrowAssoc fromDataView[T, V] to ArrowAssoc[DataView[T, V]]

Ungrouped