Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

XPS_NPI_DMA is high performance direct memory access (DMA) engine which seamlessly integrates into Xilinx EDK environment (figure below). It is highly flexible due to full access of the softcore MicroBlaze to the XPS_NPI_DMA core functionality through 9 32-bit registers attached to PLBv4.6 bus.

...

Scroll Title
titlePeripheral internal structure block scheme

XPS_NPI_DMA Core Design Parameters

Scroll Title
titleXPS_NPI_DMA Core Design Parameters
Feature/DescriptionParameter Name Allowable ValuesDefault ValueVHDL Type
System Parameters
Target FPGA familyC_FAMILY spartan3, 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 topologyC_SPLB_P2P 0 = Shared bus
topology

0integer
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_NPI_DMA Parameters
NPI bus data widthC_NPI_DATA_WIDTH32, 6432integer
Byte swap input dataC_SWAP_INPUT0, 10integer
Byte swap output dataC_SWAP_OUTPUT0, 10integer
Writing padding value
if number of bytes does
not match multiple of
packet size
C_PADDING_BE0, 1 (zeros, ones)0integer

XPS_NPI_DMA I/O Signal Descriptions

Scroll Title
titleXPS_NPI_DMA I/O Signal Descriptions
Name

InterfaceI/OInitial StateDescription
NPI_Clk-I-Memory clock
ChipScope[0:63]-O-Debug port
IP2INTC_IrptInterrupt request
LEVEL_HIGH
Capture_data[(C_NPI_DATA_WIDTH-1):0]DMA_INI-Sync DMA Input data
Capture_validDMA_INSync DMA Input valid strobe
Capture_readyDMA_IN DMA Input is ready flag
Output_data[(C_NPI_DATA_WIDTH-1):0]DMA_OUT 

DMA Output data,
Sync to NPI_Clk

Output_validDMA_OUT DMA Output valid strobe,
sync to NPI_Clk
Output_readyDMA_OUTExternal Output ready
NPI_Addr[31:0]MPMC_PIMOzerosNPI address data
NPI_AddrReqMPMC_PIMO0NPI address request
NPI_AddrAckMPMC_PIM NPI address acknowledge
NPI_RNWMPMC_PIMO0NPI read now write
NPI_Size[3:0]MPMC_PIM NPI packet size
See below for info
NPI_RdModWrMPMC_PIM ONPI read mod write
(not used)
NPI_WrFIFO_Data[(C_NPI_DATA_WIDTH-1):0]MPMC_PIM zeros NPI write FIFO data vector
NPI_WrFIFO_BE[(C_NPI_DATA_WIDTH/8-1):0]MPMC_PIM ones NPI write FIFO byte enable mask
(alway ones)
NPI_WrFIFO_PushMPMC_PIM NPI write FIFO data valid strobe
NPI_RdFIFO_Data[(C_NPI_DATA_WIDTH-1):0]MPMC_PIMNPI read FIFO data vector
NPI_RdFIFO_PopMPMC_PIM NPI read FIFO data read strobe
NPI_RdFIFO_RdWdAddr[3:0]MPMC_PIM NPI read FIFO read write addr
(not used)
NPI_WrFIFO_EmptyMPMC_PIM NPI write FIFO empty flag
NPI_WrFIFO_AlmostFullMPMC_PIMI-NPI write FIFO almost full flag
NPI_WrFIFO_FlushMPMC_PIMO0NPI write FIFO reset
NPI_RdFIFO_EmptyMPMC_PIM NPI read FIFO empty flag
NPI_RdFIFO_FlushMPMC_PIMO0NPI read FIFO reset
NPI_RdFIFO_Latency[1:0]MPMC_PIM ‘’01’’ NPI read FIFO latency
NPI_InitDoneMPMC_PIMI-MPMC init done flag
OTHERS ARE PLBv4.6 SIGNALSPLBv4.6---

Writing and reading to/from DMA_IN and DMA_OUT ports

The point to point unidirectional buses use simple handshaking protocol.

...

Scroll Title
titleDMA high speed communication ports principle of operation

XPS_NPI_DMA Core Registers

XPS_NPI_DMA has a full access of a microprocessor to the core functionality through a 9 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_NPI_DMA Core Regi sters

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.

Scroll Title
titleControl Register bits

