예제 #1
0
 def testBackupOutputFile(self, vcd_dir):
     p = "%s.vcd" % fun.__name__
     dut = traceSignals(fun)
     Simulation(dut).run(1000, quiet=QUIET)
     _simulator._tf.close()
     _simulator._tracing = 0
     size = path.getsize(p)
     pbak = p + '.' + str(path.getmtime(p))
     assert not path.exists(pbak)
     dut = traceSignals(fun)
     _simulator._tf.close()
     _simulator._tracing = 0
     assert path.exists(p)
     assert path.exists(pbak)
     assert path.getsize(pbak) == size
     assert path.getsize(p) < size
예제 #2
0
 def testArgType1(self):
     try:
         dut = traceSignals([1, 2])
     except TraceSignalsError as e:
         self.assertEqual(e.kind, _error.ArgType)
     else:
         self.fail()
예제 #3
0
 def testBackupOutputFile(self, vcd_dir):
     p = "%s.vcd" % fun.__name__
     dut = traceSignals(fun)
     Simulation(dut).run(1000, quiet=QUIET)
     _simulator._tf.close()
     _simulator._tracing = 0
     size = path.getsize(p)
     pbak = p + '.' + str(path.getmtime(p))
     assert not path.exists(pbak)
     dut = traceSignals(fun)
     _simulator._tf.close()
     _simulator._tracing = 0
     assert path.exists(p)
     assert path.exists(pbak)
     assert path.getsize(pbak) == size
     assert path.getsize(p) < size
예제 #4
0
 def testReturnVal(self):
     from myhdl import ExtractHierarchyError
     from myhdl._extractHierarchy import _error
     try:
         dut = traceSignals(dummy)
     except ExtractHierarchyError, e:
         self.assertEqual(e.kind, _error.InconsistentToplevel % (2, "dummy"))
예제 #5
0
 def testBackupOutputFile(self):
     p = "%s.vcd" % fun.func_name
     dut = traceSignals(fun)
     Simulation(dut).run(1000, quiet=QUIET)
     _simulator._tf.close()
     _simulator._tracing = 0
     size = path.getsize(p)
     pbak = p + '.' + str(path.getmtime(p))
     self.assert_(not path.exists(pbak))
     dut = traceSignals(fun)
     _simulator._tf.close()
     _simulator._tracing = 0
     self.assert_(path.exists(p))
     self.assert_(path.exists(pbak))
     self.assert_(path.getsize(pbak) == size)
     self.assert_(path.getsize(p) < size)
예제 #6
0
 def testBackupOutputFile(self):
     p = "%s.vcd" % fun.func_name
     dut = traceSignals(fun)
     Simulation(dut).run(1000, quiet=QUIET)
     _simulator._tf.close()
     _simulator._tracing = 0
     size = path.getsize(p)
     pbak = p + '.' + str(path.getmtime(p))
     self.assert_(not path.exists(pbak))
     dut = traceSignals(fun)
     _simulator._tf.close()
     _simulator._tracing = 0
     self.assert_(path.exists(p))
     self.assert_(path.exists(pbak))
     self.assert_(path.getsize(pbak) == size)
     self.assert_(path.getsize(p) < size)
예제 #7
0
 def testReturnVal(self):
     from myhdl import ExtractHierarchyError
     from myhdl._extractHierarchy import _error
     try:
         dut = traceSignals(dummy)
     except ExtractHierarchyError, e:
         self.assertEqual(e.kind,
                          _error.InconsistentToplevel % (2, "dummy"))
예제 #8
0
 def testSetDirectory(self, vcd_dir):
     traceSignals.directory = 'some_vcd_dir'
     os.mkdir(path.join(str(vcd_dir), traceSignals.directory))
     pdut = "%s.vcd" % top.__name__
     psub = "%s.vcd" % fun.__name__
     pdutd = path.join(traceSignals.directory, "%s.vcd" % top.__name__)
     psubd = path.join(traceSignals.directory, "%s.vcd" % fun.__name__)
     dut = traceSignals(top)
     assert not path.exists(pdut)
     assert not path.exists(psub)
     assert path.exists(pdutd)
     assert not path.exists(psubd)
