Class

firrtl.constraint

ConstraintSolver

Related Doc: package constraint

Permalink

class ConstraintSolver extends AnyRef

Forwards-Backwards Constraint Solver

Used for computing Width and Bound constraints

Note - this is an O(N) algorithm, but requires exponential memory. We rely on aggressive early optimization of constraint expressions to (usually) get around this.

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

Instance Constructors

  1. new ConstraintSolver()

    Permalink

Type Members

  1. type ConstraintMap = HashMap[String, (Constraint, Boolean)]

    Permalink

    Solved constraints

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. def addGeq(big: Width, small: Width, r1: String, r2: String): Unit

    Permalink

    Updates internal list of inequalities with a new GreaterOrEqual

    Updates internal list of inequalities with a new GreaterOrEqual

    big

    The larger constraint, must be either known or a variable

    small

    The smaller constraint

  5. def addGeq(big: Constraint, small: Constraint, r1: String, r2: String): Unit

    Permalink

    Updates internal list of inequalities with a new GreaterOrEqual

    Updates internal list of inequalities with a new GreaterOrEqual

    big

    The larger constraint, must be either known or a variable

    small

    The smaller constraint

  6. def addLeq(small: Width, big: Width, r1: String, r2: String): Unit

    Permalink

    Updates internal list of inequalities with a new LesserOrEqual

    Updates internal list of inequalities with a new LesserOrEqual

    small

    The smaller constraint, must be either known or a variable

    big

    The larger constraint

  7. def addLeq(small: Constraint, big: Constraint, r1: String, r2: String): Unit

    Permalink

    Updates internal list of inequalities with a new LesserOrEqual

    Updates internal list of inequalities with a new LesserOrEqual

    small

    The smaller constraint, must be either known or a variable

    big

    The larger constraint

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def check(): Seq[Inequality]

    Permalink

    Returns illegal constraints, where both a >= and <= inequality are used on the same variable

  10. def clear(): Unit

    Permalink

    Clear all previously recorded/solved constraints

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def get(b: Width): Option[IsKnown]

    Permalink

    Returns a solved width, if it exists and is solved

  16. def get(b: Constraint): Option[IsKnown]

    Permalink

    Returns a solved constraint, if it exists and is solved

  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. def serializeConstraints: String

    Permalink

    For debugging, can serialize the initial constraints

  24. def serializeSolutions: String

    Permalink

    For debugging, can serialize the solved constraints

  25. def solve(): Unit

    Permalink

    Solves constraints present in collected inequalities

    Solves constraints present in collected inequalities

    Constraint solving steps: 1) Assert no variable has both >= and <= inequalities (it can have multiple of the same kind of inequality) 2) Merge constraints of variables having multiple inequalities 3) Forward solve inequalities

    1. Iterate through inequalities top-to-bottom, replacing previously seen variables with corresponding constraint b. For each forward-solved inequality, attempt to remove circular constraints c. Forward-solved inequalities without circular constraints are recorded 4) Backwards solve inequalities
    2. Iterate through successful forward-solved inequalities bottom-to-top, replacing previously seen variables with corresponding constraint b. Record solved constraints
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped