import cocotb
from cocotb.triggers import Timer
-from cocotb.utils import get_sim_steps
from cocotb.binary import BinaryValue
+class JTAGException(Exception):
+ pass
+
class JTAG_Clock(object):
"""
Class for the JTAG clock, run cycle by cycle
tdi <= 0
self.tdo = tdo
self.trst_n = trst_n
- trst_n <= 1
+ if trst_n is not None:
+ trst_n <= 1
self.period = Timer(clk_period)
# Standard commands
@cocotb.coroutine
def cycle_clock(self, cycles=1):
- if self.state == "Run" and self.tms:
+ if self.state == "Run" and self.tms == 1:
self.state = "Scan"
yield self.clkgen.Cycle(cycles)