예제 #9
0
 def testSetDirectory(self, vcd_dir):
     traceSignals.directory = 'some_vcd_dir'
     os.mkdir(path.join(str(vcd_dir), traceSignals.directory))
     pdut = "%s.vcd" % top.__name__
     psub = "%s.vcd" % fun.__name__
     pdutd = path.join(traceSignals.directory, "%s.vcd" % top.__name__)
     psubd = path.join(traceSignals.directory, "%s.vcd" % fun.__name__)
     dut = traceSignals(top)
     assert not path.exists(pdut)
     assert not path.exists(psub)
     assert path.exists(pdutd)
     assert not path.exists(psubd)
예제 #10
0
def topTristate():
    inst = traceSignals(tristate)
    return inst
예제 #11
0
 def testHierarchicalTrace2(self):
     pdut = "%s.vcd" % top.func_name
     psub = "%s.vcd" % fun.func_name
     dut = traceSignals(top)
     self.assert_(path.exists(pdut))
     self.assert_(not path.exists(psub))
예제 #12
0
def topTristate():
    inst = traceSignals(tristate())
    return inst
예제 #13
0
 def testArgType1(self):
     try:
         dut = traceSignals([1, 2])
     except TraceSignalsError, e:
         self.assertEqual(e.kind, _error.ArgType)
예제 #14
0
 def testArgType1(self, vcd_dir):
     with raises_kind(TraceSignalsError, _error.ArgType):
         dut = traceSignals([1, 2])
예제 #15
0
 def testHierarchicalTrace2(self):
     pdut = "%s.vcd" % top.__name__
     psub = "%s.vcd" % fun.__name__
     dut = traceSignals(top)
     self.assertTrue(path.exists(pdut))
     self.assertTrue(not path.exists(psub))
예제 #16
0
 def testHierarchicalTrace2(self, vcd_dir):
     pdut = "%s.vcd" % top.__name__
     psub = "%s.vcd" % fun.__name__
     dut = traceSignals(top())
     assert path.exists(pdut)
     assert not path.exists(psub)
예제 #17
0
 def testHierarchicalTrace2(self, vcd_dir):
     pdut = "%s.vcd" % top.__name__
     psub = "%s.vcd" % fun.__name__
     dut = traceSignals(top)
     assert path.exists(pdut)
     assert not path.exists(psub)
예제 #18
0
 def testArgType1(self, vcd_dir):
     with raises_kind(TraceSignalsError, _error.ArgType):
         dut = traceSignals([1, 2])
예제 #19
0
 def testHierarchicalTrace2(self):
     pdut = "%s.vcd" % top.func_name
     psub = "%s.vcd" % fun.func_name
     dut = traceSignals(top)
     self.assert_(path.exists(pdut))
     self.assert_(not path.exists(psub))
예제 #20
0
 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)
예제 #21
0
def top2():
    inst = [{} for i in range(4)]
    j = 3
    inst[j-2]['key'] = traceSignals(fun)
    return inst
예제 #22
0
def top():
    inst = traceSignals(fun)
    return inst
예제 #23
0
 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)
예제 #24
0
def top():
    inst = traceSignals(fun)
    return inst
예제 #25
0
def top2():
    inst = [{} for i in range(4)]
    j = 3
    inst[j - 2]['key'] = traceSignals(fun)
    return inst
예제 #26
0
def top3():
    inst_1 = traceSignals(fun)
    inst_2 = traceSignals(fun)
    return inst_1, inst_2
예제 #27
0
def top3():
    inst_1 = traceSignals(fun)
    inst_2 = traceSignals(fun)
    return inst_1, inst_2