code: def elaborate(self, top_def_name=None, inst_name=None, parameters=None):
          if parameters is None:
              parameters = {}
          if top_def_name is not None:
              if top_def_name not in self.root.comp_defs:
                  self.msg.fatal("Elaboration target '%s' not found" % top_def_name)
              top_def = self.root.comp_defs[top_def_name]
              if not isinstance(top_def, comp.Addrmap):
                  self.msg.fatal("Elaboration target '%s' is not an 'addrmap' component" % top_def_name)
          else:
              for comp_def in reversed(list(self.root.comp_defs.values())):
                  if isinstance(comp_def, comp.Addrmap):
                      top_def = comp_def
                      top_def_name = comp_def.type_name
                      break
              else:
                  self.msg.fatal("Could not find any 'addrmap' components to elaborate")
          root_inst = deepcopy(self.root)
          root_inst.is_instance = True
          root_inst.original_def = self.root
          root_inst.inst_name = "$root"
          top_inst = deepcopy(top_def)
          top_inst.is_instance = True
          top_inst.original_def = top_def
          top_inst.addr_offset = 0
          top_inst.external = True
          if inst_name is not None:
              top_inst.inst_name = inst_name
          else:
              top_inst.inst_name = top_def_name
          for param_name, value in parameters.items():
              parameter = None
              for p in top_inst.parameters:
                  if p.name == param_name:
                      parameter = p
                      break
              else:
                  raise ValueError("Parameter '%s' is not available for override" % param_name)
              value_expr = expr.ExternalLiteral(self.env, value)
              value_type = value_expr.predict_type()
              if value_type is None:
                  raise TypeError("Override value for parameter '%s' is an unrecognized type" % param_name)
              if value_type != parameter.param_type:
                  raise TypeError("Incorrect type for parameter '%s'" % param_name)
              parameter.expr = value_expr
          root_inst.children.append(top_inst)
          root_node = RootNode(root_inst, self.env, None)
          walker.RDLWalker(skip_not_present=False).walk(
              root_node,
              ElabExpressionsListener(self.msg)
          )
          walker.RDLWalker(skip_not_present=False).walk(
              root_node,
              PrePlacementValidateListener(self.msg),
              StructuralPlacementListener(self.msg),
              LateElabListener(self.msg)
          )
          walker.RDLWalker(skip_not_present=True).walk(root_node, ValidateListener(self.env))
          if self.msg.had_error:
              self.msg.fatal("Elaborate aborted due to previous errors")
          return root_node