Skip to content

Commit

Permalink
Address @polgreen's code review comments for PR #133.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatin Manerkar authored and polgreen committed Aug 9, 2021
1 parent ca20a5a commit 8ad742b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/scala/uclid/lang/ModuleFlattener.scala
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ class ModuleInstantiatorPass(module : Module, inst : InstanceDecl, targetModule
}.toList.flatten
}

def createNextInputAssignments(varMap : VarMap) : List[Statement] = { List() }

val (varMap, externalSymbolMap) = createVarMap()
val targetInstVarMap = targetModule.getAnnotation[InstanceVarMapAnnotation].get.iMap

Expand All @@ -276,7 +274,6 @@ class ModuleInstantiatorPass(module : Module, inst : InstanceDecl, targetModule

val newVariables = createNewVariables(varMap)
val newInputs = createNewInputs(varMap)
val newInputAssignments = createNextInputAssignments(varMap)
val newAxioms = newModule.axioms.map {
ax => {
val idP = ax.id.flatMap(axId => Some(NameProvider.get(axId.toString() + "_axiom")))
Expand Down Expand Up @@ -359,7 +356,7 @@ class ModuleInstantiatorPass(module : Module, inst : InstanceDecl, targetModule
// add initialization for the instance.
override def rewriteInit(init : InitDecl, context : Scope) : Option[InitDecl] = {
newModule.init match {
case Some(initD) => Some(InitDecl(BlockStmt(List.empty, newInputAssignments ++ List(initD.body) ++ List(init.body))))
case Some(initD) => Some(InitDecl(BlockStmt(List.empty, List(initD.body) ++ List(init.body))))
case None => Some(init)
}
}
Expand All @@ -384,7 +381,7 @@ class ModuleInstantiatorPass(module : Module, inst : InstanceDecl, targetModule
// rewrite module.
override def rewriteModuleCall(modCall : ModuleCallStmt, context : Scope) : Option[Statement] = {
if (modCall.id == inst.instanceId) {
Some(BlockStmt(List.empty, newInputAssignments ++ newNextStatements))
Some(BlockStmt(List.empty, newNextStatements))
} else {
Some(modCall)
}
Expand Down

0 comments on commit 8ad742b

Please sign in to comment.