DataView

chisel3.experimental.dataview.DataView
See theDataView companion object
sealed class DataView[T, V <: Data]

Mapping between a target type T and a view type V

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

==Detailed documentation==

Type parameters

T

Target type (must have an implementation of DataProduct)

V

View type

Attributes

See also

object DataView for factory methods

object PartialDataView for defining non-total DataViews

Example
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
)
Companion
object
Source
DataView.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

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

Type parameters

V2

View type of DataView g

Value parameters

g

a DataView from V to new view-type V2

Attributes

Returns

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

Source
DataView.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
DataView.scala
def total: Boolean

Indicates if the mapping contains every field of the target

Indicates if the mapping contains every field of the target

Attributes

Source
DataView.scala