本文整理汇总了Python中pattern.Pattern.interface[m1_int_sel_out]方法的典型用法代码示例。如果您正苦于以下问题:Python Pattern.interface[m1_int_sel_out]方法的具体用法?Python Pattern.interface[m1_int_sel_out]怎么用?Python Pattern.interface[m1_int_sel_out]使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pattern.Pattern
的用法示例。
在下文中一共展示了Pattern.interface[m1_int_sel_out]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MyModule
# 需要导入模块: from pattern import Pattern [as 别名]
# 或者: from pattern.Pattern import interface[m1_int_sel_out] [as 别名]
np.zeros(5, dtype=np.float),
['interface', 'io', 'type'],
man.port_data, man.port_ctrl, man.port_time, 'm2 ', False,
True)
man.add_mod(m2)
m3 = MyModule(m3_int_sel, m3_int_sel_in, m3_int_sel_out,
np.zeros(4, dtype=np.float),
['interface', 'io', 'type'],
man.port_data, man.port_ctrl, man.port_time, 'm3 ', False,
True)
man.add_mod(m3)
# Make sure that all ports in the patterns' interfaces are set so
# that they match those of the modules:
pat12 = Pattern(m1_int_sel, m2_int_sel)
pat12.interface[m1_int_sel_out] = [0, 'in']
pat12.interface[m1_int_sel_in] = [0, 'out']
pat12.interface[m2_int_sel_in] = [1, 'out']
pat12.interface[m2_int_sel_out] = [1, 'in']
pat12['/a[2]', '/b[0]'] = 1
pat12['/a[3]', '/b[1]'] = 1
pat12['/b[3]', '/a[0]'] = 1
man.connect(m1, m2, pat12, 0, 1)
pat23 = Pattern(m2_int_sel, m3_int_sel)
pat23.interface[m2_int_sel_out] = [0, 'in']
pat23.interface[m2_int_sel_in] = [0, 'out']
pat23.interface[m3_int_sel_in] = [1, 'out']
pat23.interface[m3_int_sel_out] = [1, 'in']
pat23['/b[4]', '/c[0]'] = 1
pat23['/c[2]', '/b[2]'] = 1