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
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
- Alphabetic
- By Inheritance
- DataView
- AnyRef
- Any
- by InvertibleDataView
- by DataViewable
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (DataView[T, V], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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 thisDataView
to the view type of the secondDataView
Compose two
DataViews
together to construct a view from the target of thisDataView
to the view type of the secondDataView
- V2
View type of
DataView
g
- g
a DataView from
V
to new view-typeV2
- returns
a new
DataView
from the originalT
to new view-typeV2
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (DataView[T, V]) => Boolean, msg: => Any): DataView[T, V]
- def ensuring(cond: (DataView[T, V]) => Boolean): DataView[T, V]
- def ensuring(cond: Boolean, msg: => Any): DataView[T, V]
- def ensuring(cond: Boolean): DataView[T, V]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def invert(mkView: (V) => T): DataView[V, T]
- Implicit
- This member is added by an implicit conversion from DataView[T, V] toDataView.InvertibleDataView[T, V] performed by method InvertibleDataView in chisel3.experimental.dataview.InvertibleDataView.
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
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- DataView → AnyRef → Any
- def total: Boolean
Indicates if the mapping contains every field of the target
- 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
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- 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 ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- 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.
This is the documentation for Chisel.
Package structure
The chisel3 package presents the public API of Chisel. It contains the concrete core types
UInt
,SInt
,Bool
,Clock
, andReg
, the abstract typesBits
,Aggregate
, andData
, and the aggregate typesBundle
andVec
.The Chisel package is a compatibility layer that attempts to provide chisel2 compatibility in chisel3.
Utility objects and methods are found in the
util
package.The
testers
package defines the basic interface for chisel testers.