Exemplo n.º 1
0
class JtagTestCase(unittest.TestCase):
    def setUp(self):
        self.jtag = JtagEngine(trst=True, frequency=3E6)
        self.jtag.configure(vendor=0x403, product=0x6011, interface=1)
        self.jtag.reset()
        self.tool = JtagTool(self.jtag)

    def tearDown(self):
        del self.jtag

    def test_idcode_reset(self):
        """Read the IDCODE right after a JTAG reset"""
        self.jtag.reset()
        idcode = self.jtag.read_dr(32)
        self.jtag.go_idle()
        print "IDCODE (reset): 0x%x" % int(idcode)

    def test_idcode_sequence(self):
        """Read the IDCODE using the dedicated instruction"""
        instruction = JTAG_INSTR['IDCODE']
        self.jtag.write_ir(instruction)
        idcode = self.jtag.read_dr(32)
        self.jtag.go_idle()
        print "IDCODE (idcode): 0x%08x" % int(idcode)

    def _test_detect_ir_length(self):
        """Detect the instruction register length"""
        self.jtag.go_idle()
        self.jtag.capture_ir()
        self.tool.detect_register_size()
Exemplo n.º 2
0
class JtagTestCase(unittest.TestCase):

    def setUp(self):
        self.jtag = JtagEngine(trst=True, frequency=3E6)
        self.jtag.configure(vendor=0x403, product=0x6011, interface=1)
        self.jtag.reset()
        self.tool = JtagTool(self.jtag)

    def tearDown(self):
        del self.jtag

    def test_idcode_reset(self):
        """Read the IDCODE right after a JTAG reset"""
        self.jtag.reset()
        idcode = self.jtag.read_dr(32)
        self.jtag.go_idle()
        print "IDCODE (reset): 0x%x" % int(idcode)

    def test_idcode_sequence(self):
        """Read the IDCODE using the dedicated instruction"""
        instruction = JTAG_INSTR['IDCODE']
        self.jtag.write_ir(instruction)
        idcode = self.jtag.read_dr(32)
        self.jtag.go_idle()
        print "IDCODE (idcode): 0x%08x" % int(idcode)

    def _test_detect_ir_length(self):
        """Detect the instruction register length"""
        self.jtag.go_idle()
        self.jtag.capture_ir()
        self.tool.detect_register_size()
Exemplo n.º 3
0
 def setUp(self):
     self.jtag = JtagEngine(trst=True, frequency=3E6)
     self.jtag.configure(vendor=0x403, product=0x6011, interface=1)
     self.jtag.reset()
     self.tool = JtagTool(self.jtag)
Exemplo n.º 4
0
 def setUp(self):
     self.jtag = JtagEngine(trst=True, frequency=3E6)
     self.jtag.configure(vendor=0x403, product=0x6011, interface=1)
     self.jtag.reset()
     self.tool = JtagTool(self.jtag)