CIRCT
20.0.0git
|
An Evaluator, which is constructed with an IR module and can instantiate Objects. More...
#include <Evaluator.h>
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. More... | |
FailureOr< evaluator::EvaluatorValuePtr > | instantiate (StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams) |
Instantiate an Object with its class name and actual parameters. More... | |
mlir::ModuleOp | getModule () |
Get the Module this Evaluator is built from. More... | |
FailureOr< evaluator::EvaluatorValuePtr > | getPartiallyEvaluatedValue (Type type, Location loc) |
Private Member Functions | |
bool | isFullyEvaluated (Value value, ActualParameters key) |
bool | isFullyEvaluated (ObjectKey key) |
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. More... | |
FailureOr< EvaluatorValuePtr > | evaluateParameter (BlockArgument formalParam, ActualParameters actualParams, Location loc) |
Evaluator dispatch functions for the small expression grammar. More... | |
FailureOr< EvaluatorValuePtr > | evaluateConstant (ConstantOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for constants. More... | |
FailureOr< EvaluatorValuePtr > | evaluateIntegerBinaryArithmetic (IntegerBinaryArithmeticOp op, ActualParameters actualParams, Location loc) |
FailureOr< EvaluatorValuePtr > | evaluateObjectInstance (StringAttr className, ActualParameters actualParams, Location loc, ObjectKey instanceKey={}) |
Instantiate an Object with its class name and actual parameters. More... | |
FailureOr< EvaluatorValuePtr > | evaluateObjectInstance (ObjectOp op, ActualParameters actualParams) |
Evaluator dispatch function for Object instances. More... | |
FailureOr< EvaluatorValuePtr > | evaluateObjectField (ObjectFieldOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for Object fields. More... | |
FailureOr< EvaluatorValuePtr > | evaluateListCreate (ListCreateOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for List creation. More... | |
FailureOr< EvaluatorValuePtr > | evaluateListConcat (ListConcatOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for List concatenation. More... | |
FailureOr< EvaluatorValuePtr > | evaluateTupleCreate (TupleCreateOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for Tuple creation. More... | |
FailureOr< EvaluatorValuePtr > | evaluateTupleGet (TupleGetOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for List creation. More... | |
FailureOr< evaluator::EvaluatorValuePtr > | evaluateMapCreate (MapCreateOp op, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for Map creation. More... | |
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< ActualParameters > | createParametersFromOperands (ValueRange range, ActualParameters actualParams, Location loc) |
Evaluator dispatch function for Object instances. More... | |
Private Attributes | |
SymbolTable | symbolTable |
The symbol table for the IR module the Evaluator was constructed with. More... | |
SmallVector< std::unique_ptr< SmallVector< std::shared_ptr< evaluator::EvaluatorValue > > > > | actualParametersBuffers |
This uniquely stores vectors that represent parameters. More... | |
std::queue< ObjectKey > | worklist |
A worklist that tracks values which needs to be fully evaluated. More... | |
DenseMap< ObjectKey, std::shared_ptr< evaluator::EvaluatorValue > > | objects |
Evaluator value storage. More... | |
An Evaluator, which is constructed with an IR module and can instantiate Objects.
Further refinement is expected.
Definition at line 420 of file Evaluator.h.
using circt::om::Evaluator::ActualParameters = SmallVectorImpl<std::shared_ptr<evaluator::EvaluatorValue> > * |
Definition at line 434 of file Evaluator.h.
using circt::om::Evaluator::ObjectKey = std::pair<Value, ActualParameters> |
Definition at line 437 of file Evaluator.h.
circt::om::Evaluator::Evaluator | ( | ModuleOp | mod | ) |
Construct an Evaluator with an IR module.
Definition at line 26 of file Evaluator.cpp.
|
private |
|
private |
Evaluator dispatch function for Object instances.
Definition at line 496 of file Evaluator.cpp.
|
private |
Definition at line 693 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for constants.
Definition at line 408 of file Evaluator.cpp.
|
private |
Definition at line 726 of file Evaluator.cpp.
|
private |
Definition at line 417 of file Evaluator.cpp.
References assert(), circt::calyx::direction::get(), and circt::om::evaluator::AttributeValue::getAs().
|
private |
Evaluator dispatch function for List concatenation.
Definition at line 594 of file Evaluator.cpp.
References circt::om::evaluator::ListValue::getElements().
|
private |
Evaluator dispatch function for List creation.
Definition at line 571 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for Map creation.
Definition at line 664 of file Evaluator.cpp.
References assert(), and circt::calyx::direction::get().
|
private |
Evaluator dispatch function for Object fields.
Definition at line 532 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for Object instances.
Definition at line 516 of file Evaluator.cpp.
|
private |
Instantiate an Object with its class name and actual parameters.
Definition at line 191 of file Evaluator.cpp.
References assert(), and circt::calyx::direction::get().
|
private |
Evaluator dispatch functions for the small expression grammar.
Evaluator dispatch function for parameters.
Definition at line 399 of file Evaluator.cpp.
|
private |
Definition at line 710 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for Tuple creation.
Definition at line 633 of file Evaluator.cpp.
|
private |
Evaluator dispatch function for List creation.
Definition at line 652 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 336 of file Evaluator.cpp.
ModuleOp circt::om::Evaluator::getModule | ( | ) |
Get the Module this Evaluator is built from.
Definition at line 29 of file Evaluator.cpp.
|
private |
Definition at line 108 of file Evaluator.cpp.
References circt::om::evaluator::PathValue::getEmptyPath().
FailureOr< evaluator::EvaluatorValuePtr > circt::om::Evaluator::getPartiallyEvaluatedValue | ( | Type | type, |
Location | loc | ||
) |
Definition at line 72 of file Evaluator.cpp.
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 291 of file Evaluator.cpp.
Referenced by omEvaluatorInstantiate().
|
inlineprivate |
Definition at line 444 of file Evaluator.h.
References objects.
|
inlineprivate |
Definition at line 440 of file Evaluator.h.
|
private |
This uniquely stores vectors that represent parameters.
Definition at line 516 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 523 of file Evaluator.h.
Referenced by isFullyEvaluated().
|
private |
The symbol table for the IR module the Evaluator was constructed with.
Used to look up class definitions.
Definition at line 511 of file Evaluator.h.
|
private |
A worklist that tracks values which needs to be fully evaluated.
Definition at line 519 of file Evaluator.h.