<?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>Feng Jun &#187; verilog</title>
	<atom:link href="http://www.feng-jun.com/tag/verilog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.feng-jun.com</link>
	<description></description>
	<lastBuildDate>Mon, 16 May 2011 17:12:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>verilog仿真环境的搭建3:Debussy的设置</title>
		<link>http://www.feng-jun.com/verilog-simulation-environment-3/</link>
		<comments>http://www.feng-jun.com/verilog-simulation-environment-3/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 13:10:00 +0000</pubDate>
		<dc:creator>Feng Jun</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[FPGA]]></category>
		<category><![CDATA[verilog]]></category>

		<guid isPermaLink="false">http://www.feng-jun.com/verilog-simulation-environment-3/</guid>
		<description><![CDATA[<a href="http://www.feng-jun.com/verilog-simulation-environment-3/"><img align="right" hspace="5" width="120" src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog4.jpg" class="alignright wp-post-image tfe" alt="" title="" /></a>Debussy是Novas公司出品的调试工具，在5.4V9版之后就只发行Linux了，在这里使用的是Win32上的最后一个版本。

在前面文章中，已经可以调用modelsim进行仿真了，要配合Debussy使用的话，就需要在仿真中生成波形文件供调试。Debussy可以使用.fsdb文件，大小要比.vcd文件要小不少。

波形文件的生成

<span class="readmore"><a href="http://www.feng-jun.com/verilog-simulation-environment-3/" title="verilog仿真环境的搭建3:Debussy的设置">阅读全文——共1436字</a></span>]]></description>
			<content:encoded><![CDATA[<p>Debussy是Novas公司出品的调试工具，在5.4V9版之后就只发行Linux了，在这里使用的是Win32上的最后一个版本。</p>
<p>在前面文章中，已经可以调用modelsim进行仿真了，要配合Debussy使用的话，就需要在仿真中生成波形文件供调试。Debussy可以使用.fsdb文件，大小要比.vcd文件要小不少。</p>
<h3>波形文件的生成</h3>
<p>首先，将Debussy安装目录下share\PLI\modelsim_pli54\WINNT目录中的Novas.dll文件复制到modelsim安装目录下。</p>
<p>然后，在modelsim.ini的[vsim]标签下增加一行，用来在仿真时以供调用。</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> Veriuser = novas.dll</pre>
</div>
</div>
<p>接着，在仿真的顶层模块中添加如下语句：</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> initial</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> <span style="color: #0000ff;">begin</span></pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   3:</span> $fsdbDumpfile("wave_out.fsdb");</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   4:</span> $fsdbDumpvars;</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   5:</span> <span style="color: #0000ff;">end</span></pre>
</div>
</div>
<p>这样，在仿真时就会在script目录生成wave_out.fsdb波形文件。</p>
<p>如果波形文件比较大的话，打开时会占用很多内存，这时可以把波形文件分段输出，调试时只要载入指定时间段的波形文件就可以了，将第三行语句替换为如下语句:</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> $fsdbAutoSwitchDumpfile(25, "test.fsdb", 150);</pre>
</div>
</div>
<p>这条语句表示将fsdb文件分成每个大小为25MB的文件，最多输出150个文件。每个文件的仿真时间范围记录在test.log文件中。</p>
<h3>调用Debussy</h3>
<p>启动Debussy时，可以使用命令行方式，同时载入项目文件。结合命令行调用Modelsim，可以写出如下的两个批处理文件。</p>
<h4><strong>sim.bat</strong></h4>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> d:/program/Modeltech_6.3c/win32/vsim.exe -c -do sim.do</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> d:/program/Novas/Debussy/bin/debussy.exe  -f  run.f</pre>
</div>
</div>
<p>vsim中的-c参数是指定采用命令行模式，-do则是制定采用.do脚本模式。debussy的-f参数是在debussy启动时就调入run.f中指定的文件。</p>
<p>sim2.bat则是去掉了第二行，只是调用modelsim进行仿真。然后在已经启动的debussy中使用Shift+L快捷键重新调入波形文件就可以了。</p>
<h3>Debussy的使用</h3>
<p>Debussy有较强的单步调试的功能，我曾经尝试过，但没有能够使用的起来。现在使用的主要是波形文件的查看以及源代码的分析。</p>
<p><span style="color: #0080ff; font-size: x-small;"><strong><a href="http://www.feng-jun.com/wp-content/uploads/mypic/verilog4.jpg"  rel="lightbox[roadtrip]"><img src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog4.jpg" alt="" width="240" height="148" /></a> </strong></span></p>
<p><span style="color: #0080ff; font-size: x-small;"><strong>点击图片看大图</strong></span></p>
<p>在如图所示的代码界面，双击信号名就会在下面列出驱动这个信号的信号以及信号的负载列表，如果只有一个信号驱动这个信号的话，那就会直接进行跳转，并能通过工具栏中的按钮寻找定义信号的位置以及信号的调用位置。这样，在查看代码时，可以很快的查看到信号的流向了。</p>
<p>点击工具栏中的&#8221;New Waveform”按钮，可以调出波形分析工具。用工具栏中的打开文件按钮打开波形文件，并利用&#8221;Get Signal”按钮选择需要查看的信号（或者直接从选择对话框中拖入，甚至可以从代码界面的源程序中直接拖入，拖得时候是按鼠标中键，而不是左键或右键），就会显示生成的信号了。如下图所示：</p>
<p><span style="color: #0080ff; font-size: x-small;"><strong><a href="http://www.feng-jun.com/wp-content/uploads/2009/07/verilog6.jpg"  rel="lightbox[roadtrip]"><img style="display: inline; border: 0px;" title="verilog6" src="http://www.feng-jun.com/wp-content/uploads/2009/07/verilog6_thumb.jpg" border="0" alt="verilog6" width="244" height="86" /></a> </strong></span></p>
<p><span style="color: #0080ff; font-size: x-small;"><strong>点击图片看大图</strong></span></p>
<p>在波形界面中，可以利用一些简单的快捷键来方便的查看波形，其中z和Z是放大缩小，c是改变信号的显示颜色，Shift+L是重新载入波形。其他还有很多功能有待探索。</p>
<p>Debussy是个很强悍的工具，我用到的可能只有它的一小部分功能，如果有其他使用经验的话，欢迎一起分享。</p>
<h4  class="related_post_title">你可能还喜欢如下文章</h4><ul class="related_post"><li>2009/06/24 -- <a href="http://www.feng-jun.com/verilog-simulation-environment-2/" title="verilog仿真环境的搭建2: modelsim的设置">verilog仿真环境的搭建2: modelsim的设置</a> (2)</li><li>2009/06/20 -- <a href="http://www.feng-jun.com/verilog-simulation-environment-1/" title="verilog仿真环境的搭建1:项目文件的组织">verilog仿真环境的搭建1:项目文件的组织</a> (4)</li><li>2009/08/17 -- <a href="http://www.feng-jun.com/code-is-poetry-and-music/" title="代码如诗,代码如乐">代码如诗,代码如乐</a> (2)</li></ul><h3>Recent Comments</h3><ul></ul>]]></content:encoded>
			<wfw:commentRss>http://www.feng-jun.com/verilog-simulation-environment-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>verilog仿真环境的搭建2: modelsim的设置</title>
		<link>http://www.feng-jun.com/verilog-simulation-environment-2/</link>
		<comments>http://www.feng-jun.com/verilog-simulation-environment-2/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 12:43:59 +0000</pubDate>
		<dc:creator>Feng Jun</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[FPGA]]></category>
		<category><![CDATA[verilog]]></category>

		<guid isPermaLink="false">http://www.feng-jun.com/verilog-simulation-environment-2/</guid>
		<description><![CDATA[<a href="http://www.feng-jun.com/verilog-simulation-environment-2/"><img align="right" hspace="5" width="120" src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog2.jpg" class="alignright wp-post-image tfe" alt="" title="" /></a>1.证书设置

modelsim安装后，如果默认没有设置证书目录，那还需要手动进行设置。

在“系统属性”-》“高级”-》“环境变量”中的用户变量里，加上LM_LICENSE_FILE变量值，为证书所在的目录。值得一提的是，如果有其他软件也需要使用这个变量的话，那变量值以分号分隔。以我的设置为例：

<span class="readmore"><a href="http://www.feng-jun.com/verilog-simulation-environment-2/" title="verilog仿真环境的搭建2: modelsim的设置">阅读全文——共1792字</a></span>]]></description>
			<content:encoded><![CDATA[<h3>1.证书设置</h3>
<p>modelsim安装后，如果默认没有设置证书目录，那还需要手动进行设置。</p>
<p>在“系统属性”-》“高级”-》“环境变量”中的用户变量里，加上<strong>LM_LICENSE_FILE</strong>变量值，为证书所在的目录。值得一提的是，如果有其他软件也需要使用这个变量的话，那变量值以分号分隔。以我的设置为例：</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; height: 44px; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> 变量名:LM_LICENSE_FILE</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> 变量值:D:/program/Modeltech_6.3c/LICENSE.TXT;d:/program/Synplicity/synplctyd.lic</pre>
</div>
</div>
<h3>2.仿真库的编译</h3>
<p>xilinx的仿真库可以用命令提示符进行编译，也可以在ISE内图形界面下编译。</p>
<p>以ISE10.1为例，新建工程后，在source工具栏中选中器件，在Processes中右击&#8221;Compile HDL Simlulation Library”，如下图所示，选择&#8221;Properties…”，会出现设置对话框，如下下图所示。基本按默认设置就可以了，如需更改，第一项为编译的语言选择，第二项为编译后库的存放目录，第三项为仿真器（modelsim）的存在目录。</p>
<p style="text-align: center;"><span style="color: #0080ff; font-size: x-small;"><strong><a href="http://www.feng-jun.com/wp-content/uploads/mypic/verilog2.jpg"  rel="lightbox[roadtrip]"><img class="aligncenter" src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog2.jpg" alt="" width="240" height="192" /></a> </strong></span></p>
<p style="text-align: center;"><span style="color: #0080ff; font-size: x-small;"><strong>点击图片看大图</strong></span></p>
<p style="text-align: center;"><a href="http://www.feng-jun.com/wp-content/uploads/mypic/verilog3.jpg"  rel="lightbox[roadtrip]"><img class="aligncenter" src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog3.jpg" alt="" width="240" height="95" /></a></p>
<p style="text-align: center;"><span style="color: #0080ff; font-size: x-small;"><strong>点击图片看大图</strong></span></p>
<p>设置好后，还需要更改modelsim安装目录下的modelsim.ini设置文件，指定仿真库的目录，否则在仿真其他项目时会提示找不到仿真库。修改前去除modelsim.ini的只读属性，然后在[Library]项下添加类似如下的目录指定语句（无需行号）。</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> Simprims_ver = D:/Xilinx/ise/ISE/verilog/mti_se/simprims_ver</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> unisims_ver = D:/Xilinx/ise/ISE/verilog/mti_se/unisims_ver</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   3:</span> XilinxCoreLib_ver = D:/Xilinx/ise/ISE/verilog/mti_se/XilinxCoreLib_ver</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   4:</span> XilinxCoreLib = D:/Xilinx/ise/ISE/vhdl/mti_se/XilinxCoreLib</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   5:</span> simprim= D:/Xilinx/ise/ISE/vhdl/mti_se/simprim</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   6:</span> unisim =D:/Xilinx/ise/ISE/vhdl/mti_se/unisim</pre>
</div>
</div>
<h3>3.仿真器的批处理调用</h3>
<p>仿真未必需要使用modelsim的图形界面，可以使用批处理文件调用命令提示符方式实现全自动的仿真。不需要重复的设置而且可以节省仿真时的内存占用。</p>
<h4>sim2.bat文件</h4>
<p>调用modelsim中仿真器的批处理文件，以我项目目录中script目录下的sim2.bat为例，内容为（无需行号）：</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> d:\program\Modeltech_6.3c\win32\vsim.exe -c -do sim.do</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> exit</pre>
</div>
</div>
<h4>sim.do文件</h4>
<p>还需要在同一目录下建立modelsim仿真的脚本文件，文件为sim.do，内容如下（无需行号）：</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> vlib <span style="color: #0000ff;">work</span></pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> vlog -f  run.f -incr</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   3:</span> vsim -L xilinxcorelib_ver -L unisims_ver -lib <span style="color: #0000ff;">work</span> updater_test glbl</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   4:</span> run 100us</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   5:</span> quit</pre>
</div>
</div>
<p>第一行建立一个项目库。</p>
<p>第二行载入仿真所需文件，-incr参数为增量编译方式，每次运行时没有改动的文件可以不用重新编译，节省编译时间。</p>
<p>第三行为仿真命令：-L参数载入仿真库；-lib 指定项目库；updater_test为顶层的模块名，根据自己项目的情况更改；glbl为全局信号模块的名字，一般不用改。</p>
<p>第四行指定仿真运行时间。</p>
<p>第五行退出脚本。</p>
<h4>run.f文件</h4>
<p>在上述的脚本中，第二行为载入项目仿真所需文件，这需要手动指定，或者利用脚本或者批处理来生成，内容其实相当简单，就是一个文件及其路径的列表，类似于这样（无需行号）：</p>
<div style="border: 1px solid gray; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   1:</span> e:/project/<span style="color: #0000ff;">parameters</span>.v</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   2:</span> e:/project/rtl/counter.v</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   3:</span> e:/project/rtl/updater.v</pre>
<pre style="border-style: none; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt; overflow: visible;"><span style="color: #606060;">   4:</span> e:/project/rtl/updater_test.v</pre>
</div>
</div>
<p>在仿真前就会按照顺序调入这些文件并进行编译了。</p>
<p>这样，modelsim所需的设置就基本完成了，用命令行方式调用仿真器在实践中可以方便很多，而且更利于脚本化的处理。</p>
<p>第三篇将介绍调试的利器Debussy的设置。</p>
<h4  class="related_post_title">你可能还喜欢如下文章</h4><ul class="related_post"><li>2009/07/05 -- <a href="http://www.feng-jun.com/verilog-simulation-environment-3/" title="verilog仿真环境的搭建3:Debussy的设置">verilog仿真环境的搭建3:Debussy的设置</a> (0)</li><li>2009/06/20 -- <a href="http://www.feng-jun.com/verilog-simulation-environment-1/" title="verilog仿真环境的搭建1:项目文件的组织">verilog仿真环境的搭建1:项目文件的组织</a> (4)</li><li>2009/08/17 -- <a href="http://www.feng-jun.com/code-is-poetry-and-music/" title="代码如诗,代码如乐">代码如诗,代码如乐</a> (2)</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="http://www.feng-jun.com" >Feng Jun</a> : <a class="comment_content" href="http://www.feng-jun.com/verilog-simulation-environment-2/#comment-236" title="View the entire comment by Feng Jun" >@卢松松过奖了</a></li>
<li><a class="commentor" href="http://www.lusongsong.com" >卢松松</a> : <a class="comment_content" href="http://www.feng-jun.com/verilog-simulation-environment-2/#comment-233" title="View the entire comment by 卢松松" >还真牛啊</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.feng-jun.com/verilog-simulation-environment-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>verilog仿真环境的搭建1:项目文件的组织</title>
		<link>http://www.feng-jun.com/verilog-simulation-environment-1/</link>
		<comments>http://www.feng-jun.com/verilog-simulation-environment-1/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 14:37:21 +0000</pubDate>
		<dc:creator>Feng Jun</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[FPGA]]></category>
		<category><![CDATA[verilog]]></category>

		<guid isPermaLink="false">http://www.feng-jun.com/verilog-simulation-environment-1-2/</guid>
		<description><![CDATA[<a href="http://www.feng-jun.com/verilog-simulation-environment-1/"><img align="right" hspace="5" width="120" src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog1.jpg" class="alignright wp-post-image tfe" alt="" title="" /></a>因为ISE内置的仿真工具功能比较弱（或者是我没有善于发掘？），所以大多数的仿真都是交给第三方工具的，比如说modelsim以及NC verilog。就我使用的工具来说，只有布局布线之后才是交给ISE来完成，之前的流程都可以有更为方便的工具来替代。现在我所使用的仿真及调试环境主要由vim+nlint+modelsim+debussy构成，使用起来还是相当方便的。需要说明的是，我是在windows下面使用这些工具的，如果linux下使用的话，可能可以更加强大。

首先介绍下project目录下文件的组织方法。

 

<span class="readmore"><a href="http://www.feng-jun.com/verilog-simulation-environment-1/" title="verilog仿真环境的搭建1:项目文件的组织">阅读全文——共1360字</a></span>]]></description>
			<content:encoded><![CDATA[<p>因为ISE内置的仿真工具功能比较弱（或者是我没有善于发掘？），所以大多数的仿真都是交给第三方工具的，比如说modelsim以及NC verilog。就我使用的工具来说，只有布局布线之后才是交给ISE来完成，之前的流程都可以有更为方便的工具来替代。现在我所使用的仿真及调试环境主要由vim+nlint+modelsim+debussy构成，使用起来还是相当方便的。需要说明的是，我是在windows下面使用这些工具的，如果linux下使用的话，可能可以更加强大。</p>
<p>首先介绍下project目录下文件的组织方法。</p>
<p align="center"><span style="color: #0080ff; font-size: x-small"><strong><a href="http://www.feng-jun.com/wp-content/uploads/mypic/verilog1.jpg"  rel="lightbox[roadtrip]"><img src="http://www.feng-jun.com/wp-content/uploads/mypic/verilog1.jpg" width="240" height="179" /></a> </strong></span></p>
<p align="center"><span style="color: #0080ff; font-size: x-small"><strong>点击图片看大图</strong></span></p>
<h5>&#160;</h5>
<h5>左侧的项目主目录</h5>
<p><strong>test目录</strong>：主要用来存放子模块仿真所需文件，每个子模块目录内的结构跟project目录下大致相同。</p>
<p><strong>syn目录</strong>：存放综合的项目文件及其产生的文件。</p>
<p><strong>sim目录</strong>：存放rtl仿真所使用的testbench。</p>
<p><strong>script目录</strong>：用来存放仿真所需要运行的脚本（主要还是批处理文件）。</p>
<p><strong>rtl目录</strong>：用来存放rtl代码。</p>
<p><strong>planahead</strong>:用来存放planahead工程文件及产生的文件。</p>
<p><strong>others目录</strong>：存放一时难以归类的文件。</p>
<p><strong>ise目录</strong>：用来存放ise的项目文件以及产生的文件，包括布局布线所需的文件以及可供下载的二进制bit文件。</p>
<p><strong>doc目录</strong>：用来存放项目所需的参考文档。</p>
<p><strong>core目录</strong>：用来存放项目所需的核相关的文件。</p>
<p><strong>c目录</strong>：用来存放c语言程序。</p>
<p><strong>backup目录</strong>：用来存放临时备份。</p>
<p><strong>tags文件</strong>：vim中自动生成的tag索引文件。</p>
<p><strong>syncToy文件</strong>：用于Microsoft Synctoy工具的文件，该工具主要用来进行不同计算机的文件同步。</p>
<p><strong><span style="text-decoration: underline">parameters.v</span></strong>:用于存放项目所需的参数。</p>
<h5>右侧的script子目录</h5>
<p><strong>Debussy.exeLog与work目录：</strong>分别是Debussy与modelsim产生的文件。</p>
<p><strong>transcript文件：</strong>modelsim的生成的日志文件。</p>
<p><strong><span style="text-decoration: underline">deb.bat</span>:</strong>调用Debussy并载入项目中的rtl文件。</p>
<p><strong><span style="text-decoration: underline">nlint.bat</span>:</strong>调用nlint进行项目中rtl文件的规则检查。</p>
<p><strong><span style="text-decoration: underline">sim.bat</span>:</strong>调用modelsim进行仿真，并在仿真结束后启动debussy观察波形。</p>
<p><strong><span style="text-decoration: underline">sim2.bat</span></strong>:调用modelsim进行仿真，但并不启动debussy。</p>
<p><strong><span style="text-decoration: underline">sim.do</span></strong>:modelsim的仿真脚本。</p>
<p><strong><span style="text-decoration: underline">run.f</span></strong>：项目中rtl的文件列表。</p>
<p><strong>fsdb文件</strong>:modelsim仿真生成的波形文件。</p>
<p><strong>*.log</strong>:仿真时产生的日志文件，再将波形文件分割为多个文件时产生。后面会有介绍。</p>
<p><strong>bram.mif</strong>:Block Ram核初始化所需的数据文件。</p>
<p><strong>novas.rc</strong>:debussy的配置文件。</p>
<p><strong><span style="text-decoration: underline">sig.rc</span></strong>:在debussy中察看波形时选择的信号列表。</p>
<p><strong>.swp</strong>:vim编辑时产生的临时文件。</p>
<p><strong>vsim.wlf</strong>:modelsim产生的波形文件，不过这个文件一般不用。</p>
<p><strong>glbl.v</strong>:仿真所使用的全局信号初始化文件。</p>
<p><em>其中,文件名加下划线标志的文件为手动生成的。其他的文件为软件生成的文件。</em></p>
<p><em>这其中的部分文件，特别是script目录中的文件，以后会有介绍的。</em></p>
<p>将项目文件分类存档，便于进行项目的管理，避免不同流程下的文件聚集在一个目录下，同时也可以使误操作的损失控制在较小的范围内。</p>
<p>下一篇文章，将要介绍modelsim的配置以及仿真库的编译。</p>
<h4  class="related_post_title">你可能还喜欢如下文章</h4><ul class="related_post"><li>2009/07/05 -- <a href="http://www.feng-jun.com/verilog-simulation-environment-3/" title="verilog仿真环境的搭建3:Debussy的设置">verilog仿真环境的搭建3:Debussy的设置</a> (0)</li><li>2009/06/24 -- <a href="http://www.feng-jun.com/verilog-simulation-environment-2/" title="verilog仿真环境的搭建2: modelsim的设置">verilog仿真环境的搭建2: modelsim的设置</a> (2)</li><li>2009/08/17 -- <a href="http://www.feng-jun.com/code-is-poetry-and-music/" title="代码如诗,代码如乐">代码如诗,代码如乐</a> (2)</li></ul><h3>Recent Comments</h3><ul><li><a class="commentor" href="http://www.feng-jun.com" >Feng Jun</a> : <a class="comment_content" href="http://www.feng-jun.com/verilog-simulation-environment-1/#comment-238" title="View the entire comment by Feng Jun" >@牛牛特工  
是的；）</a></li>
<li><a class="commentor" href="" >牛牛特工</a> : <a class="comment_content" href="http://www.feng-jun.com/verilog-simulation-environment-1/#comment-237" title="View the entire comment by 牛牛特工" >VIM LINT modelsim+debussy</a></li>
<li><a class="commentor" href="http://www.feng-jun.com" >Feng Jun</a> : <a class="comment_content" href="http://www.feng-jun.com/verilog-simulation-environment-1/#comment-231" title="View the entire comment by Feng Jun" >@iDea1983  
这是有关硬件的内容，以后也会多一些这方面的内容的呵。</a></li>
<li><a class="commentor" href="http://idea1983.com" >iDea1983</a> : <a class="comment_content" href="http://www.feng-jun.com/verilog-simulation-environment-1/#comment-230" title="View the entire comment by iDea1983" >看不懂！！有点专业了！</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.feng-jun.com/verilog-simulation-environment-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk
Database Caching using disk
Object Caching 943/999 objects using disk

Served from: www.feng-jun.com @ 2012-02-07 16:15:37 -->
