本文整理汇总了Python中group.Group.connected_vcc方法的典型用法代码示例。如果您正苦于以下问题:Python Group.connected_vcc方法的具体用法?Python Group.connected_vcc怎么用?Python Group.connected_vcc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类group.Group
的用法示例。
在下文中一共展示了Group.connected_vcc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_parent
# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import connected_vcc [as 别名]
def create_parent(child, forceOptimizer, debug):
"""
DESCRIPTION: builds recursive the parents of the groupe, which containts the block
when the algo reached the last parent, it will add them to the main group
PARAMETER: child The group which need a parent
STATE: finish
"""
if debug:
print "create parent for child:", child.group_id
group_id = child.group_id[: len(child.group_id) - 1] # remove the last ID
if debug:
print "parents ID:", group_id
group = search_group(group_id, forceOptimizer) # check if the group allready exists
if group is None: # create a new group if needed
group = Group(group_id)
forceOptimizer.groups.append(group)
if debug:
print "Parent not exist, create a new Group"
group.add_child(child)
child.parent = group
# check the connection to important pins
group.connected_gnd = 0
group.connected_vcc = 0
group.connected_out = 0
group.connected_inp = 0
for c in group.childs:
group.connected_gnd += c.connected_gnd
group.connected_vcc += c.connected_vcc
group.connected_out += c.connected_out
group.connected_inp += c.connected_inp
group.connected_parent_east = group.connected_out
group.connected_parent_south = group.connected_gnd
group.connected_parent_north = group.connected_vcc
# if group has parents create them
if len(group_id) > 1:
create_parent(group, forceOptimizer, debug)
# else add group to main group
else:
forceOptimizer.group_main.add_child(group)
group.parent = forceOptimizer.group_main