Object

firrtl

Utils

Related Doc: package firrtl

Permalink

object Utils extends LazyLogging

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

Type Members

  1. case class DeclarationNotFoundException(msg: String) extends FirrtlUserException with Product with Serializable

    Permalink
  2. type NodeMap = HashMap[String, Expression]

    Permalink

    Maps node name to value

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val BoolType: UIntType

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def ceilLog2(x: BigInt): Int

    Permalink
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  8. def create_exps(e: Expression): Seq[Expression]

    Permalink
  9. def create_exps(n: String, t: Type): Seq[Expression]

    Permalink
  10. def diff(e1: Expression, e2: Expression): Seq[(Expression, Expression)]

    Permalink

    Walks two expression trees and returns a sequence of tuples of where they differ

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def error(str: String, cause: Throwable = null): Nothing

    Permalink
  14. def expandPrefixes(name: String, prefixDelim: String = "_"): Seq[String]

    Permalink

    Expand a name into its prefixes, e.g., 'foo_barbaz' becomes 'Seq[foo_, foo_bar, foo_barbaz]'. This can be used to produce better names when generating prefix unique names.

    Expand a name into its prefixes, e.g., 'foo_barbaz' becomes 'Seq[foo_, foo_bar, foo_barbaz]'. This can be used to produce better names when generating prefix unique names.

    name

    a signal name

    prefixDelim

    a prefix delimiter (default is "_")

    returns

    the signal name and any prefixes

  15. def expandRef(e: Expression): Seq[Expression]

    Permalink

    Like create_exps, but returns intermediate Expressions as well

  16. def field_flip(v: Type, s: String): Orientation

    Permalink
  17. def field_type(v: Type, s: String): Type

    Permalink
  18. def flow(e: Expression): Flow

    Permalink
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  20. def getDeclaration(m: Module, expr: Expression): IsDeclaration

    Permalink

    Gets the root declaration of an expression

    Gets the root declaration of an expression

    m

    the firrtl.ir.Module to search

    expr

    the firrtl.ir.Expression that refers to some declaration

    returns

    the firrtl.ir.IsDeclaration of expr

    Exceptions thrown

    DeclarationNotFoundException if no declaration of expr is found

  21. def getKids(e: Expression): Seq[Expression]

    Permalink

    Returns children Expressions of e

  22. def getThrowable(maybeException: Option[Throwable], first: Boolean): Throwable

    Permalink

    Unwind the causal chain until we hit the initial exception (which may be the first).

    Unwind the causal chain until we hit the initial exception (which may be the first).

    maybeException

    - possible exception triggering the error,

    first

    - true if we want the first (eldest) exception in the chain,

    returns

    first or last Throwable in the chain.

  23. def get_field(v: Type, s: String): Field

    Permalink
  24. def get_flow(p: Port): Flow

    Permalink
  25. def get_flow(s: Statement): Flow

    Permalink
  26. def get_info(s: Statement): Info

    Permalink
  27. def get_point(e: Expression): Int

    Permalink
  28. def get_size(t: Type): Int

    Permalink
  29. def get_valid_points(t1: Type, t2: Type, flip1: Orientation, flip2: Orientation): Seq[(Int, Int)]

    Permalink
  30. def hasFlip(t: Type): Boolean

    Permalink

    Returns true if t, or any subtype, contains a flipped field

    Returns true if t, or any subtype, contains a flipped field

    t

    type firrtl.ir.Type to be checked

    returns

    if t contains firrtl.ir.Flip

  31. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  32. def indent(str: String): String

    Permalink

    Indent the results of ir.FirrtlNode.serialize

  33. def inline(nodeMap: NodeMap, stop: (String) ⇒ Boolean = x: String => false)(e: Expression): Expression

    Permalink

    Returns an inlined expression (replacing node references with values), stopping on a stopping condition or until the reference is not a node

  34. def isBitExtract(expr: Expression): Boolean

    Permalink

    Returns true if Expression is a Bits PrimOp, false otherwise

  35. def isBitExtract(op: PrimOp): Boolean

    Permalink

    Returns true if PrimOp is a BitExtraction, false otherwise

  36. def isCast(expr: Expression): Boolean

    Permalink

    Returns true if Expression is a casting PrimOp, false otherwise

  37. def isCast(op: PrimOp): Boolean

    Permalink

    Returns true if PrimOp is a cast, false otherwise

  38. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  39. def isTemp(str: String): Boolean

    Permalink
  40. def kind(e: Expression): Kind

    Permalink
  41. val logger: Logger

    Permalink
    Definition Classes
    LazyLogging
  42. def max(a: BigInt, b: BigInt): BigInt

    Permalink
  43. def mergeRef(root: Expression, body: Expression): Expression

    Permalink

    Adds a root reference to some SubField/SubIndex chain

  44. def min(a: BigInt, b: BigInt): BigInt

    Permalink
  45. def module_type(m: DefModule): BundleType

    Permalink
  46. def mux_type(t1: Type, t2: Type): Type

    Permalink
  47. def mux_type(e1: Expression, e2: Expression): Type

    Permalink
  48. def mux_type_and_widths(t1: Type, t2: Type): Type

    Permalink
  49. def mux_type_and_widths(e1: Expression, e2: Expression): Type

    Permalink
  50. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  51. def niceName(depth: Int)(e: Expression): String

    Permalink
  52. def niceName(e: Expression): String

    Permalink

    Provide a nice name to create a temporary *

  53. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  54. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  55. val one: UIntLiteral

    Permalink
  56. def pow_minus_one(a: BigInt, b: BigInt): BigInt

    Permalink
  57. def splitRef(e: Expression): (WRef, Expression)

    Permalink

    Splits an Expression into root Ref and tail

    Splits an Expression into root Ref and tail

    Examples:
    1. Given: SubField(SubIndex(Ref("b"), 2), "c") Returns: (Ref("b"), SubField(SubIndex(EmptyExpression, 2), "c")) b[2].c -> (b, EMPTY[2].c)

    2. ,
    3. Given: SubField(SubIndex(SubField(Ref("a", UIntType(IntWidth(32))), "b"), 2), "c") Returns: (Ref("a"), SubField(SubIndex(Ref("b"), 2), "c")) a.b[2].c -> (a, b[2].c)

    Note

    This function only supports WRef, WSubField, and WSubIndex

  58. def squashEmpty(s: Statement): Statement

    Permalink

    Removes all firrtl.ir.EmptyStmt statements and condenses firrtl.ir.Block statements.

  59. def sub_type(v: Type): Type

    Permalink
  60. def swap(f: Orientation): Orientation

    Permalink
  61. def swap(d: Direction): Direction

    Permalink
  62. def swap(g: Flow): Flow

    Permalink
  63. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  64. def throwInternalError(message: String = "", exception: Option[Exception] = None): Nothing

    Permalink

    Throw an internal error, possibly due to an exception.

    Throw an internal error, possibly due to an exception.

    message

    - possible string to emit,

    exception

    - possible exception triggering the error.

  65. def time[R](block: ⇒ R): (Double, R)

    Permalink
  66. def times(f1: Orientation, f2: Orientation): Orientation

    Permalink
  67. def times(flip: Orientation, g: Flow): Flow

    Permalink
  68. def times(g: Flow, flip: Orientation): Flow

    Permalink
  69. def times(d: Direction, g: Flow): Direction

    Permalink
  70. def times(g: Flow, d: Direction): Direction

    Permalink
  71. def times(d: Direction, flip: Orientation): Direction

    Permalink
  72. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  73. def toTarget(main: String, module: String)(expression: Expression): ReferenceTarget

    Permalink
  74. implicit def toWrappedExpression(x: Expression): WrappedExpression

    Permalink
  75. def to_dir(g: Flow): Direction

    Permalink
  76. def to_flip(g: Flow): Orientation

    Permalink
  77. def to_flip(d: Direction): Orientation

    Permalink
  78. def to_flow(d: Direction): Flow

    Permalink
  79. val v_keywords: Set[String]

    Permalink
  80. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  82. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  83. val zero: UIntLiteral

    Permalink

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

  2. def gender(e: Expression): Gender

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2) Migrate from 'Gender' to 'Flow'. This method will be removed in 1.3

  3. def get_flip(t: Type, i: Int, f: Orientation): Orientation

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2) get_flip is fundamentally slow, use to_flip(flow(expr))

  4. def get_gender(p: Port): Gender

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2) Migrate from 'Gender' to 'Flow'. This method will be removed in 1.3

  5. def get_gender(s: Statement): Gender

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2) Migrate from 'Gender' to 'Flow'. This method will be removed in 1.3

  6. def to_gender(d: Direction): Gender

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2) Migrate from 'Gender' to 'Flow. This method will be removed in 1.3

Inherited from LazyLogging

Inherited from AnyRef

Inherited from Any

Ungrouped