Toby Deitrich > Device-Jtag-USB-FTCJTAG > Device::Jtag::USB::FTCJTAG

Download:
Device-Jtag-USB-FTCJTAG-0.12b.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.12   Source  

NAME ^

Device::Jtag::USB::FTCJTAG - Perl extension for communicating with JTAG devices using the FTDI FTCJTAG driver.

SYNOPSIS ^

  use Device::Jtag::USB::FTCJTAG;
  my $jtag = Device::Jtag::USB::FTCJTAG->new();
  $jtag->write_dev_ir({dev => $devnum, imn => 'user1'});
  $jtag->write_dev_dr({dev => $devnum, vec => Bit::Vector->new_Hex(32, "12345678")});
  my $readvec = $jtag->read_dev_dr({dev => $devnum, nbits => 32});

DESCRIPTION ^

A JTAG device driver for Perl using the FTDI Chip FTCJTAG driver (see http://ftdichip.com/Projects/MPSSE/FTCJTAG.htm). The driver is designed for use with the FTDI Chip FT2232 USB UART/FIFO IC (see http://ftdichip.com/Products/FT2232C.htm). A hardware device is required which incorporates the FT2232 chip in a form that (a) connects to a PC's USB port on one end and (b) connects to the JTAG interface of a target device (or devices). One such device is the Amontec JTAGKey (see http://www.amontec.com/jtagkey.shtml).

EXPORT

None by default.

CONSTRUCTOR

new()

Creates the JTAGUSB object. This routine initializes the JTAGKey and then autodetects the device(s) on the JTAG scan chain. Currently only the following devices are defined, others must be added to the idcode_lookup subroutine manually.

Currently supported devices: XC3S1000_FT256, XC3S1200E_FT256, XCF04S_V020.

The values for the IDCODE and the instruction register commands are defined in the target device's BSDL file. These are typically available for download from the manufacturer's website. For BSDL models from Xilinx, visit "/www.xilinx.com/xlnx/xil_sw_updates_home.jsp#BSDL Models" in http:. A regular expression is used for the device's IDCODE because a given devices IDCODE will vary based upon package type, etc.

METHODS

write_dev_ir({dev => DEVICE_NUM, imn => INSTRUCTION_MNEMONIC, [end => ENDSTATE]})

Writes INSTRUCTION_MNEMONIC to JTAG instruction register of device number DEVICE_NUM of the scan chain, leaving that device in ENDSTATE when done. The INSTRUCTION must be the hash key of one of the instructions defined for DEVICE. If no ENDSTATE is supplied in the function call, a default of RUN_TEST_IDLE is assumed.

write_dev_dr({dev => DEVICE_NUM, vec => BIT::VECTOR_OBJECT, [end => ENDSTATE]})

Writes data contained in Bit::Vector object to JTAG data register of device number DEVICE_NUM of the scan chain, leaving that device in ENDSTATE when done. If no ENDSTATE is supplied in the function call, a default of RUN_TEST_IDLE is assumed. The Bit::Vector object is constructed using one of the Bit::Vector constructor methods, such as Bit::Vector->new_Hex(32, "12345678"). See Bit::Vector documenation for more information. The length of the Bit::Vector must match the size of the register being written in the JTAG target device.

read_dev_dr({dev => DEVICE, nbits => NUMBER_OF_BITS, [end => ENDSTATE]})

Reads NUMBER_OF_BITS bits from JTAG data register from device number DEVICE of the scan chain, leaving that device in ENDSTATE when done. If no ENDSTATE is supplied in the function call, a default of RUN_TEST_IDLE is assumed. The read data is returned as a Bit::Vector object. One can convert the Bit::Vector object to a viewable data value using one of the Bit::Vector conversion methods, such as $vector->to_Hex(). See Bit::Vector documenation for more information.

SEE ALSO ^

http://ftdichip.com/Projects/MPSSE/FTCJTAG.htm FTDI Chip FTCJTAG driver page.

http://ftdichip.com/Products/FT2232C.htm FTDI Chip FT2232 device page.

http://www.amontec.com/jtagkey.shtml Amontec JTAGKey device page.

http://www.xilinx.com/bvdocs/appnotes/xapp139.pdf Information on JTAG tap controllers.

TO DO ^

Add auto-assignment of IDCODE value and INSTRUCTION definitions from BSDL files.

HISTORY ^

AUTHOR ^

Toby Deitrich http://toby.deitrich.net/

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Toby Deitrich

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: