public final class SmvPrinterUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getClockAssignment(ru.ispras.fortress.expression.NodeVariable clock,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> phaseVars)
Generates clock assignment.
|
static java.lang.String |
getFormattedName(java.lang.String name)
Converts a string of process identifiers into a single identifier.
|
static java.lang.String |
getInputConstraints(java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputs,
ru.ispras.fortress.expression.NodeVariable clock)
Generates input variable constraints that prohibit value changes while clock = 1.
|
static java.lang.String |
getModuleDeclaration(java.lang.String name)
Generates a module declaration in SMV format with empty parameter list.
|
static java.lang.String |
getModuleDeclaration(java.lang.String name,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputs)
Generates a module declaration in SMV format.
|
static java.lang.String |
getModuleInstantiation(java.lang.String instanceName,
java.lang.String moduleName,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> parameters)
Generates a module instantiation in SMV format.
|
static java.lang.String |
getName(ru.ispras.fortress.expression.NodeVariable variable)
Checks whether the variable name is acceptable by SMV syntax.
|
static java.lang.String |
getProcessInstantiation(java.util.Collection<ModuleProcess> processes,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputVariables)
Generates process instantiations in SMV format.
|
static java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getRegs(Module module)
Returns a list of registers of the specified module.
|
static java.lang.String |
getTypeConversionPrefix(ru.ispras.fortress.data.DataTypeId sourceType,
ru.ispras.fortress.data.DataTypeId targetType)
Returns the type conversion string from the source type into the target type if possible.
|
static java.lang.String |
getVarDeclareSection(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> variables,
SmvExprPrinter printer)
Generates a VAR declaration section in SMV format from a collection of variables.
|
static java.lang.String |
getWhitespace(int level)
Returns the indentation space according to the specified indentation level.
|
static ru.ispras.fortress.expression.Node |
makeSubstitutions(ru.ispras.fortress.expression.Node node)
Performs the following substitutions on the specified Node:
Substitutes a power operation by an arithmetic left shift operation.
|
public static java.lang.String getModuleDeclaration(java.lang.String name, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputs)
name
- - the specified module name.inputs
- - the specified collection of parameters.public static java.lang.String getModuleDeclaration(java.lang.String name)
name
- - the specified module name.public static java.lang.String getModuleInstantiation(java.lang.String instanceName, java.lang.String moduleName, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> parameters)
instanceName
- - the specified module instance name.moduleName
- - the specified module name.parameters
- - the specified collection of parameters.public static java.lang.String getProcessInstantiation(java.util.Collection<ModuleProcess> processes, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputVariables)
processes
- - the specified process collection.inputVariables
- - the specified input variable collection.public static java.lang.String getName(ru.ispras.fortress.expression.NodeVariable variable)
variable
- - the specified variable.public static java.lang.String getVarDeclareSection(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> variables, SmvExprPrinter printer)
variables
- - the variable-declaration mappingprinter
- - the specified SmvExprPrinter
.public static java.lang.String getWhitespace(int level)
level
- - the specified indentation level.public static ru.ispras.fortress.expression.Node makeSubstitutions(ru.ispras.fortress.expression.Node node)
node
- - the specified node.public static java.lang.String getTypeConversionPrefix(ru.ispras.fortress.data.DataTypeId sourceType, ru.ispras.fortress.data.DataTypeId targetType)
sourceType
- - the specified source type.targetType
- - the specified target type.public static java.lang.String getClockAssignment(ru.ispras.fortress.expression.NodeVariable clock, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> phaseVars)
clock
- - the specified clock variable.public static java.lang.String getFormattedName(java.lang.String name)
name
- The string of process identifiers.public static java.util.List<ru.ispras.fortress.expression.NodeVariable> getRegs(Module module)
module
- - the specified Module
.public static java.lang.String getInputConstraints(java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputs, ru.ispras.fortress.expression.NodeVariable clock)
inputs
- - the collection of input variables.clock
- - the clock variable.