Packages

o

chisel3.reflect

DataMirror

object DataMirror

Source
DataMirror.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DataMirror
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait HasMatchingZipOfChildren[T] extends AnyRef

    Typeclass trait to use collectMembersOverMatches, collectMembersOverAll, collectMembersOverAllForAny, collectMembersOverAllForAnyFunction

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. implicit val AlignmentMatchingZipOfChildren: HasMatchingZipOfChildren[Alignment]
  5. implicit val ConnectableAlignmentMatchingZipOfChildren: HasMatchingZipOfChildren[ConnectableAlignment]
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def checkAlignmentTypeEquivalence(x: Data, y: Data): Boolean

    Check if two Chisel types have the same alignments for all matching members

    Check if two Chisel types have the same alignments for all matching members

    This means that for matching members in Aggregates, they must have matching member alignments relative to the parent type For matching non-aggregates, they must be the same alignment to their parent type.

    x

    First Chisel type

    y

    Second Chisel type

    returns

    true if the two Chisel types have alignment type equivalence.

  8. def checkTypeEquivalence(x: Data, y: Data): Boolean

    Check if two Chisel types are the same type.

    Check if two Chisel types are the same type. Internally, this is dispatched to each Chisel type's typeEquivalent function for each type to determine if the types are intended to be equal.

    For most types, different parameters should ensure that the types are different. For example, UInt(8.W) and UInt(16.W) are different. Likewise, Records check that both Records have the same elements with the same types.

    elements must be the same 'probe-ness' (RWProbe and Probe vs no Probe are not) and the same color.

    Equivalent to being structural, alignment, width, probe, color type equivalent

    x

    First Chisel type

    y

    Second Chisel type

    returns

    true if the two Chisel types are equal.

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def collectAlignedDeep[T](base: Data)(pf: PartialFunction[Data, T]): Seq[T]

    Collects all members of base who are aligned w.r.t.

    Collects all members of base who are aligned w.r.t. base Accepts a collector partial function, rather than a collector function

    T

    Type of the component that will be collected

    base

    Data from whom aligned members (w.r.t. base) are collected

  11. def collectAllMembers(d: Data): Seq[Data]

    Recursively collect all expanded member components of a data component, including intermediate aggregate nodes

    Recursively collect all expanded member components of a data component, including intermediate aggregate nodes

    d

    Data component to recursively collect components.

    returns

    All member components; intermediate fields/indices ARE included

  12. def collectFlippedDeep[T](base: Data)(pf: PartialFunction[Data, T]): Seq[T]

    Collects all members of base who are flipped w.r.t.

    Collects all members of base who are flipped w.r.t. base Accepts a collector partial function, rather than a collector function

    T

    Type of the component that will be collected

    base

    Data from whom flipped members (w.r.t. base) are collected

  13. def collectLeafMembers(d: Data): Seq[Data]

    Recursively collect just the leaf components of a data component's children (i.e.

    Recursively collect just the leaf components of a data component's children (i.e. anything that isn't a Record or a Vec, but an Element). Probes of aggregates are also considered leaves.

    d

    Data component to recursively collect leaf components.

    returns

    All Element components; intermediate fields/indices are not included

  14. def collectMembers[T](d: Data)(collector: PartialFunction[Data, T]): Iterable[T]

    Collects all fields selected by collector within a data and all recursive children fields Accepts a collector partial function, rather than a collector function

    Collects all fields selected by collector within a data and all recursive children fields Accepts a collector partial function, rather than a collector function

    T

    Type of the component that will be collected

    collector

    Collector partial function to pick which components to collect

  15. def collectMembersOverAll[D, T](left: D, right: D)(collector: PartialFunction[(Option[D], Option[D]), T])(implicit arg0: HasMatchingZipOfChildren[D]): Seq[T]

    Collects over members left and right who have structurally corresponding members in either left and right Accepts a collector partial function, rather than a collector function

    Collects over members left and right who have structurally corresponding members in either left and right Accepts a collector partial function, rather than a collector function

    T

    Type of the thing being collected

    left

    Data from whom members are collected

    right

    Data from whom members are collected

    collector

    Collector partial function to pick which components from left, right, or both to collect

  16. def collectMembersOverAllForAny[D, L, R](left: Option[D], right: Option[D])(pcollector: PartialFunction[(Option[D], Option[D]), (Option[L], Option[R])])(implicit arg0: HasMatchingZipOfChildren[D]): Seq[(Option[L], Option[R])]

    Collects over members left and right who have structurally corresponding members in either left and right Can return an optional value for left, right, both or neither Accepts a collector partial function, rather than a collector function

    Collects over members left and right who have structurally corresponding members in either left and right Can return an optional value for left, right, both or neither Accepts a collector partial function, rather than a collector function

    L

    Type of the thing being collected from the left

    R

    Type of the thing being collected from the right

    left

    Data from whom members are collected

    right

    Data from whom members are collected

  17. def collectMembersOverAllForAnyFunction[D, L, R](left: Option[D], right: Option[D])(collector: ((Option[D], Option[D])) => Option[(Option[L], Option[R])])(implicit arg0: HasMatchingZipOfChildren[D]): Seq[(Option[L], Option[R])]

    Collects over members left and right who have structurally corresponding members in either left and right Can return an optional value for left, right, both or neither Accepts a full function

    Collects over members left and right who have structurally corresponding members in either left and right Can return an optional value for left, right, both or neither Accepts a full function

    L

    Type of the thing being collected from the left

    R

    Type of the thing being collected from the right

    left

    Data from whom members are collected

    right

    Data from whom members are collected

    collector

    Collector full function to pick which components from left, right, or both to collect

  18. def collectMembersOverMatches[D, T](left: D, right: D)(collector: PartialFunction[(D, D), T])(implicit arg0: HasMatchingZipOfChildren[D]): Seq[T]

    Collects over members left and right who have structurally corresponding members in both left and right Accepts a collector partial function, rather than a collector function

    Collects over members left and right who have structurally corresponding members in both left and right Accepts a collector partial function, rather than a collector function

    T

    Type of the thing being collected

    left

    Data from whom members are collected

    right

    Data from whom members are collected

    collector

    Collector partial function to pick which components from left and right to collect

  19. def directionOf(target: Data): ActualDirection
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  23. def fullModulePorts[T <: BaseModule](inst: Instance[T])(implicit si: SourceInfo): Seq[(String, Data)]

    Returns a recursive representation of an chisel3.experimental.hierarchy.Instance of a module's ports with underscore-qualified names.

    Returns a recursive representation of an chisel3.experimental.hierarchy.Instance of a module's ports with underscore-qualified names.

    Note

    The returned ports are redundant. An Aggregate port will be present along with all of its children.

    See also

    DataMirror.modulePorts for a non-recursive representation of the ports.

  24. def fullModulePorts(target: BaseModule)(implicit si: SourceInfo): Seq[(String, Data)]

    Returns a recursive representation of a module's ports with underscore-qualified names

    Returns a recursive representation of a module's ports with underscore-qualified names

    class MyModule extends Module {
      val io = IO(new Bundle {
        val in = Input(UInt(8.W))
        val out = Output(Vec(2, UInt(8.W)))
      })
      val extra = IO(Input(UInt(8.W)))
      val delay = RegNext(io.in)
      io.out(0) := delay
      io.out(1) := delay + extra
    }
    val mod = Module(new MyModule)
    DataMirror.fullModulePorts(mod)
    // returns: Seq(
    //   "clock" -> mod.clock,
    //   "reset" -> mod.reset,
    //   "io" -> mod.io,
    //   "io_out" -> mod.io.out,
    //   "io_out_0" -> mod.io.out(0),
    //   "io_out_1" -> mod.io.out(1),
    //   "io_in" -> mod.io.in,
    //   "extra" -> mod.extra
    // )
    Note

    The returned ports are redundant. An Aggregate port will be present along with all of its children.

    See also

    DataMirror.modulePorts for a non-recursive representation of the ports.

  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def getParent(target: BaseModule): Option[BaseModule]

    Returns the parent module within which a module instance is instantiated

    Returns the parent module within which a module instance is instantiated

    target

    a module instance

    returns

    the parent of the target, if one exists

    Note

    Top-level modules in any given elaboration do not have a parent

  27. def hasOuterFlip(target: Data): Boolean

    Returns true if target has been Flipped or Input directly

  28. def hasProbeTypeModifier(x: Data): Boolean

    Check if a given Data is a Probe

    Check if a given Data is a Probe

    x

    the Data to check

    returns

    true if x is a Probe, false otherwise

  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. def isFullyAligned(base: Data): Boolean

    Check if the given Data is fully aligned w.r.t base.

    Check if the given Data is fully aligned w.r.t base. Chisel version of FIRRTL "passive". All Data are considered fully aligned to themselves regardless of their specified direction or relevant coerced directions of their parents. See collectFlippedDeep.

    base

    Data to check full alignment for and relative to

    returns

    true if Data is fully aligned, false otherwise.

  31. def isIO(x: Data): Boolean

    Check if a given Data is an IO port

    Check if a given Data is an IO port

    x

    the Data to check

    returns

    true if x is an IO port, false otherwise

  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. def isProperty(x: Data): Boolean

    Check if a given Data is a Property

    Check if a given Data is a Property

    x

    the Data to check

    returns

    true if x is a Property, false otherwise

  34. def isReg(x: Data): Boolean

    Check if a given Data is a Reg

    Check if a given Data is a Reg

    x

    the Data to check

    returns

    true if x is a Reg, false otherwise

  35. def isVisible(target: Data): Boolean

    Check if a given Data is visible from the current context

    Check if a given Data is visible from the current context

    returns

    true if x is visible, false otherwise

  36. def isWire(x: Data): Boolean

    Check if a given Data is a Wire

    Check if a given Data is a Wire

    x

    the Data to check

    returns

    true if x is a Wire, false otherwise

  37. def modulePorts[T <: BaseModule](inst: Instance[T])(implicit si: SourceInfo): Seq[(String, Data)]

    Returns the ports of a chisel3.experimental.hierarchy.Instance of a module

  38. def modulePorts(target: BaseModule)(implicit si: SourceInfo): Seq[(String, Data)]

    Returns the ports of a module

    Returns the ports of a module

    class MyModule extends Module {
      val io = IO(new Bundle {
        val in = Input(UInt(8.W))
        val out = Output(Vec(2, UInt(8.W)))
      })
      val extra = IO(Input(UInt(8.W)))
      val delay = RegNext(io.in)
      io.out(0) := delay
      io.out(1) := delay + extra
    }
    val mod = Module(new MyModule)
    DataMirror.modulePorts(mod)
    // returns: Seq(
    //   "clock" -> mod.clock,
    //   "reset" -> mod.reset,
    //   "io" -> mod.io,
    //   "extra" -> mod.extra
    // )
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  42. def queryNameGuess(x: Data): String

    Get an early guess for the name of this Data

    Get an early guess for the name of this Data

    Warning: it is not guaranteed that this name will end up in the output FIRRTL or Verilog.

    Name guesses are not stable and may change due to a subsequent Data.suggestName or plugin-related naming. Name guesses are not necessarily legal Verilog identifiers. Name guesses for elements of Bundles or Records will include periods, and guesses for elements of Vecs will include square brackets.

  43. def requireTypeEquivalent(x: Data, y: Data, message: String = ""): Unit

    Require that two things are type equivalent

    Require that two things are type equivalent

    If they are not, print a helpful error message as to why not.

    Requires structural, alignment, width, probe, color type equivalent

    x

    First Chisel type

    y

    Second chisel type

    message

    if they are not type equivalent, contextual message to add to the exception thrown

  44. def specifiedDirectionOf(target: Data): SpecifiedDirection
  45. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  50. def widthOf(target: Data): Width
  51. object internal

Deprecated Value Members

  1. def getIntermediateAndLeafs(d: Data): Seq[Data]
    Annotations
    @deprecated
    Deprecated

    Use DataMirror.collectAllMembers instead

  2. def getLeafs(d: Data): Seq[Data]
    Annotations
    @deprecated
    Deprecated

    Use DataMirror.collectLeafMembers instead

Inherited from AnyRef

Inherited from Any

Ungrouped