def generate(self): ast = self.parse() module_visitor = ModuleVisitor() module_visitor.visit(ast) modulenames = module_visitor.get_modulenames() moduleinfotable = module_visitor.get_moduleinfotable() signal_visitor = SignalVisitor(moduleinfotable, self.topmodule) signal_visitor.start_visit() frametable = signal_visitor.getFrameTable() if self.nobind: self.frametable = frametable return bind_visitor = BindVisitor(moduleinfotable, self.topmodule, frametable, noreorder=self.noreorder) bind_visitor.start_visit() dataflow = bind_visitor.getDataflows() self.frametable = bind_visitor.getFrameTable() self.terms = dataflow.getTerms() self.binddict = dataflow.getBinddict()
def _visit_InstanceList_normal(self, node): if self.isUsed(node.module): tmp = self.additionalport self.additionalport = [] new_module = self.rename(node.module) self.copyModuleInfo(node.module, new_module) prev_module_name = node.module node.module = new_module self.changeModuleName(node.module, node.module) SignalVisitor.visit_InstanceList(self, node) if self.additionalport: self.setUsed(node.module) self.updateInstancePort(node, generate=self.frames.isGenerate()) tmp.extend(self.additionalport) self.additionalport = tmp node.module = prev_module_name self.changeModuleName(node.module, prev_module_name) else: tmp = self.additionalport self.additionalport = [] self.copyModuleInfo(node.module, node.module) SignalVisitor.visit_InstanceList(self, node) if self.additionalport: self.setUsed(node.module) self.updateInstancePort(node, generate=self.frames.isGenerate()) tmp.extend(self.additionalport) self.additionalport = tmp
def __init__(self, moduleinfotable, top): SignalVisitor.__init__(self, moduleinfotable, top) self.new_moduleinfotable = ModuleInfoTable() self.coram_object = collections.defaultdict(list) self.rename_prefix = '_r' self.rename_prefix_count = 0 self.used = set([]) self.replaced_instance = {} self.replaced_instports = {} self.replaced_items = {} self.merged_replaced_instance = {} # replaced target used in next stage self.additionalport = [] # temporal variable
def __init__(self, moduleinfotable, top, templateinfotable): SignalVisitor.__init__(self, moduleinfotable, top) self.new_moduleinfotable = ModuleInfoTable() self.templateinfotable = templateinfotable self.target_object = {} # key:kind, value:list of object self.used_name_count = {} self.rename_prefix = "_r" self.rename_prefix_count = 0 self.used = set([]) self.replaced_instance = {} self.replaced_instports = {} self.replaced_items = {} self.merged_replaced_instance = {} # replaced target used in next stage self.additionalport = [] # temporal variable
def __init__(self, moduleinfotable, top, templateinfotable): SignalVisitor.__init__(self, moduleinfotable, top) self.new_moduleinfotable = ModuleInfoTable() self.templateinfotable = templateinfotable self.target_object = {} # key:kind, value:list of object self.used_name_count = {} self.rename_prefix = '_r' self.rename_prefix_count = 0 self.used = set([]) self.replaced_instance = {} self.replaced_instports = {} self.replaced_items = {} self.merged_replaced_instance = { } # replaced target used in next stage self.additionalport = [] # temporal variable