BitsNameDescription ResetValue

31

rst

Peripheral soft reset (not self resettable)

 

0
30

wr_fifo_rst

 

Write FIFO reset (not self resettable)0
29rd_fifo_rstRead FIFO reset (not self resettable)0
28wr_loopWrite loop – continuous transfer0
27rd_loopRead loop – continuous transfer0

26

wr_test

 

Write test – writes 32bit counter to memory0
25xfer_writeWrite data flag (starts/stops xfer)0
24xfer_readRead data flag (starts/stops xfer)0
20-23wr_block_sizeWrite block size0x0
16-19rd_block_sizeRead block size0x0
15use_rd_jumpEnables transpose0
Write Start Address Register (WSA)

Here, the user inputs start address for writing transfer. It is an external memory address for the first byte to be written.

...

Scroll Title
titlewr_start_addr

Write Bytes Register (WBR)

Here, the user inputs the number of bytes to written to memory. It is not necessary to align the number of bytes to block size, since the remaining bytes will be padded. If the user sets wr_loop to 1 then the WSA+WBR is the maximal address before the address counter jumps to WSA and starts counting again.

Scroll Title
titlewr_xfer_bytes

Read Start Address Register (RSA)

Here, the user inputs start address for reading transfer. It is an external memory address for the first byte to be read.

...

Scroll Title
titlerd_start_addr

Read Bytes Register (RBR)

Here, the user inputs the number of bytes to be read from the memory. It is not necessary to align the number of bytes to block size, since the remaining bytes will remain in the RdFIFO. If the user sets rd_loop to 1 then the when the byte counter reaches RBR values jumps to 0 (RSA address) and starts counting again.

Scroll Title
titlerd_xfer_bytes

Read Jumps Register (RJR)

This register is used to input two16bit values to define the reading jumping startegy/algorithm. The read_jump is an address increment between two consecutive reads. If the user want linear read then this is a number of bytes per read block (4 or 8 for single beat xfer). When rotating (transposing) an image this should equal to number of bytes in a row. The parameter rows define how many reads should be done before returning to starting position+block size.

...

Scroll Title
titleRead Jumps Register (RJR)

Status Register (SR)

In the status register the peripheral reports of the current status.

Scroll Title
titleStatus Register (SR)

BitsNameDescriptionReset Value
31wr_xfer_done

Write xfer done flag (always 0 if wr_loop = '1')

1
30rd_xfer_done

Read xfer done flag (always 0 if wr_loop = 1)

1
24-27xfer_statusWrite xfer status (bit 27 = wr_fifo_full)0
Write Address Counter Register (WCR)

Reading this register returns current WRITE address counter value. It can be used to monitor write transfer progress.

Scroll Title
titlewr_xfer_counter

Read Address Counter Register (RCR)

Reading this register returns current READ address counter value. It can be used to monitor read transfer progress.

Scroll Title
titlerd_xfer_counter

Interrupt 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
titleConection of user logic interrupt to INTR_IPIER and INTR_IPISR.

Programmin model

Info
In the instruction sequence it is only important that xfer_write or xfer_read are written at the end as they start the transmission.

...

Scroll Title
titleRead block size available
Read block sizerd_block_sizeC_NPI_DATA_WIDTHtype of transferImplemented
4 bytes   X”0”321 word xfer(tick)
8 bytes  X”0”642 words xfer(tick)
16 bytesX”1”32-644-word cache-line burst(warning), not tested
32 bytesX”2”32-648-word cache-line burst(warning), not tested
64 bytesX”3”32-6416-word burst(tick)
128 bytesX”4”32-6432-word burst(tick)
256 bytesX”5”6464-word burst(tick)

Example 1

Example of single write transfer from address 0x1C000000 to 0x1C00FFFF using 32-word burst

...

4. Poll SR until write_xfer_done = 1

Example 2

Example of single linear read transfer from address 0x1C000000 to 0x1C00FFFF using 32-word burst transaction

...

4. Poll SR until read_xfer_done = 1

Example 3

Example of single transpose read transfer from address 0x1C000000 at image size 750 bytes/row x 480 rows.

...

#projec t#(or IP repository)\drivers\xps_npi_dma_v1_00_a\src\xps_npi_dma.c

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.

...