def jtag_chain(isNeroCapable, argList, vp, handle): if argList.q: if isNeroCapable: chain = fl.jtagScanChain(handle, argList.q[0]) if len(chain) > 0: print("The FPGALink device at {} scanned its JTAG chain, yielding:".format(vp)) for idCode in chain: print(" 0x{:08X}".format(idCode)) else: print("The FPGALink device at {} scanned its JTAG chain but did not find any attached devices".format(vp)) else: raise fl.FLException("JTAG chain scan requested but FPGALink device at {} does not support NeroJTAG".format(vp))
def jtag_chain(isNeroCapable, argList, vp, handle): """ Tests the JTAG chain. Args: isNeroCapable(boolean): indicated if device is nero capable argList(namespace): populated namespaced object with necessary args vp(): vendor and product ID handle: An opaque reference to an internal structure representing the connection. """ if argList.q: if isNeroCapable: chain = fl.jtagScanChain(handle, argList.q[0]) if len(chain) > 0: print("The FPGALink device at {} scanned its JTAG chain, yielding:".format(vp)) for idCode in chain: print(" 0x{:08X}".format(idCode)) else: print("The FPGALink device at {} scanned its JTAG chain but did not find any attached devices".format(vp)) else: raise fl.FLException("JTAG chain scan requested but FPGALink device at {} does not support NeroJTAG".format(vp))
tec = [160, 220] for d in range(13, 23): for t in range(160, 225, 5): fl.flWriteChannel(handle, 14, d) fl.flWriteChannel(handle, 2, t) print("Delay: ", d, "TEC: ", t) print("FIFO Flags: ", fl.flReadChannel(handle, 57), "Data FIFO: ", fl.flReadChannel(handle, 60), "Error FIFO: ", fl.flReadChannel(handle, 61), "Ones FIFO: ", fl.flReadChannel(handle, 62)) time.sleep(.5) if (argList.q): if (isNeroCapable): chain = fl.jtagScanChain(handle, argList.q[0]) if (len(chain) > 0): print( "The FPGALink device at {} scanned its JTAG chain, yielding:" .format(vp)) for idCode in chain: print(" 0x{:08X}".format(idCode)) else: print( "The FPGALink device at {} scanned its JTAG chain but did not find any attached devices" .format(vp)) else: raise fl.FLException( "JTAG chain scan requested but FPGALink device at {} does not support NeroJTAG" .format(vp))
fl.jtagShiftInOnly(conn, 32, BYTE_ARRAY) bs = fl.jtagShiftInOut(conn, 128, fl.SHIFT_ONES) print("jtagShiftInOut() got {} bytes: {{\n {}\n}}".format( len(bs), " ".join(["{:02X}".format(b) for b in bs]))) fl.jtagClockFSM(conn, 0x0000005F, 9) fl.spiSend(conn, BYTE_ARRAY, fl.SPI_LSBFIRST) bs = fl.spiRecv(conn, 8, fl.SPI_LSBFIRST) print("spiRecv() got {} bytes: {{\n {}\n}}".format( len(bs), " ".join(["{:02X}".format(b) for b in bs]))) fl.progClose(conn) print("jtagScanChain(): {") for idCode in fl.jtagScanChain(conn, PROG_CONFIG): print(" 0x{:08X}".format(idCode)) print("}") print("flProgram()...") fl.flProgram(conn, "J:{}:../../../../hdlmake/apps/makestuff/swled/cksum/vhdl/fpga.xsvf".format(PROG_CONFIG)) print("...done.") fl.flSelectConduit(conn, CONDUIT) print("flIsFPGARunning(): {}".format(fl.flIsFPGARunning(conn))) fl.flWriteChannel(conn, 0, BYTE_ARRAY) bs = fl.flReadChannel(conn, 1, 16) print("flReadChannel(1, 16) got {} bytes: {{\n {}\n}}".format( len(bs),
rb[0:4], rb[4:8], rb[8:12], rb[12:16], rb[16:20], rb[20:24], rb[24:28], rb[28:32] ) ) fl.flSleep(100) conduit = 1 if argList.c: conduit = int(argList.c[0]) isNeroCapable = fl.flIsNeroCapable(handle) isCommCapable = fl.flIsCommCapable(handle, conduit) fl.flSelectConduit(handle, conduit) if argList.q: if isNeroCapable: chain = fl.jtagScanChain(handle, argList.q[0]) if len(chain) > 0: print("The FPGALink device at {} scanned its JTAG chain, yielding:".format(vp)) for idCode in chain: print(" 0x{:08X}".format(idCode)) else: print( "The FPGALink device at {} scanned its JTAG chain but did not find any attached devices".format(vp) ) else: raise fl.FLException( "JTAG chain scan requested but FPGALink device at {} does not support NeroJTAG".format(vp) ) if argList.p: progConfig = argList.p[0]