示例#1
0
    def test_assert_fastsimulation(self):
        i = pyrtl.Input(1)
        o = pyrtl.rtl_assert(i, self.RTLSampleException('test assertion failed'))

        sim = pyrtl.FastSimulation()
        sim.step({i: 1})
        self.assertEquals(sim.inspect(o), 1)

        with self.assertRaises(self.RTLSampleException):
            sim.step({i: 0})
示例#2
0
 def test_create_assert(self):
     w = pyrtl.WireVector(1)
     pyrtl.rtl_assert(w, self.RTLSampleException('testing rtl assert'))
示例#3
0
 def test_duplicate_assert(self):
     w = pyrtl.Input(1)
     pyrtl.rtl_assert(w, self.RTLSampleException())
     pyrtl.rtl_assert(w, self.RTLSampleException())
示例#4
0
 def bad_rtl_assert(self, *args, **kwargs):
     with self.assertRaises(pyrtl.PyrtlError):
         pyrtl.rtl_assert(*args, **kwargs)
示例#5
0
 def test_create_assert(self):
     w = pyrtl.WireVector(1)
     pyrtl.rtl_assert(w, self.RTLSampleException('testing rtl assert'))
示例#6
0
 def test_duplicate_assert(self):
     w = pyrtl.Input(1)
     pyrtl.rtl_assert(w, self.RTLSampleException())
     pyrtl.rtl_assert(w, self.RTLSampleException())
示例#7
0
 def bad_rtl_assert(self, *args, **kwargs):
     with self.assertRaises(pyrtl.PyrtlError):
         pyrtl.rtl_assert(*args, **kwargs)