<?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>zInformatik &#187; FPGA, CPLD und VHDL</title>
	<atom:link href="http://zinformatik.de/category/mikrocontroller-elektronik/fpga-cpld-und-vhdl/feed/" rel="self" type="application/rss+xml" />
	<link>http://zinformatik.de</link>
	<description>Computer, Informatik und Mikrocontroller Blog</description>
	<lastBuildDate>Sat, 22 Oct 2011 09:51:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tools zur VHDL Entwicklung in der Linux Konsole</title>
		<link>http://zinformatik.de/linux/tools-zur-vhdl-entwicklung-in-der-linux-konsole/</link>
		<comments>http://zinformatik.de/linux/tools-zur-vhdl-entwicklung-in-der-linux-konsole/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 13:06:49 +0000</pubDate>
		<dc:creator>zimon</dc:creator>
				<category><![CDATA[FPGA, CPLD und VHDL]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Konsole]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[Makefile]]></category>
		<category><![CDATA[VHDL]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://zinformatik.de/?p=835</guid>
		<description><![CDATA[<p>Wie <a href="http://zinformatik.de/tipps-tricks/vim-tipps/vhdl-coding-mit-vim/" title="VHDL Coding mit vim" target="_self" class="liinternal">versprochen</a> hier ein Toolset zu VHDL in der Linux Konsole.</p>
<p>Um sich das ganze geklicke zum Synthetisieren und Implementieren unter ISE zu ersparen, hat Torsten Meißner ein <a href="http://editthis.info/freefpga/Linux" title="Makefile mit Batch Dateien" target="_blank" class="liexternal">Makefile mit einigen Batch Dateien</a> erstellt, die von Simon Schulz erweitert wurden. Auf seiner <a href="http://avr.auctionant.de/vhdl/xilinx_fpga_makefile_linux.html" title="Makefile und&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Wie <a href="http://zinformatik.de/tipps-tricks/vim-tipps/vhdl-coding-mit-vim/" title="VHDL Coding mit vim" target="_self" class="liinternal">versprochen</a> hier ein Toolset zu VHDL in der Linux Konsole.</p>
<p>Um sich das ganze geklicke zum Synthetisieren und Implementieren unter ISE zu ersparen, hat Torsten Meißner ein <a href="http://editthis.info/freefpga/Linux" title="Makefile mit Batch Dateien" target="_blank" class="liexternal">Makefile mit einigen Batch Dateien</a> erstellt, die von Simon Schulz erweitert wurden. Auf seiner <a href="http://avr.auctionant.de/vhdl/xilinx_fpga_makefile_linux.html" title="Makefile und Tools für die Benutzung der Xilinx ISE unter Linux" target="_blank" class="liexternal">Website</a> kann man sie herunter laden (und darauf beziehe ich mich im Folgenden).</p>
<p>Wenn das Archiv entpackt ist, kann man seine vhd Dateien in den Ordner ./rtl kopieren. In der Datei ./config/settings werden grundlegende Einstellungen vorgenommen. Die ucf-Datei kommt in das Verzeichnis ./layout.</p>
<p>Nach einem <em>make project</em> sollte eigentlich alles Funktionieren. Jedoch wird in den Dateien ./syn/src/implement.sh und ./syn/src/synthesize.sh die nichtexistente Datei ~/Xillinx/settings.sh importiert, die einige Umgebungsvariablen definieren soll. Diese Definitionen habe ich einfach statt dem Aufruf der Datei in dei beiden Dateien geschrieben. Der Pfad zum ISE Verzeichnis muss entsprechend angepasst werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#set envirement for ise</span>
<span style="color: #666666; font-style: italic;">#. ~/Xilinx/settings.sh</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PLATFORM</span>=lin
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">XILINX</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>ISE
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LMC_HOME</span>=<span style="color: #800000;">${XILINX}</span><span style="color: #000000; font-weight: bold;">/</span>smartmodel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PLATFORM}</span><span style="color: #000000; font-weight: bold;">/</span>installed_lin
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #800000;">${XILINX}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PLATFORM}</span>:<span style="color: #800000;">${PATH}</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #800000;">${XILINX}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PLATFORM}</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11R6<span style="color: #000000; font-weight: bold;">/</span>lib
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">NPX_PLUGIN_PATH</span>=<span style="color: #800000;">${XILINX}</span><span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${PLATFORM}</span><span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>plugin<span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>ns4
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">myxilinxrc</span>=<span style="color: #800000;">${HOME}</span><span style="color: #000000; font-weight: bold;">/</span>.qt<span style="color: #000000; font-weight: bold;">/</span>xilinxrc</pre></div></div>

<p>In der Makefile hat das Target bitup bei mir nicht funktioniert, da ich die libusb-driver benuzte. Daher hab ich das Ziel durch folgendes ersetzt (der Pfad zu ISE muss entsprechend angepasst werden):</p>

<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;">#upload bit to fpga</span>
bitup <span style="color: #004400;">:</span>
    bash <span style="color: #004400;">-</span>c <span style="color: #CC2200;">'export LD_PRELOAD=/usr/lib/libusb-driver.so; /path/to/ISE/bin/lin/impact -batch impact/impact_upload_bit.cmd'</span></pre></div></div>

<p>Da das Makefile im Verzeichnis ./syn/src liegt, die vhd Dateien jedoch in ./rtl ist ein Aufruf von make aus vim heraus nur umständlich möglich. Daher habe ich ein kleines Makefile generiert, welches man ins Verzeichnis ./rtl kopieren kann.<br />
Es wechselt für jedes Ziel das Verzeichnis und ruft das echte Makefile mit dem entsprechenden Ziel auf:</p>

<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;">#rule for synthesis</span>
syn <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make syn
&nbsp;
<span style="color: #339900; font-style: italic;">#rule for implementation</span>
imp <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make imp
&nbsp;
<span style="color: #339900; font-style: italic;">#project file generation</span>
project <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make project
&nbsp;
<span style="color: #339900; font-style: italic;">#upload bit to fpga</span>
bitup <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make bitup
&nbsp;
<span style="color: #339900; font-style: italic;">#upload prom to fpga</span>
promup <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make promup
&nbsp;
<span style="color: #339900; font-style: italic;">#generate prom</span>
promgen <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make promgen
&nbsp;
<span style="color: #339900; font-style: italic;">#reset/unlock pport cable (if impact says cable locked)</span>
unlock_cable <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make unlock_cable
&nbsp;
<span style="color: #339900; font-style: italic;">#rule for all</span>
all <span style="color: #004400;">:</span> clean syn imp bitup
&nbsp;
<span style="color: #339900; font-style: italic;">#rule for cleaning</span>
clean <span style="color: #004400;">:</span>
    cd <span style="color: #004400;">../</span>syn<span style="color: #004400;">/</span>src <span style="color: #004400;">&amp;&amp;</span> make clean</pre></div></div>

<p>Nun funktioniert alles und man kann aus vim heraus mit <em>:make all</em> den kompletten Vorgang starten.</p>
<p>Mittels</p>
<ul>
<li><em>:make clean</em> werden alle temporär erstellten Dateien gelöscht (inklusive Bit-Datei)</li>
<li><em>:make syn</em> wird die Synthese gestartet</li>
<li><em>:make imp</em> wird die Diesign Implementation gestartet (Map, Place &amp; Route,&#8230;) und die Bit-Datei erstellt</li>
<li><em>:make bitup</em> wird die Bit-Datei in den FPGA geladen</li>
<li><em>:make all</em> werden alle 4 Vorgänge nacheinander gestartet</li>
</ul>
<p>Nachdem Dateien hinzugefügt oder gelöscht wurden muss man die Datei ./config/settings anpassen und erneut <em>make project</em> ausführen.</p>
]]></content:encoded>
			<wfw:commentRss>http://zinformatik.de/linux/tools-zur-vhdl-entwicklung-in-der-linux-konsole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VHDL Coding mit vim</title>
		<link>http://zinformatik.de/tipps-tricks/vim-tipps/vhdl-coding-mit-vim/</link>
		<comments>http://zinformatik.de/tipps-tricks/vim-tipps/vhdl-coding-mit-vim/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 19:16:03 +0000</pubDate>
		<dc:creator>zimon</dc:creator>
				<category><![CDATA[FPGA, CPLD und VHDL]]></category>
		<category><![CDATA[vim Tipps]]></category>
		<category><![CDATA[VHDL]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://zinformatik.de/?p=763</guid>
		<description><![CDATA[<p>Es gibt zwar das ein oder andere mehr oder weniger gute vim-Plugin für VHDL, doch die meisten beschränken sich auf einige Mappings, Abkürzungen und Ähnliches. Es gibt jedoch eine sehr schöne <a href="http://people.ee.ethz.ch/~andrmuel/vhdl-with-vim.html" title="Anleitung für VHDL mit vim" target="_blank" class="liexternal">Anleitung</a> von Andreas Müller, wie man sein vim wirklich gut zum Coden von VHDL nutzen kann. Darin werden verschiedene Plugins, Mappings&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Es gibt zwar das ein oder andere mehr oder weniger gute vim-Plugin für VHDL, doch die meisten beschränken sich auf einige Mappings, Abkürzungen und Ähnliches. Es gibt jedoch eine sehr schöne <a href="http://people.ee.ethz.ch/~andrmuel/vhdl-with-vim.html" title="Anleitung für VHDL mit vim" target="_blank" class="liexternal">Anleitung</a> von Andreas Müller, wie man sein vim wirklich gut zum Coden von VHDL nutzen kann. Darin werden verschiedene Plugins, Mappings &#8230; beschrieben.</p>
<p>Dort wird unter Anderem das <a href="http://vim-taglist.sourceforge.net/" title="vim Taglist-Plugin" target="_blank" class="liexternal">Taglist-Plugin</a> verwendet. Um es nutzen zu können, muss Exuberant Ctags installiert sein, was man unter Ubuntu einfach per</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> exuberant-ctags</pre></div></div>

<p>installieren kann.</p>
<p>In der Anleitung steht bereits eine ctags-Konfigurationsdatei zur Verfügung. Sie wird einfach unter ~/.ctags gespeichert. Diese Datei habe ich in dem Abschnitt von VHDL um folgende Zeile erweitert um auch die Port Mappings anzuzeigen:</p>
<pre>--regex-vhdl=/^[ \t]*([^ \t:]+)[ \t]*:[ \t]*[a-z0-9_]+[ \t]+port[ \t]*map[ \t]*\(/\1/m,port maps/i</pre>
<p>Zusätzlich muss dafür die Definition von g:tlist_vhdl_settings in der .vimrc abgeändert werden (mehr zur .vimrc weiter unten):</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>tlist_vhdl_settings   = <span style="color: #C5A22D;">'vhdl;d:package declarations;b:package bodies;e:entities;a:architecture specifications;t:type declarations;p:processes;f:functions;m:port maps;r:procedures'</span></pre></div></div>

<p>Hier die entsprechenden Zeilen der .vimrc für VHDL, die ich (mehr oder weniger) übernommen habe:</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">&quot; VHDL Stuff</span>
<span style="color: #804040;">if</span> <span style="color: #25BB4D;">has</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;autocmd&quot;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #804040;">filetype</span> <span style="color: #25BB4D;">plugin</span> <span style="color: #25BB4D;">indent</span> <span style="color: #25BB4D;">on</span><span style="color: #adadad; font-style: italic;">
&quot;	filetype dependent settings</span>
	<span style="color: #804040;">au</span> Filetype vhdl <span style="color: #804040;">call</span> FT_vhdl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">else</span>
	<span style="color: #804040;">set</span> <span style="color: #668080;">autoindent</span>
<span style="color: #804040;">endif</span> 
&nbsp;
<span style="color: #804040;">function</span> FT_vhdl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #804040;">if</span> <span style="color: #25BB4D;">exists</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;+omnifunc&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #804040;">setlocal</span> <span style="color: #668080;">omnifunc</span>=syntaxcomplete#Complete
	<span style="color: #804040;">endif</span>
	<span style="color: #804040;">setlocal</span> <span style="color: #668080;">errorformat</span>=ERROR<span style="color: #000000;">:%.%</span>#\ <span style="color: #000000;">-</span>\ \<span style="color: #C5A22D;">&quot;<span style="">\%</span>f<span style="">\&quot;</span><span style="">\ </span>Line<span style="">\ </span>%l.<span style="">\ </span>%m,%EERROR:%m,%C<span style="">\[</span>%f(%l)<span style="">\]</span>:<span style="">\ </span>%m,%C%m,%Z%m
	let g:vhdl_indent_genportmap=0
&quot;</span>	<span style="color: #804040;">for</span> <span style="color: #25BB4D;">taglist</span>
	<span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>tlist_vhdl_settings   = <span style="color: #C5A22D;">'vhdl;d:package declarations;b:package bodies;e:entities;a:architecture specifications;t:type declarations;p:processes;f:functions;m:port maps;r:procedures'</span>
endfunction</pre></div></div>

<p>Das Errorformat ist bisher kaum getestet. Verbesserungsvorschläge sind daher gern gesehen.<br />
Mehr zum Thema Makefiles und Compilieren (eigentlich Synthetisieren, Mappen,&#8230;) gibts <a href="http://zinformatik.de/linux/tools-zur-vhdl-entwicklung-in-der-linux-konsole/" title="Tools zur VHDL Entwicklung in der Linux Konsole" target="_self" class="liinternal">hier</a>.</p>
<p>Die anderen Ideen von Andreas habe ich vorerst nicht übernommen, da mir dies im Moment reicht.</p>
]]></content:encoded>
			<wfw:commentRss>http://zinformatik.de/tipps-tricks/vim-tipps/vhdl-coding-mit-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

