06-10-2008 11:35 AM
An ML505, I have, with the 10.1 tools.
I wish to stream data from my custom IP to the DDR memory as quickly as possible (though no quantative requirement yet).
I've done hours of research on this subject and I still lack the necessary resources "just do it". I've looked at a reference design that was built with a very old version of the tools that uses a LocalLink to DDR to control a TFT display. The ll_data_gen.v has a DCR to localLink logic for this feature.
Current Vision for my Goal:
Currently I have the vision of interfacing to the SDMA port on the MPMC (DDR2 controller). The first 4 ports of the MPMC are used for items like cache links, PLB, and SDMA for the TEMAC. Why do I envision SDMA? Because I hear that it's cool.
My background with XPS & DMA:
I don't know much about the DMA implementation through the custom logic even using LocalLink, but though a bunch of reference designs, I've got MGTs, TEMAC, and a nice embedded command intrepreter working and tailored to my custom IP design.
Because I've had great success with tailoring reference designs, does anyone know of a reference design that will work with the 10.1 set of tools, and that creates a data-link from custom IP to DDR2 via LocalLink-to-SDMA (or other comparable interface)?
I'm currently looking at the XPS central DMA, but it's still attached to the PLB, and from what I understand, that's not very fast. Any other information on how to create this will be of help, if you have the time.
Thanks in advance,
06-11-2008 09:43 AM
I'm currently looking at the XAPP935 reference design. It seems to have an implementation of the central DMA controller. Software code TestApp_MemoryCaching.c:
"tests the caching ability of PLB DDR2
* with OPB Central DMA. The software application is executed from the cacheable
* region of memory, while DMA transactions are occurring inside the non-cacheable
* region of memory. The memory region assigned to source address gets copied
* to the memory region assigned to the destination address. When this operation
* is finished, it causes an interrupt that should be cleared by the software application
* and the memory region assigned to the destination data is checked against
* the source data to ensure proper transfer. The LEDs light up once the
* transaction is successful."
This will be of help for now--but still, it's on the PLB, and that's a lot slower than the LocalLink, no?
06-11-2008 10:59 AM
As far as the locallink goes, you might be able to work with the specs from SDMA, locallink, xps_ll_temac & xps_ll_fifo datasheets.
You might also consider directly interfacing to the MPMC's NPI interface rather than using SDMA and local link. My guess is that you'd need SDMA if you need your operations to be s/w programmable.
03-14-2009 03:02 AM
Do you have the xapp536.zip file? If affirmative, please post it, because I am interested in developing a similar application. Thank you in advance.
03-14-2009 07:09 AM
I've done a few posts on this topic. We have had great success using the SDMA port for realtime video / audio and SD/MMC card functions.
Due to resources we used one SDMA port and made a locallink hub to split the one port into two video streams for our composite (dual layer) TFT controller. We can quite easily run a 640x480x16 x2 layers with colour key and picture in picture support. On a second SDMA port we run an audio stream and SD/MMC card read function. All of this works just great and in real time on our PPC405 in a V4FX12/20 part.
If you have any specifics, just email me. The one thing I would say is that if you are making custom IP to connect to locallink, make sure your ModelSIM skills are up to date and have some tools (VisualBasic, etc) to be able to generate stimulus files for your test-benches. Due to the timing of the locallink and without accurate simulations it will be hard to get working.
04-15-2009 11:59 PM
Could you send me some reference disign related with the topic?
What i just want is how to use SDMA and make a locallink hub.
04-16-2009 05:04 AM - edited 04-16-2009 05:05 AM
If you can set up descriptors and get the SDMA port working fine then read below, if not, you'll need to go and learn because it is a complex beast to master.
You will need good ModelSIM knowledge to test. In XPS generate a test platform with just your SDMA code a MPMC and your Hub. Don't use external memory, except use BRAM for your application and variables. You should be able to watch your hub working under software control in ModelSIM.
Firstly create two types of descriptors, one type will go to one port of your Hub, the second type will go to the other port:
Use the APP1 (user application field 1) and set the first set of descriptors to 0x00 and the second set to 0x01.
//set up the app1 descriptor.
//My real example uses chains of about 600 descriptors per video frame so
//as one port on the loacal link is not always in use.
VideoLayer1_Descriptor.APP1 = 0x00000000;
VideoLayer2_Descriptor.APP1 = 0x00000001;
//chain all the descriptors together.
VideoLayer1_Descriptor.NEXTDESC_PTR = &VideoLayer2_Descriptor;
//Start the SDMA transaction
And for the VHDL side of it, you want to create a component that reads the APP1 filed and switches between ports.
The following code may help:
-- Hub Core Ports
--this is the master LL port
ll_master_din : in std_logic_vector(0 to (G_LOCAL_LINK_DATA_WIDTH-1));
ll_master_rem_port : in std_logic_vector(0 to ((G_LOCAL_LINK_DATA_WIDTH/8)-1));
ll_master_sof_n : in std_logic;
ll_master_sop_n : in std_logic;
ll_master_eop_n : in std_logic;
ll_master_eof_n : in std_logic;
ll_master_src_rdy_n : in std_logic;
ll_master_dst_rdy_n : out std_logic;
--HUB Port 0
ll_port0_din : out std_logic_vector(0 to (G_LOCAL_LINK_DATA_WIDTH-1));
ll_port0_rem_port : out std_logic_vector(0 to ((G_LOCAL_LINK_DATA_WIDTH/8)-1));
ll_port0_sof_n : out std_logic;
ll_port0_sop_n : out std_logic;
ll_port0_eop_n : out std_logic;
ll_port0_eof_n : out std_logic;
ll_port0_src_rdy_n : out std_logic;
ll_port0_dst_rdy_n : in std_logic;
--HUB Port 1
ll_port1_din : out std_logic_vector(0 to (G_LOCAL_LINK_DATA_WIDTH-1));
ll_port1_rem_port : out std_logic_vector(0 to ((G_LOCAL_LINK_DATA_WIDTH/8)-1));
ll_port1_sof_n : out std_logic;
ll_port1_sop_n : out std_logic;
ll_port1_eop_n : out std_logic;
ll_port1_eof_n : out std_logic;
ll_port1_src_rdy_n : out std_logic;
ll_port1_dst_rdy_n : in std_logic
And this code will help you process the APP1 and switch your ports
--synch our header envelop valid to the clock edge
--BUT: We are making a latch here, because there is no outher way of doing it.
P_HEADER : process(system_reset, system_clock)
if rising_edge(system_clock) then
if (system_reset = '1' or (ll_master_sop_n = '0' and ll_master_src_rdy_n = '0')) then
int_header_valid <= '0';
elsif (ll_master_sof_n = '0' and ll_master_src_rdy_n = '0') then
int_header_valid <= '1';
--generate a inter-packet counter to pin-point our APP1 packet
P_PACKET_COUNTER : process (system_reset, system_clock)
if system_reset = '1' then
int_counter <= X"0";
elsif rising_edge(system_clock) then
if int_header_valid = '1' then
--make sure our counter does not run on (and is not too big)
--due to a source rdy/n on the current port.
if int_counter /= "1111" then
int_counter <= int_counter + 1;
--clear the counter
int_counter <= X"0";
--map out the dest ready signal because we need to or these together when the port is active
ll_master_dst_rdy_n <= '0' when (ll_port0_dst_rdy_n = '0' and int_port_latch = "00") else
'0' when (ll_port1_dst_rdy_n = '0' and int_port_latch = "01") else
--map everything else out as they are all just pass through
03-10-2010 03:23 AM
I have a problem regarding connecting my ip to the npi port of mpmc. I am a new starter to EDK, so I would really appreciate it if you could be so kind to help me out.
I have successfully connected my own ip to the npi port of mpmc, just as you did in this post, however, i have no idea what to do next...
My own created ip is a multiplier, i am wondering how can i send the output of the multiplier to the DDR through mpmc(npi port)? How can i get the data from DDR back to my ip and show it on HyperTerminal? I know that since the communication between mpmc and my ip has nothing to do with SDK, so I really have no idea how to communicate between my ip and mpmc...
Hope anyone can help me out...
Thanks in advance...
Any hint would be appreciated...
03-10-2010 02:00 PM
the community would be very very thankfull (at least me :D) if you make some kind of tutorial about how interface a custom IP with a memory directly using SDMA and LocaLink interface.