Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Description

XPS_FX2 is a communication core to interface Xilinx Microblaze soft processor and a popular USB High Speed microcontroller Cypress CY7C68013A (also known as EzUSB FX2).

...

Info

Maximal supported bandwidth is normally limited by

Scroll Title
titleFD[7:0] bus pins: FPGA <-> USB FX2 microcontroller connection;

Pin Name

FPGA DirectionFX2 directionDescriptionIn the reference design case (1)
 FD[7:0] Bidirectional BidirectionalFD[0:7] are used for byte data transfer
between FPGA and USB FX2 μC.

If the custom IP blocks

  • XPS_FX2 (FX2 microcontroller ↔ FPGA) and

  • XPS_NPI_DMA (FPGA  ↔ DRAM memory)

and MicroBlaze API Commands (MB Commands)

are used, data bytes array could be transfered between

  • TE USB FX2 module's DRAM (MicroBlaze's software) and
  • host computer's memory (host computer's software)

(1) Reference design case: Logic Architecture Layer = Reference Architecture Layer and reference USB FX2 μC firmware used

 

Scroll Title
titleSystem integration block scheme

...

Scroll Title
titlePeripheral internal structure block scheme

XPS_FX2 Core Design Parameters

Scroll Title
titleXPS_FX2 Core Design Parameters
Feature/DescriptionParameter NameAllowable Values

Default Value

VHDL Type

  System Parameters

Target FPGA family

 

C_FAMILYspartan3, spartan3e,

spartan3a,

spartan3adsp,

spartan3an, virtex2p,

virtex4, qvirtex4,

qrvirtex4, virtex5

virtex5string
PLB Parameters
PLB base addressC_BASEADDRValid AddressNonestd_logic_vector
PLB high addressC_HIGHADDRValid AddressNonestd_logic_vector

PLB least significant address bus width

C_SPLB_AWIDTH3232integer
PLB data widthC_SPLB_DWIDTH32, 64, 12832integer

Shared bus topology

C_SPLB_P2P0 = Shared bus topology0integer

PLB master ID bus Width

C_SPLB_MID_WIDTH

log2(C_SPLB_NUM_

MASTERS) with a
minimum value of 1

1integer
Number of PLB mastersC_SPLB_NUM_MASTERS1 - 161integer

Width of the slave data bus

C_SPLB_NATIVE_DWIDTH3232integer
Burst supportC_SPLB_SUPPORT_BURSTS0 = No burst support0integer
XPS_FX2 Parameters
Size of Transmit FIFOC_TX_FIFO_KBYTE2, 4, 8,16,322integer
Size of Receive FIFOC_RX_FIFO_KBYTE0, 22integer
Using Address FIFO (1)C_USE_ADDR_FIFO0 (not working)0integer

Shift transmit FIFO clock by 180 degrees (2)

C_TX_FIFO_CLK_1800, 10integer
Note

(1) Address FIFO was designed to avoid FIFO draining before the EP ADDRESS changing. Will be fixed in further releases.

(2) Set to 1 only if the user experience 8-bit data shifting after a received packet of data. Normally set to 0.

XPS_FX2 Core I/O Signals

Scroll Title
titleXPS_FX2 I/O Signal Descriptions
NameInterfaceI/O

Initial State

Description

ChipScope[0:31]

-O-Debug port
USB_IFCLK-I-USB 48MHz clock
USB_SLRD-O0USB Data Read strobe
USB_SLWR-O0USB Data Write strobe

USB_FLAGA

-I-

USB programmable status flag (not used)

USB_FLAGB-I-USB TX FIFO full flag
USB_FLAGC-I-USB TX FIFO empty flag
USB_FLAGD-I-USB RX FIFO empty flag

USB_SLOE

-O0

Toggles FX2 IO buffer (1=read from USB)

USB_PKTEND

-O0

Commences current packet (if smaller than 512 bytes)

USB_FIFOADR[1:0]

-O0

Selects USB endpoint:

  • "00"=EP2,
  • "01"=EP4,
  • "10"=EP6,
  • "11"=EP8
