datasheets.com EBN.com EDN.com EETimes.com Embedded.com PlanetAnalog.com TechOnline.com  
Events
UBM Tech
UBM Tech

Design Article

Comment


elektryk321

8/30/2012 10:05 AM EDT

I have seen project where FPGA device was able to reprogram bootrom (in this ...

More...



Gopalakrishnan V

8/25/2012 10:58 AM EDT

Dear Eric,

If an FPGA comes with "connector-ready" USB functionality ...

More...

Configure FPGAs over USB

Gopalakrishnan Vijayakumar, Cypress Semiconductor

8/23/2012 9:49 AM EDT

Engineers have been striving for the past few decades to decrease the size of electronic systems as well as increase flexibility. With the advent of reprogrammable FPGAs, systems could be made that were less expensive and could be upgraded on the fly. This article discusses on how to configure FPGA-based systems over USB to implement the flexibility of in-field upgrades. This method can also serve to replace the popular JTAG configuration interface and eliminate the need for a separate JTAG connector on the board, hence reducing cost and board space.

FPGAs

Field Programmable Gate Arrays (FPGA) are simple programmable logic blocks with a massive fabric of electrically programmable interconnects between the logic blocks. An FPGA enables users to configure the logic blocks and the interconnections between the logic blocks. FPGAs were introduced to implement the entire functionality of a system on one chip and provide flexibility of reprogramming. Today, FPGAs cover a broad market of applications such as automotive, industrial, medical, consumer electronics networking, security, high performance computing, video and imaging, digital signal processing, etc.  We will see the various types of FPGA configuration in the below sections.

FPGA Configuration

FPGAs work in two modes: configuration mode and user mode. On power up, the FPGA enters the configuration mode for programming. Configuring a FPGA means sending a bit stream of ‘0’ and ‘1’ into the device through special pins. Once the FPGA is configured, it switches into user mode to perform the programmed logic function.

Most FPGAs use SRAM to store configuration data. Since SRAM is a volatile configuration, the configuration data needs to be downloaded to the SRAM upon power up.  These configurations can also be automatically loaded from non-volatile memories like PROM, SPI Flash, or an external processor chip. Microprocessors, microcontrollers and digital signal processors can also download the configuration data to the FPGA's SRAM. Apart from these methods, the configuration can be also be downloaded via the most popular JTAG interfaces, USB interfaces, etc.

Types of FPGA Configuration

Configuration of an FPGA can be performed by either placing the FPGA in master mode or slave mode. In Master mode, the FPGA generates the configuration clock and controls the configuration data. In this mode, the FPGA generally downloads the configuration bit stream from non-volatile memories like SPI, Flash, and PROM. When using a SPI Flash, the FPGA acts as a SPI master where the configuration is downloaded from this SPI Flash as shown in Figure 1A. In Figure 1B and Figure 1C, the FPGA downloads the configuration data from PROM.  Although non-volatile memory like PROM can be internal or external, it is usually external to the FPGA.


In this slave mode, the FPGA can be configured using external intelligent devices like microcontrollers, microprocessors, digital signal processors, etc. or using a JTAG or USB interface.

The three most commonly used methods smart devices like microcontroller, microprocessor, and DSPs use to load configuration data are synchronous serial, SPI slave, and parallel modes.

Synchronous serial interface


Usually two lines – data and clock – are used to download the configuration in this method. On the rising-edge of the configuration clock, the configuration data bits are shifted into the FPGA.

SPI slave mode


Here the FPGA acts as an SPI slave and an external microprocessor, microcontroller or DSP acts as the SPI master. The processor or the controller loads the configuration bit stream data from an off-chip memory source using the SPI lines.

Parallel Mode (8, 16 or 32 bit)

Most FPGAs have the option of 8/16/32-bit selection when configuration data are sent in parallel. This method is one of the fastest modes of loading the configuration data.


Configuration Using the JTAG Interface:

The JTAG interface is a four/ five pin serial interface. The five pins are TDI (Test Data In), TDO (Test Data Out), TCK (Test Clock), TMS (Test Mode Select), and TRST (Test Reset). The TRST pin is optional. JTAG is commonly used for hardware debugging and boundary scan testing. This interface can also be used for configuration programming.  Figure 5 shows the configuration signal mapping using the JTAG interface.


Configuring an FPGA Over a USB Interface

A high-speed USB interface can be integrated into an FPGA-based solution in the following ways:

  • USB protocol stack intellectual property (IP) with an external transceiver: In this method, the SIE IP is implemented within the FPGA or ASIC and used along with an external transceiver. This method offers the advantage that the hardware required is minimal. However, development of USB Stack IP will consume valuable time as well as engineering resources. On the other hand, the use of a third-party IP can prove costly. The implementation of the higher-level protocol and application functions also take up a significant amount of valuable FPGA resources.
  • USB Bridge IC with integrated SIE and transceiver: This technique interfaces an external serial interface engine as well as a transceiver to the FPGA. Signal-level protocol management is no longer handled within the FPGA. There are some savings here with respect to FPGA resources. However, higher-level USB protocol implementation is still done within the FPGA.  In this case, a decision would have to be arrived at by analyzing the cost of the external hardware required compared to the amount of FPGA resources saved. 

  • Controller + FPGA: This method interfaces the FPGA or ASIC to an intelligent USB controller IC that would take care of all the USB protocol level management. Controllers can offer the flexibility of a configurable number of endpoints, FIFO size, and may even contain a microcontroller to handle high-level USB protocol management. Such peripheral controllers may also contain the capability to handle some application-level functions, thus freeing the FPGA or ASIC from the need to perform them.





green_ee

8/24/2012 1:11 PM EDT

If there was a complete "connector-ready" USB endpoint on the FPGA device, I would say it's the coolest device I've seen all year. But it doesn't have this.

A USB-blaster connected to an Altera device accomplishes the same thing, and an onboard controller with a JTAG interface would effectively do the same.

Sign in to Reply



ewertz2

8/25/2012 12:36 AM EDT

If there was already "connector-ready" USB functionality inside the FPGA, there wouldn't be need for any intermediary device. The article stated as a given that this was an expensive use of FPGA resources -- a statement which you can separately debate depending on how much FPGA meat you've got flog.

I think that the point here is that, in lieu of hard or soft USB functionality inside the FPGA, that such a scheme can be used as a bi-directional USB interface for both bitstream downloading as well as a USB Device (and perhaps Host) interface when the FPGA is running. The interface from the FPGA to the bridge chip can be anything from 1-bit serial to N-bit parallel, because the bridge chip is programmable with a decent number of I/O pins.

I concede that I don't know what all the USB Blaster is capable of, but my understanding is that it was merely a barebones programming device. *If* it could be made to do anything useful post-programming, it would have to come back (in this case, the JTAG channel) out through the fairly dumb serial (or custom) driver on the host.

I think the point is that if you both want a direct USB interface for both programming and execution (starting at 10s Mb/sec), then this is one such solution. If don't care about USB for both uses, then yes, you can do with less.

Sign in to Reply



ewertz2

8/25/2012 1:12 AM EDT

"got flog" ... "got to flog"
"If don't" ... "If you don't".

Text, replace yourself above.

Sign in to Reply



Gopalakrishnan V

8/25/2012 10:58 AM EDT

Dear Eric,

If an FPGA comes with "connector-ready" USB functionality inside it, then there are no cost added to your application design. I am not sure whether there are any FPGAs which comes with built-in USB functionality.

In case of design where you need to add an USB functionality to the FPGA, more than the FPGA space, cost of USB IP to handle the protocol(either buying the IP or time involved in developing the IP) and external USB transceiver chip get added to your design cost and it becomes more expensive. USB protocol in itself is a complex implementaion unlike other communication protocol like SPI, I2C,etc. Please email me in gopv@cypress.com or gopalakrishnan.vijay@gmail.com if you have clarification questions or doubts regarding the USB protocol implementation in FPGA.

As stated in the article, only the design where an USB interface is already a requirement for general data transfer, this method would be a cost effective solution. I apologize if the article does not convey this information directly.

You are right that if USB data interface is never an requirement to the project, then there are lot many simpler and cost effective methods like JTAG that can be used for programming.

Sign in to Reply



cmathas

8/24/2012 2:24 PM EDT

Thanks for the post, I'm alerting the author--stay tuned.

Sign in to Reply



elektryk321

8/30/2012 10:05 AM EDT

I have seen project where FPGA device was able to reprogram bootrom (in this case EEPROM). There was only problem if the EEPROM or FPGA bitstream was broken wrongly written and FPGA won't start and reprogramm memory. I think USB debug interface in FPGA is stupid idea, JTAG is enought to do anything, and additional cost of USB-JTAG programmer is quite low. Of course if you want to have this capabilities just use small USB processor (like Cypress or Microchip) or FTDI USB chip, to do bit-bang emulation of JTAG or program bitstream memory.

Sign in to Reply



Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)