当前位置: 首页>>代码示例>>Python>>正文


Python _always_comb.always_comb函数代码示例

本文整理汇总了Python中myhdl._always_comb.always_comb函数的典型用法代码示例。如果您正苦于以下问题:Python always_comb函数的具体用法?Python always_comb怎么用?Python always_comb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了always_comb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testArgIsNormalFunction

 def testArgIsNormalFunction(self):
     def h():
         yield None
     try:
         always_comb(h)
     except AlwaysCombError, e:
         self.assertEqual(e.kind, _error.ArgType)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:7,代码来源:test_always_comb.py

示例2: testArgHasNoArgs

 def testArgHasNoArgs(self):
     def h(n):
         return n
     try:
         always_comb(h)
     except AlwaysCombError, e:
         self.assertEqual(e.kind, _error.NrOfArgs)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:7,代码来源:test_always_comb.py

示例3: testArgIsFunction

 def testArgIsFunction(self):
     h = 5
     try:
         always_comb(h)
     except AlwaysCombError as e:
         self.assertEqual(e.kind, _error.ArgType)
     else:
         self.fail()
开发者ID:Cadavis8,项目名称:myhdl,代码行数:8,代码来源:test_always_comb.py

示例4: testInfer6

    def testInfer6(self):
        a, b, c, d = [Signal(0) for i in range(4)]

        def h():
            c.next = a
            x.next = c
        with raises_kind(AlwaysCombError, _error.SignalAsInout % set('c')):
            g = always_comb(h).gen
开发者ID:Aravind-Suresh,项目名称:myhdl,代码行数:8,代码来源:test_always_comb.py

示例5: testInfer9

 def testInfer9(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     def h():
         c.next[a-1] = x[b-1]
     g = always_comb(h).gen
     i = g.gi_frame.f_locals['self']
     expected = Set(['a', 'b', 'x'])
     self.assertEqual(i.inputs, expected)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:8,代码来源:test_always_comb.py

示例6: testInfer5

    def testInfer5(self):
        a, b, c, d = [Signal(0) for i in range(4)]

        def h():
            c.next += 1
            a += 1
        with raises_kind(AlwaysCombError, _error.SignalAsInout % "c"):
            g = always_comb(h).gen
开发者ID:jmgc,项目名称:myhdl-numeric,代码行数:8,代码来源:test_always_comb.py

示例7: testInfer7

    def testInfer7(self):
        a, b, c, d = [Signal(0) for i in range(4)]

        def h():
            c.next[a:0] = x[b:0]
        g = always_comb(h).gen
        i = g.gi_frame.f_locals['self']
        expected = set(['a', 'b', 'x'])
        assert i.inputs == expected
开发者ID:Aravind-Suresh,项目名称:myhdl,代码行数:9,代码来源:test_always_comb.py

示例8: testInfer6

 def testInfer6(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     def h():
         c.next = a
         x.next = c
     try:
         g = always_comb(h).gen
     except AlwaysCombError, e:
         self.assertEqual(e.kind, _error.SignalAsInout)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:9,代码来源:test_always_comb.py

示例9: testInfer1

 def testInfer1(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     u = 1
     def h():
         c.next = a
         v = u
     g = always_comb(h).gen
     i = g.gi_frame.f_locals['self']
     expected = Set(['a'])
     self.assertEqual(i.inputs, expected)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:10,代码来源:test_always_comb.py

示例10: testInfer10

 def testInfer10(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     def f(x, y, z):
         return 0
     def h():
         c.next = f(a, 2*b, d*x)
     g = always_comb(h).gen
     i = g.gi_frame.f_locals['self']
     expected = Set(['a', 'b', 'd', 'x'])
     self.assertEqual(i.inputs, expected)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:10,代码来源:test_always_comb.py

示例11: testInfer8

 def testInfer8(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     u = 1
     def h():
         v = 2
         c.next[8:1+a+v] = x[4:b*3+u]
     g = always_comb(h).gen
     i = g.gi_frame.f_locals['self']
     expected = Set(['a', 'b', 'x'])
     self.assertEqual(i.inputs, expected)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:10,代码来源:test_always_comb.py

示例12: testInfer3

    def testInfer3(self):
        a, b, c, d = [Signal(0) for i in range(4)]
        u = 1

        def h():
            c.next = a + x + u
            a = 1
        g = always_comb(h).gen
        i = g.gi_frame.f_locals['self']
        expected = set(['x'])
        assert i.inputs == expected
开发者ID:Aravind-Suresh,项目名称:myhdl,代码行数:11,代码来源:test_always_comb.py

示例13: testInfer5

 def testInfer5(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     def h():
         c.next += 1
         a += 1
     try:
         g = always_comb(h).gen
     except AlwaysCombError as e:
         self.assertEqual(e.kind, _error.SignalAsInout % "c")
     else:
         self.fail()
开发者ID:Cadavis8,项目名称:myhdl,代码行数:11,代码来源:test_always_comb.py

示例14: testEmbeddedFunction

    def testEmbeddedFunction(self):
        a, b, c, d = [Signal(0) for i in range(4)]
        u = 1

        def h():
            def g():
                e = b
                return e
            c.next = x
            g = a
        with raises_kind(AlwaysCombError, _error.EmbeddedFunction):
            g = always_comb(h)
开发者ID:Aravind-Suresh,项目名称:myhdl,代码行数:12,代码来源:test_always_comb.py

示例15: testEmbeddedFunction

 def testEmbeddedFunction(self):
     a, b, c, d = [Signal(0) for i in range(4)]
     u = 1
     def h():
         def g():
             e = b
             return e
         c.next = x
         g = a
     try:
         g = always_comb(h)
     except AlwaysCombError, e:
         self.assertEqual(e.kind, _error.EmbeddedFunction)
开发者ID:BackupTheBerlios,项目名称:osocgen-svn,代码行数:13,代码来源:test_always_comb.py


注:本文中的myhdl._always_comb.always_comb函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。