USB_FD[7:0]-I/O0USB tristate data Bus
TX_FIFO_Clk-I-TX FIFO clock
RX_FIFO_Clk-I-RX FIFO clock
TX_FIFO_DIN[0:31]FIFO_INI-TX FIFO input data
TX_FIFO_VLDFIFO_INI-TX FIFO data valid strobe
TX_FIFO_RDYFIFO_INO0TX FIFO is ready flag
RX_FIFO_DOUT[0:31]FIFO_OUTOzerosRX FIFO output data
RX_FIFO_VLDFIFO_OUTO0RX FIFO data valid strobe
RX_FIFO_RDYFIFO_OUTI-RX FIFO is ready flag
IP2INTC_Irpt-O0Processor interrupt
OTHERS ARE PLBv4.6 SIGNALSPLBv4.6---

Writing and reading to/from FIFO_IN and FIFO_OUT ports

The point to point unidirectional buses use simple handshaking protocol.

...

Scroll Title
titleFIFO high speed communication ports principle of operation

XPS_FX2 Core Registers

XPS_FX2 has a full access of a microprocessor to the core functionality through a 5 user 32-bit and 7 IPIF Interrupt registers attached to PLBv4.6 bus.

...

Note

The First (LSB) interrupt from user_logic is masked on the left!!

Details of XPS_FX2 Core Registers

The parts of the registers (or the whole registers) with a non-capital designation (e.g. wr_fifo_rst) are usually the names of the HDL signals connected to the described register.

Control Register (CR)

The Control Register is used to control basic peripheral functions. All the bit flags are assembled here.

...

Info
titlePacket end timount and USB_PKTEND

(1) Endpoint EP8 is read only and is switched automatically when data arrives. To achieve maximal throughput use only one endpoint and prevent TX FIFO draining (TX FIFO empty should not occur).

(2) Packet end timeout timer automatically asserts USB_PKTEND signal when TX_FIFO is empty for a programmed number of cycles and current USB EndPoint FIFO is not empty.

Cycle timer is also reset when switched to EP8 – incoming data. The USB_PKTEND send current packet and enables the PC to receive packet smaller than 512 bytes. If user setup the timer properly then the packets are automatically send when there is no more data available in the TX_FIFO.

FIFOs Threshold Register (FTR)

This register is used to setup thresholds for interrupt triggering when FIFO occupancy reaches set number of words. For RX FIFO the prog_full flag goes high when number of words in a FIFO is higher than threshold. For TX FIFO the prog_empty flag goes high when number of words in a FIFO is lower than threshold.

...

Scroll Title
titleFIFOs Threshold Register (FTR) bits

Status Register (SR)

In the status register the peripheral reports of the current status. The tx_fifo_count can have 9-13 bits according to size of the TX_FIFO. This register is usually accessed using 16-bit reads

Scroll Title
titleStatus Register (SR) bits

 

BitsNameDescriptionReset Value
19-31tx_fifo_countTransmit FIFO occupancy in words0
18tx_fifo_overflowTransmit FIFO overflow flag0
17tx_fifo_fullTransmit FIFO full flag0
16tx_fifo_emptyTransmit FIFO empty flag1
7-15rx_fifo_countReceive FIFO occupancy in words0
3rx_fifo_prog_fullReceive FIFO programmable full flag0
2rx_fifo_underflowReceive FIFO underflow flag0
1rx_fifo_fullReceive FIFO full flag0
0rx_fifo_emptyReceive FIFO empty flag1
FIFO Write Register (FWR)

Single beat write to this register puts a single word (4 bytes) to TX FIFO. For proper operation PLB clock frequency should be less or equal to TX_FIFO_Clk.

FIFO Read Register (FRR)

Single beat read from this register pops one word (4 bytes) from RX FIFO. For proper operation PLB clock frequency should be less or equal to RX_FIFO_Clk.

Interrupt enable/pending registers

With INTR_IPIER register the user can enable/disable peripheral interrupt sources. With INTR_IPISR the user can identify interrupt source. Writing a value to INTR_IPISR also clears interrupt.

...

Scroll Title
titleInterrupt enable/pending registers

Programming model

Note
By setting control register (CR) make sure that user not override the previously set bits.

Example 1

Resetting the TX_FIFO:

1. Write 0x00000001 to CR

2. Write 0x00000000 to CR

Example 2

Resetting the RX_FIFO:

1. Write 0x00000002 to CR

2. Write 0x00000000 to CR

Example 3

Setting the endpoint address to EP4

1. Write 0x00000010 to CR

Example 4 (if Reference Design is used): test XPS_NPI_DMA and XPS_FX2 using MB Commands 

XPS_NPI_DMA and XPS_FX2 custom IP blocks are both necessary to connect  (throgh USB connection) host computer's software  and TE USB FX2 module's DRAM.

...