コード例 #1
0
    def test2(self):
        def g():
            yield delay(10)

        i = g()
        with raises_kind(SimulationError, _error.DuplicatedArg):
            Simulation(i, i)
コード例 #2
0
    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
コード例 #3
0
ファイル: test_always_comb.py プロジェクト: Thomasb81/myhdl
    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
コード例 #4
0
    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
コード例 #5
0
ファイル: test_always_comb.py プロジェクト: Thomasb81/myhdl
    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)
コード例 #6
0
    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)
コード例 #7
0
ファイル: test_always_seq.py プロジェクト: Thomasb81/myhdl
def test_clock():
    """ check the edge parameter """

    # should fail without a valid Signal
    clock = Signal(bool(0))
    reset = ResetSignal(0, active=0, async=True)

    with raises_kind(AlwaysSeqError, _error.EdgeType):
        @always_seq(clock, reset=reset)
        def logic1():
            pass

    # should work with a valid Signal
    clock = Signal(bool(0))
    try:
        @always_seq(clock.posedge, reset=reset)
        def logic2():
            pass
    except:
        assert False
コード例 #8
0
 def testDecArgType2(self):
     with raises_kind(AlwaysError, _error.DecArgType):
         @always(g)
         def h(n):
             return n
コード例 #9
0
ファイル: test_instance.py プロジェクト: jmgc/myhdl-numeric
 def testArgIsGeneratorFunction(self):
     with raises_kind(InstanceError, _error.ArgType):
         @instance
         def h():
             return None
コード例 #10
0
 def testWrongExe(self):
     with raises_kind(CosimulationError, _error.OSError):
         Cosimulation('bla -x 45')
コード例 #11
0
 def testNoComm(self):
     with raises_kind(CosimulationError, _error.NoCommunication):
         Cosimulation(exe + "cosimNoComm", **allSigs)
コード例 #12
0
ファイル: test_Cosimulation.py プロジェクト: Thomasb81/myhdl
 def testTimeZero(self):
     with raises_kind(CosimulationError, _error.TimeZero):
         Cosimulation(exe + "cosimTimeZero", **allSigs)
コード例 #13
0
ファイル: test_instance.py プロジェクト: jmgc/myhdl-numeric
 def testArgHasNoArgs(self):
     with raises_kind(InstanceError, _error.NrOfArgs):
         @instance
         def h(n):
             yield n
コード例 #14
0
ファイル: test_instance.py プロジェクト: Thomasb81/myhdl
    def testArgIsGeneratorFunction(self):
        with raises_kind(InstanceError, _error.ArgType):

            @instance
            def h():
                return None
コード例 #15
0
 def testArgIsFunction(self):
     h = 5
     with raises_kind(AlwaysCombError, _error.ArgType):
         always_comb(h)
コード例 #16
0
ファイル: test_traceSignals.py プロジェクト: Thomasb81/myhdl
 def testArgType1(self, vcd_dir):
     with raises_kind(TraceSignalsError, _error.ArgType):
         dut = traceSignals([1, 2])
コード例 #17
0
ファイル: test_Cosimulation.py プロジェクト: Thomasb81/myhdl
 def testNotUnique(self):
     cosim1 = Cosimulation(exe + "cosimNotUnique", **allSigs)
     with raises_kind(CosimulationError, _error.MultipleCosim):
         Cosimulation(exe + "cosimNotUnique", **allSigs)
コード例 #18
0
ファイル: test_Cosimulation.py プロジェクト: Thomasb81/myhdl
 def testWrongExe(self):
     with raises_kind(CosimulationError, _error.OSError):
         Cosimulation('bla -x 45')
コード例 #19
0
ファイル: test_Cosimulation.py プロジェクト: Thomasb81/myhdl
 def testToSignalsDupl(self):
     with raises_kind(CosimulationError, _error.DuplicateSigNames):
         Cosimulation(exe + "cosimToSignalsDupl", **allSigs)
コード例 #20
0
ファイル: test_Cosimulation.py プロジェクト: Thomasb81/myhdl
 def testNoComm(self):
     with raises_kind(CosimulationError, _error.NoCommunication):
         Cosimulation(exe + "cosimNoComm", **allSigs)
