<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Backblog &#187; Central DMA</title>
	<atom:link href="http://backblog.betriebswerk-landshut.de/tag/central-dma/feed/" rel="self" type="application/rss+xml" />
	<link>http://backblog.betriebswerk-landshut.de</link>
	<description>Über Linux, Fotos und anderes Zeug</description>
	<lastBuildDate>Thu, 12 Aug 2010 09:52:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Xilinx Microblaze XDmaCentral DMA Controller</title>
		<link>http://backblog.betriebswerk-landshut.de/2010/06/10/xilinx-microblaze-xdmacentral-dma-controller/</link>
		<comments>http://backblog.betriebswerk-landshut.de/2010/06/10/xilinx-microblaze-xdmacentral-dma-controller/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 07:25:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Diplomarbeit]]></category>
		<category><![CDATA[FPGA]]></category>
		<category><![CDATA[Technik]]></category>
		<category><![CDATA[Xilinx]]></category>
		<category><![CDATA[Central DMA]]></category>
		<category><![CDATA[DDR]]></category>
		<category><![CDATA[EDK]]></category>
		<category><![CDATA[Microblaze]]></category>
		<category><![CDATA[PLB]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[SDRAM]]></category>
		<category><![CDATA[XDmaCentral]]></category>
		<category><![CDATA[Xilinx Software Development Kit]]></category>
		<category><![CDATA[XPS]]></category>

		<guid isPermaLink="false">http://backblog.betriebswerk-landshut.de/?p=516</guid>
		<description><![CDATA[Dieses einfache Beispiel soll verdeutlichen wie man am einfachsten mit dem XCmaCentral XPS Central DMA Controller umgeht, es ist für ein Anfang bewusst einfach gehalten. Und kopiert Werte von einem Speicherbereich im SD oder DDR RAM in den anderen. Bei dem System ist darauf zu achten dass, Microblaze, DMA Controller (SPLB &#38; MPLB) und Speicher [...]]]></description>
			<content:encoded><![CDATA[<p>Dieses einfache Beispiel soll verdeutlichen wie man am einfachsten mit dem XCmaCentral XPS Central DMA Controller umgeht, es ist für ein Anfang bewusst einfach gehalten. Und kopiert Werte von einem Speicherbereich im SD oder DDR RAM in den anderen. Bei dem System ist darauf zu achten dass, Microblaze, DMA Controller (SPLB &amp; MPLB) und Speicher im Xilinx Platform Studio (XPS) am gleichen Buss hängen. Ist man soweit kann man das Projekt für das Xilinx Software Development Kit (SDK) exportieren.</p>
<p>Beim programmieren des DMA gibt es ein paar kleine Stolperfallen.</p>
<ul>
<li>bei XDmaCentral_SetControl sollte man sehr genau darauf achten Source und Destination nich zu vertauschen</li>
<li>XDmaCentral_Transfer will eine Angabe haben wie viele Byte er zu übertragen hat &#8230; das sind für eine 32 Bit Variable also 4 &#8230;</li>
</ul>
<p>Sonst ist die Konfiguration sehr &#8220;straightforward&#8221;  &#8230;.</p>
<blockquote><p>#include &#8220;xparameters.h&#8221;<br />
#include &#8220;xintc.h&#8221;<br />
#include &#8220;xdmacentral.h&#8221;<br />
#define TEST_BUFFER_SIZE       20//4096</p>
<p>int main () {<br />
static XDmaCentral dma;<br />
Xuint32* Buffer;<br />
Xuint32 *Buffer2;<br />
Buffer = (Xuint32 *)0x8c000A00;<br />
Buffer2 = (Xuint32 *)0x8c000000;<br />
//(XPAR_DDR2_SDRAM_16MX32_MPMC_BASEADDR);</p>
<p>Xuint32 Index;<br />
XStatus Status;</p>
<p>for (Index = 0; Index &lt; TEST_BUFFER_SIZE; Index++)<br />
{<br />
Buffer[Index] = Index+41;<br />
}</p>
<p>for (Index = 0; Index &lt; TEST_BUFFER_SIZE; Index++)<br />
{</p>
<p>xil_printf(&#8220;\n\r %x %d&#8221;,&amp;Buffer[Index], Buffer[Index]);<br />
}</p>
<p>Status = XDmaCentral_Initialize(&amp;dma, XPAR_XPS_CENTRAL_DMA_0_DEVICE_ID);</p>
<p>if (Status != XST_SUCCESS)<br />
{<br />
xil_printf(&#8220;The Central DMA Didn&#8217;t Initialize! \r\n&#8221;);<br />
return XST_FAILURE;<br />
}<br />
XDmaCentral_Reset(&amp;dma);</p>
<p>XDmaCentral_SetControl(&amp;dma,XDMC_DMACR_SOURCE_INCR_MASK<br />
+XDMC_DMACR_DEST_INCR_MASK);<br />
XDmaCentral_Transfer(&amp;dma,(Xuint32 *) Buffer, (Xuint32 *) Buffer2, TEST_BUFFER_SIZE*4);</p>
<p>xil_printf(&#8220;\n\r Speicherzelle in Buffer %x wert an der stelle %d&#8221;,Buffer,*Buffer);<br />
xil_printf(&#8220;\n\r Speicherzelle in Buffer %x wert an der stelle %d&#8221;,Buffer2,*Buffer2);</p>
<p>for (Index = 0; Index &lt; TEST_BUFFER_SIZE; Index=Index+1)<br />
{<br />
xil_printf(&#8220;\n\r %x %d&#8221;,&amp;Buffer2[Index],Buffer2[Index]);<br />
}</p>
<p>xil_printf(&#8220;\r\nDone&#8221;);</p>
<p>return 0;</p>
<p>}</p></blockquote>
<p>Das kleine Programm erzeugt ein Array im RAM welches dann vom DMA Controller in ein anders Umgespeichert wird. Im nächsten Schritt werde ich nun daran Arbeiten Daten mit dem Central DMA an und von meinem Ipif Modul zu übertragen. Der Central DMA kommt deswegen zum Einsatz da für den PLB4.6 kein IpIf Modul mit Integriertem DMA zur Verfügung steht. Siehe <a href="http://www.xilinx.com/support/documentation/sw_manuals/edk10_mg_ug.pdf">hier</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://backblog.betriebswerk-landshut.de/2010/06/10/xilinx-microblaze-xdmacentral-dma-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

