DataEquality

chisel3.Data.DataEquality
implicit class DataEquality[T <: Data](lhs: T)(implicit sourceInfo: SourceInfo)

Provides generic, recursive equality for Bundle and Vec hardware. This avoids the need to use workarounds such as bundle1.asUInt === bundle2.asUInt by allowing users to instead write bundle1 === bundle2.

Static type safety of this comparison is guaranteed at compile time as the extension method requires the same parameterized type for both the left-hand and right-hand sides. It is, however, possible to get around this type safety using Bundle subtypes that can differ during runtime (e.g. through a generator). These cases are subsequently raised as elaboration errors.

Value parameters

lhs

The Data hardware on the left-hand side of the equality

Attributes

Source
Data.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def ===(rhs: T): Bool

Dynamic recursive equality operator for generic Data

Dynamic recursive equality operator for generic Data

Value parameters

rhs

a hardware Data to compare lhs to

Attributes

Returns

a hardware Bool asserted if lhs is equal to rhs

Throws
ChiselException

when lhs and rhs are different types during elaboration time

Source
Data.scala