コード例 #21
0
    def testArgHasNoArgs(self):
        def h(n):
            return n

        with raises_kind(AlwaysCombError, _error.NrOfArgs):
            always_comb(h)
コード例 #22
0
ファイル: test_instance.py プロジェクト: Thomasb81/myhdl
 def testArgIsFunction(self):
     h = 5
     with raises_kind(InstanceError, _error.ArgType):
         instance(h)
コード例 #23
0
ファイル: test_Simulation.py プロジェクト: jmgc/myhdl-numeric
 def test2(self):
     def g():
         yield delay(10)
     i = g()
     with raises_kind(SimulationError, _error.DuplicatedArg):
         Simulation(i, i)
コード例 #24
0
ファイル: test_instance.py プロジェクト: Thomasb81/myhdl
    def testArgHasNoArgs(self):
        with raises_kind(InstanceError, _error.NrOfArgs):

            @instance
            def h(n):
                yield n
コード例 #25
0
ファイル: test_traceSignals.py プロジェクト: Thomasb81/myhdl
 def testMultipleTraces(self, vcd_dir):
     with raises_kind(TraceSignalsError, _error.MultipleTraces):
         dut = top3()
コード例 #26
0
ファイル: test_always_comb.py プロジェクト: Thomasb81/myhdl
 def testArgIsFunction(self):
     h = 5
     with raises_kind(AlwaysCombError, _error.ArgType):
         always_comb(h)
コード例 #27
0
ファイル: test_traceSignals.py プロジェクト: Thomasb81/myhdl
 def testReturnVal(self, vcd_dir):
     from myhdl import ExtractHierarchyError
     from myhdl._extractHierarchy import _error
     kind = _error.InconsistentToplevel % (2, "dummy")
     with raises_kind(ExtractHierarchyError, kind):
         dut = traceSignals(dummy)
コード例 #28
0
    def testArgIsNormalFunction(self):
        def h():
            yield None

        with raises_kind(AlwaysCombError, _error.ArgType):
            always_comb(h)
コード例 #29
0
ファイル: test_always_comb.py プロジェクト: Thomasb81/myhdl
 def testArgIsNormalFunction(self):
     def h():
         yield None
     with raises_kind(AlwaysCombError, _error.ArgType):
         always_comb(h)
コード例 #30
0
ファイル: test_Simulation.py プロジェクト: jmgc/myhdl-numeric
 def test1(self):
     with raises_kind(SimulationError, _error.ArgType):
         Simulation(None)
コード例 #31
0
ファイル: test_always_comb.py プロジェクト: Thomasb81/myhdl
 def testArgHasNoArgs(self):
     def h(n):
         return n
     with raises_kind(AlwaysCombError, _error.NrOfArgs):
         always_comb(h)
コード例 #32
0
 def test1(self):
     with raises_kind(SimulationError, _error.ArgType):
         Simulation(None)
コード例 #33
0
 def testArgIsFunction(self):
     h = 5
     with raises_kind(AlwaysError, _error.ArgType):
         always(delay(3))(h)
コード例 #34
0
 def testTimeZero(self):
     with raises_kind(CosimulationError, _error.TimeZero):
         Cosimulation(exe + "cosimTimeZero", **allSigs)
コード例 #35
0
 def testArgIsNormalFunction(self):
     with raises_kind(AlwaysError, _error.ArgType):
         @always(delay(3))
         def h():
             yield None
コード例 #36
0
 def testToSignalsDupl(self):
     with raises_kind(CosimulationError, _error.DuplicateSigNames):
         Cosimulation(exe + "cosimToSignalsDupl", **allSigs)
コード例 #37
0
 def testArgHasNoArgs(self):
     with raises_kind(AlwaysError, _error.NrOfArgs):
         @always(delay(3))
         def h(n):
             return n
コード例 #38
0
 def testNotUnique(self):
     cosim1 = Cosimulation(exe + "cosimNotUnique", **allSigs)
     with raises_kind(CosimulationError, _error.MultipleCosim):
         Cosimulation(exe + "cosimNotUnique", **allSigs)
コード例 #39
0
ファイル: test_instance.py プロジェクト: jmgc/myhdl-numeric
 def testArgIsFunction(self):
     h = 5
     with raises_kind(InstanceError, _error.ArgType):
         instance(h)