m2isar.metamodel.utils.expr_simplifier
A transformation module for simplifying M2-ISA-R behavior expressions. The following simplifications are done:
Resolvable
m2isar.metamodel.arch.Parameters are replaced by m2isar.metamodel.arch.Literal s representing their valueFully resolvable arithmetic operations are carried out and their results represented as a matching
m2isar.metamodel.arch.LiteralConditions and loops with fully resolvable conditions are either discarded entirely or transformed into code blocks without any conditions
Ternaries with fully resolvable conditions are transformed into only the matching part
Type conversions of
m2isar.metamodel.arch.Literals apply the desired type directly to theLiteraland discard the type conversion
Classes
Visitor that simplifies behavior expression trees. |
Module Contents
- class ExprSimplifierVisitor[source]
Bases:
m2isar.metamodel.utils.ExprVisitor.ExprVisitorVisitor that simplifies behavior expression trees.
- abstract generate(expr: m2isar.metamodel.behav.BaseNode, context=None)[source]
- _(expr: m2isar.metamodel.behav.Operation, context)[source]