def __test(): '''for test only''' import netlist_util as nu fname = raw_input("plz enter file name:") info = nu.vm_parse(fname) m_list = info['m_list'] nu.mark_the_circut(m_list) nu.rules_check(m_list) g1 = CircuitGraph(m_list, include_pipo = True) g2 = CircuitGraph(m_list, include_pipo = False) if len(m_list) <= 20: for eachPrim in m_list: eachPrim.__print__() verbose_info =True else: verbose_info = False print "Info: THE m_list is too long >20. should not inspected by hand. ignore..." print "----NO PIPO-----------" g2.info(verbose_info) print "----Including PIPO----" g1.info(verbose_info) #g1.paint() return True
def get_graph_from_raw_input(): '''for test only''' import netlist_util as nu fname = raw_input("plz enter file name:") info = nu.vm_parse(fname) m_list = info['m_list'] print "Top module is:" m_list[0].__print__() nu.mark_the_circut(m_list) nu.rules_check(m_list) g1 = CircuitGraph(m_list, include_pipo = True) return g1
def get_graph(fname): info = nu.vm_parse(fname) m_list = info['m_list'] nu.mark_the_circut(m_list) nu.rules_check(m_list) # 原图 g1 = CircuitGraph(m_list, include_pipo = True) g1.info() # cloud_reg 图 cloud_reg1=CloudRegGraph(g1) cloud_reg1.info() # BALLAST ballas = Ballaster(cloud_reg1) cloud_reg1.info() print "After Reg2Arc" print nx.info(ballas.intgraph) ballas.feedbackset() print "After removed FAS " print nx.info(ballas.intgraph) # # # S图 # s1=g1.get_s_graph() # print nx.info(s1) # # #打印 画图 # plt.figure("Original_Circut") # g1.paint() # plt.figure("Cloud_reg") # cloud_reg1.paint() # plt.figure("S_Graph") # s1.paint(display_pipo,paint_order) return True