|
CIRCT 23.0.0git
|
An Evaluator, which is constructed with an IR module and can instantiate Objects. More...
#include <Evaluator.h>

Classes | |
| struct | DebugNesting |
| RAII helper to increment/decrement debugNesting. More... | |
Public Types | |
| using | ActualParameters = SmallVectorImpl< std::shared_ptr< evaluator::EvaluatorValue > > * |
| using | ObjectKey = std::pair< Value, ActualParameters > |
Public Member Functions | |
| Evaluator (ModuleOp mod) | |
| Construct an Evaluator with an IR module. | |
| FailureOr< evaluator::EvaluatorValuePtr > | instantiate (StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams) |
| Instantiate an Object with its class name and actual parameters. | |
| mlir::ModuleOp | getModule () |
| Get the Module this Evaluator is built from. | |
| FailureOr< evaluator::EvaluatorValuePtr > | getPartiallyEvaluatedValue (Type type, Location loc) |
| uint64_t | getFullyEvaluatedCount () const |
| Get the number of fully evaluated nodes tracked by this evaluator. | |
Private Member Functions | |
| bool | isFullyEvaluated (Value value, ActualParameters key) |
| bool | isFullyEvaluated (ObjectKey key) |
| void | attachCounter (evaluator::EvaluatorValuePtr &value) |
| Attach the evaluation counter to a newly created value. | |
| FailureOr< evaluator::EvaluatorValuePtr > | instantiateImpl (StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams) |
| FailureOr< EvaluatorValuePtr > | getOrCreateValue (Value value, ActualParameters actualParams, Location loc) |
| FailureOr< EvaluatorValuePtr > | allocateObjectInstance (StringAttr clasName, ActualParameters actualParams) |
| FailureOr< EvaluatorValuePtr > | evaluateValue (Value value, ActualParameters actualParams, Location loc) |
| Evaluate a Value in a Class body according to the small expression grammar described in the rationale document. | |
| FailureOr< EvaluatorValuePtr > | evaluateParameter (BlockArgument formalParam, ActualParameters actualParams, Location loc) |
| Evaluator dispatch functions for the small expression grammar. | |
| FailureOr< EvaluatorValuePtr > | evaluateConstant (ConstantOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for constants. | |
| FailureOr< EvaluatorValuePtr > | evaluateObjectInstance (StringAttr className, ActualParameters actualParams, Location loc, ObjectKey instanceKey={}) |
| Instantiate an Object with its class name and actual parameters. | |
| FailureOr< EvaluatorValuePtr > | evaluateObjectInstance (ObjectOp op, ActualParameters actualParams) |
| Evaluator dispatch function for Object instances. | |
| FailureOr< EvaluatorValuePtr > | evaluateElaboratedObject (ElaboratedObjectOp op, ActualParameters actualParams, Location loc) |
| FailureOr< EvaluatorValuePtr > | evaluateObjectField (ObjectFieldOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for Object fields. | |
| FailureOr< EvaluatorValuePtr > | evaluateListCreate (ListCreateOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for List creation. | |
| FailureOr< EvaluatorValuePtr > | evaluateListConcat (ListConcatOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for List concatenation. | |
| FailureOr< EvaluatorValuePtr > | evaluateIntegerBinary (IntegerBinaryOp op, ActualParameters actualParams, Location loc) |
| FailureOr< EvaluatorValuePtr > | evaluateStringConcat (StringConcatOp op, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for String concatenation. | |
| FailureOr< EvaluatorValuePtr > | evaluateBinaryEquality (BinaryEqualityOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluateBasePathCreate (FrozenBasePathCreateOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluatePathCreate (FrozenPathCreateOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluateEmptyPath (FrozenEmptyPathOp op, ActualParameters actualParams, Location loc) |
| FailureOr< evaluator::EvaluatorValuePtr > | evaluateUnknownValue (UnknownValueOp op, Location loc) |
| Evaluate an unknown value. | |
| LogicalResult | evaluatePropertyAssert (PropertyAssertOp op, ActualParameters actualParams) |
| Evaluator dispatch function for property assertions. | |
| FailureOr< evaluator::EvaluatorValuePtr > | createUnknownValue (Type type, Location loc) |
| Create an unknown value of the specified type. | |
| FailureOr< ActualParameters > | createParametersFromOperands (ValueRange range, ActualParameters actualParams, Location loc) |
| Evaluator dispatch function for Object instances. | |
| raw_ostream & | dbgs (unsigned extra=0) |
| llvm::indent | indent (unsigned extra=0) |
Private Attributes | |
| SymbolTable | symbolTable |
| The symbol table for the IR module the Evaluator was constructed with. | |
| SmallVector< std::unique_ptr< SmallVector< std::shared_ptr< evaluator::EvaluatorValue > > > > | actualParametersBuffers |
| This uniquely stores vectors that represent parameters. | |
| std::vector< ObjectKey > | worklist |
| Worklists that track values which need to be fully evaluated. | |
| std::vector< ObjectKey > | nextWorklist |
| std::queue< std::pair< PropertyAssertOp, ActualParameters > > | pendingAsserts |
| A queue of pending property assertions to be evaluated after the worklist is fully drained. | |
| DenseMap< ObjectKey, std::shared_ptr< evaluator::EvaluatorValue > > | objects |
| Evaluator value storage. | |
| uint64_t | fullyEvaluatedCount = 0 |
| Counter for fully evaluated nodes. | |
| unsigned | debugNesting = 0 |
| Current nesting depth for debug output indentation. | |
An Evaluator, which is constructed with an IR module and can instantiate Objects.
Further refinement is expected.
Definition at line 385 of file Evaluator.h.
| using circt::om::Evaluator::ActualParameters = SmallVectorImpl<std::shared_ptr<evaluator::EvaluatorValue> > * |
Definition at line 400 of file Evaluator.h.
| using circt::om::Evaluator::ObjectKey = std::pair<Value, ActualParameters> |
Definition at line 403 of file Evaluator.h.
| circt::om::Evaluator::Evaluator | ( | ModuleOp | mod | ) |
Construct an Evaluator with an IR module.
Definition at line 322 of file Evaluator.cpp.
|
private |
|
inlineprivate |
Attach the evaluation counter to a newly created value.
Definition at line 419 of file Evaluator.h.
References fullyEvaluatedCount.
|
private |
Evaluator dispatch function for Object instances.
Definition at line 969 of file Evaluator.cpp.
|
private |
Create an unknown value of the specified type.
Definition at line 1374 of file Evaluator.cpp.
|
inlineprivate |
Definition at line 536 of file Evaluator.h.
References debugNesting.
|
private |
Definition at line 1319 of file Evaluator.cpp.
|
private |
Definition at line 1253 of file Evaluator.cpp.
References assert(), circt::om::evaluator::AttributeValue::get(), and circt::om::evaluator::AttributeValue::getAttr().
|
private |
Evaluator dispatch function for constants.
Definition at line 829 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::get.
|
private |
Definition at line 1004 of file Evaluator.cpp.
|
private |
Definition at line 1366 of file Evaluator.cpp.
|
private |
Definition at line 837 of file Evaluator.cpp.
References assert(), circt::om::evaluator::AttributeValue::get(), and circt::om::evaluator::AttributeValue::getAttr().
|
private |
Evaluator dispatch function for List concatenation.
Definition at line 1142 of file Evaluator.cpp.
References circt::om::evaluator::ListValue::getElements(), and circt::om::evaluator::EvaluatorValue::isFullyEvaluated().
|
private |
Evaluator dispatch function for List creation.
Definition at line 1108 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for Object fields.
Definition at line 1048 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for Object instances.
Definition at line 989 of file Evaluator.cpp.
|
private |
Instantiate an Object with its class name and actual parameters.
Definition at line 500 of file Evaluator.cpp.
|
private |
Evaluator dispatch functions for the small expression grammar.
Evaluator dispatch function for parameters.
Definition at line 820 of file Evaluator.cpp.
|
private |
Definition at line 1343 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for property assertions.
Definition at line 906 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::getAttr().
|
private |
Evaluator dispatch function for String concatenation.
Definition at line 1196 of file Evaluator.cpp.
References assert(), circt::om::evaluator::AttributeValue::get(), and circt::om::evaluator::AttributeValue::getAs().
|
private |
Evaluate an unknown value.
Definition at line 1419 of file Evaluator.cpp.
|
private |
Evaluate a Value in a Class body according to the small expression grammar described in the rationale document.
The actual parameters are the values supplied at the current instantiation of the Class being evaluated.
Definition at line 750 of file Evaluator.cpp.
|
inline |
Get the number of fully evaluated nodes tracked by this evaluator.
Definition at line 406 of file Evaluator.h.
References fullyEvaluatedCount.
| ModuleOp circt::om::Evaluator::getModule | ( | ) |
Get the Module this Evaluator is built from.
Definition at line 325 of file Evaluator.cpp.
|
private |
Definition at line 402 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::get, and circt::om::evaluator::PathValue::getEmptyPath().
| FailureOr< evaluator::EvaluatorValuePtr > circt::om::Evaluator::getPartiallyEvaluatedValue | ( | Type | type, |
| Location | loc | ||
| ) |
Definition at line 365 of file Evaluator.cpp.
References circt::om::evaluator::AttributeValue::get.
|
inlineprivate |
Definition at line 540 of file Evaluator.h.
References debugNesting.
| FailureOr< std::shared_ptr< evaluator::EvaluatorValue > > circt::om::Evaluator::instantiate | ( | StringAttr | className, |
| ArrayRef< EvaluatorValuePtr > | actualParams | ||
| ) |
Instantiate an Object with its class name and actual parameters.
Definition at line 604 of file Evaluator.cpp.
Referenced by omEvaluatorInstantiate().
|
private |
Definition at line 647 of file Evaluator.cpp.
|
inlineprivate |
Definition at line 413 of file Evaluator.h.
References objects.
|
inlineprivate |
Definition at line 409 of file Evaluator.h.
References isFullyEvaluated().
Referenced by isFullyEvaluated().
|
private |
This uniquely stores vectors that represent parameters.
Definition at line 503 of file Evaluator.h.
|
private |
Current nesting depth for debug output indentation.
Definition at line 527 of file Evaluator.h.
|
private |
Counter for fully evaluated nodes.
Definition at line 523 of file Evaluator.h.
Referenced by attachCounter(), and getFullyEvaluatedCount().
|
private |
Definition at line 509 of file Evaluator.h.
|
private |
Evaluator value storage.
Return an evaluator value for the given instantiation context (a pair of Value and parameters).
Definition at line 520 of file Evaluator.h.
Referenced by isFullyEvaluated().
|
private |
A queue of pending property assertions to be evaluated after the worklist is fully drained.
Each entry is a (PropertyAssertOp, ActualParameters) pair. Property assertions are deferred because their operands may be ReferenceValues that are not yet resolved when the class body is first processed.
Definition at line 516 of file Evaluator.h.
|
private |
The symbol table for the IR module the Evaluator was constructed with.
Used to look up class definitions.
Definition at line 498 of file Evaluator.h.
|
private |
Worklists that track values which need to be fully evaluated.
We use two worklists to detect cycles: process all items from one, and if any become fully evaluated, swap and continue.
Definition at line 508 of file Evaluator.h.