[转载].MIF文件生成工具
2010-08-24 17:16
399 查看
引子:偶然间找到一个好用的工具,分享给大家。
转自:http://opencollector.org/history/freecore/MIF%20File%20Generator%20Utility.htm
What is a .MIF File?
A .MIF (Memory Initialization File) file is used to preload the EAB's in Altera's FLEX devices, like the Altera FLEX 10K family. When you instantiate a ROM or RAM in a schematic or an AHDL file, you have the option to specify a .MIF file for preloading the EAB with some default data.
Look-Up Table
You may use the EAB's as look-up tables. For instance, you could use the EAB's for storing digital waveforms. A typical digital waveform is the digital representation of a sine or cosine waveform.
MIFGEN.EXE, The .MIF File Generator Utility
The MIFGEN utility will generate .MIF files for you with sine or cosine digital waveforms. You have the option to specify several parameters, like amplitude, offset, angle range and so on. The MIFGEN utility is a stand-alone 32-bit executable running under Windows NT or Windows 95.
.MIF sample file
Here is a sample output of the MIFGEN utility, using the above parameters:
Parameter Description and Explanation
Parameter Name
Description/Explanation
Peak Amplitude
A sine or cosine (with no weigth) has a value in the range [-1,1]. The sine or cosine generated will be multiplied by the Peak Amplitude to generate an intermediate floating point representation of the waveform in the range [-Peak Amplitude, Peak Amplitude]. This value can be viewed in the 3rd column of the table ("cos(i)" or "sin(i)"). The floating point value is then rounded or quantized to the nearest whole integer - this is in the 4th column of the table ("Rounded").
Offset
The Offset value is then added to Rounded, and the result can be viewed in the 5th column of the table ("w/Offset").
Number of Samples
The Number of Samples parameter gives the number of entries in the .MIF file. In the on-screen table, the number of samples is actually one more, so that a complete quadrant, half or circle can be more easily verified.
Number of Bits
The Number of Bits parameter is used for two purposes. First, the WIDTH parameter has to be specified in the .MIF file. Second, if the "w/Offset" column contains negative values, the waveform is assumed to be bipolar and it will be represented in 2's complement. Since the .MIF file itself does not accept negative values, the number -3 is converted to 2^(Number of Bits) - 3. Assuming Number of Bits is 8, the new value will be 2^8 - 3 = 256 - 3 = 253. This is the value appearing in the last column, which is also the value written to the .MIF file.
Angle Range
The Angle Range parameter specifies the angle range of which the Number of Samples will be applied. The angle range is evenly divided by Number of Samples from 0 degrees up to 90, 180 or 360 degrees.
Function
Function specifies if you want to generate a sine or cosine within the angle range.
Options
Options lets you specify one of the following options, which apply to the angle range:
Normal. The angle range starts at 0 degrees and ends at, but does not include, the end angle (90, 180 or 360 degrees). For example, the cosine is computed as cos ((Angle Range) * i / Number Of Samples).
Include End Angle. The angle range starts at 0 degrees and stops at, and also includes, the end angle (90, 180 or 360 degrees). For example, the cosine is computed as cos ((Angle Range) * i / (Number Of Samples-1) ). A drawback is that there are 255 samples only per quadrant instead of 256, making it less suitable for a phase modulator. (256 divides nicely into 128, 64, 32, 16 etc. for accurate phase offsets).
Symmetry. The angle range starts at 0 degrees and stops at 90, 180 or 360 degrees, but does not contain the start or the end angle. This method generates a symmetric look-up table. For example, the cosine is computed as cos ((Angle Range) * (i+0.5) / Number Of Samples). A drawback is that the angle has a small offset error - the advantage is that it is very easy to implement a sine/cosine oscillator.
When you have entered your parameters, press the Generate Data button and the on-screen table will be filled with the appropriate values for your inspection. There is also an SNR (Signal-to-Noise Ratio) readout, based on the Signal Power / Quantization Noise Power. If you are satisfied with the result, press the Generate .MIF File button to create the .MIF file itself. You will be asked to supply a name for the new file.
下载
转自:http://opencollector.org/history/freecore/MIF%20File%20Generator%20Utility.htm
What is a .MIF File?
A .MIF (Memory Initialization File) file is used to preload the EAB's in Altera's FLEX devices, like the Altera FLEX 10K family. When you instantiate a ROM or RAM in a schematic or an AHDL file, you have the option to specify a .MIF file for preloading the EAB with some default data.
Look-Up Table
You may use the EAB's as look-up tables. For instance, you could use the EAB's for storing digital waveforms. A typical digital waveform is the digital representation of a sine or cosine waveform.
MIFGEN.EXE, The .MIF File Generator Utility
The MIFGEN utility will generate .MIF files for you with sine or cosine digital waveforms. You have the option to specify several parameters, like amplitude, offset, angle range and so on. The MIFGEN utility is a stand-alone 32-bit executable running under Windows NT or Windows 95.
.MIF sample file
Here is a sample output of the MIFGEN utility, using the above parameters:
-- Memory Initialization File -- Generated by .MIF File Generator Utility v1.2 -- by Rune Baeverrud -- Angle Range 0-360 degrees (quadrant 1-2-3-4) -- Function type : Cosine -- Options : Normal -- Peak Amplitude : 127,00 -- Offset : 0 -- Number of Samples: 256 -- SNR: : SNR: 49,87dB over i = 0 to 255 DEPTH = 256; WIDTH = 8; ADDRESS_RADIX = DEC; DATA_RADIX = DEC; CONTENT BEGIN 0 : 127; 1 : 127; 2 : 127; 3 : 127; 4 : 126; 5 : 126; ... ... (some lines removed here) ... 250 : 126; 251 : 126; 252 : 126; 253 : 127; 254 : 127; 255 : 127; END;
Parameter Description and Explanation
Parameter Name
Description/Explanation
Peak Amplitude
A sine or cosine (with no weigth) has a value in the range [-1,1]. The sine or cosine generated will be multiplied by the Peak Amplitude to generate an intermediate floating point representation of the waveform in the range [-Peak Amplitude, Peak Amplitude]. This value can be viewed in the 3rd column of the table ("cos(i)" or "sin(i)"). The floating point value is then rounded or quantized to the nearest whole integer - this is in the 4th column of the table ("Rounded").
Offset
The Offset value is then added to Rounded, and the result can be viewed in the 5th column of the table ("w/Offset").
Number of Samples
The Number of Samples parameter gives the number of entries in the .MIF file. In the on-screen table, the number of samples is actually one more, so that a complete quadrant, half or circle can be more easily verified.
Number of Bits
The Number of Bits parameter is used for two purposes. First, the WIDTH parameter has to be specified in the .MIF file. Second, if the "w/Offset" column contains negative values, the waveform is assumed to be bipolar and it will be represented in 2's complement. Since the .MIF file itself does not accept negative values, the number -3 is converted to 2^(Number of Bits) - 3. Assuming Number of Bits is 8, the new value will be 2^8 - 3 = 256 - 3 = 253. This is the value appearing in the last column, which is also the value written to the .MIF file.
Angle Range
The Angle Range parameter specifies the angle range of which the Number of Samples will be applied. The angle range is evenly divided by Number of Samples from 0 degrees up to 90, 180 or 360 degrees.
Function
Function specifies if you want to generate a sine or cosine within the angle range.
Options
Options lets you specify one of the following options, which apply to the angle range:
Normal. The angle range starts at 0 degrees and ends at, but does not include, the end angle (90, 180 or 360 degrees). For example, the cosine is computed as cos ((Angle Range) * i / Number Of Samples).
Include End Angle. The angle range starts at 0 degrees and stops at, and also includes, the end angle (90, 180 or 360 degrees). For example, the cosine is computed as cos ((Angle Range) * i / (Number Of Samples-1) ). A drawback is that there are 255 samples only per quadrant instead of 256, making it less suitable for a phase modulator. (256 divides nicely into 128, 64, 32, 16 etc. for accurate phase offsets).
Symmetry. The angle range starts at 0 degrees and stops at 90, 180 or 360 degrees, but does not contain the start or the end angle. This method generates a symmetric look-up table. For example, the cosine is computed as cos ((Angle Range) * (i+0.5) / Number Of Samples). A drawback is that the angle has a small offset error - the advantage is that it is very easy to implement a sine/cosine oscillator.
When you have entered your parameters, press the Generate Data button and the on-screen table will be filled with the appropriate values for your inspection. There is also an SNR (Signal-to-Noise Ratio) readout, based on the Signal Power / Quantization Noise Power. If you are satisfied with the result, press the Generate .MIF File button to create the .MIF file itself. You will be asked to supply a name for the new file.
下载
相关文章推荐
- 发布iis工程的小工具---生成自定义的一个大的dll文件.webdeloyment project插件
- [置顶] 自动更具数据库表来生成.java文件的小工具
- 对aspx文件加密,加密后文件大小为1k,文件只有一句话:这是预编译工具生成的标记文件,不应被删除!
- 自动删除-IAR项目工程生成垃圾文件的工具
- 利用工具自动生成makefile文件
- java生成pdf文件的工具类
- 使用 xsd.exe 命令工具将 xsd 架构生成 类(CS) 文件
- eclipse配置外部工具利用javah一键生成头文件
- 【分享】生成Revit扩展的addin文件小工具
- Android国际化资源文件自动化生成工具
- vc生成MIF文件,ROM使用
- 根据wsdl文件或者wsdl地址生成对应的java代码(借助MyEclipse工具快速生成Axis1的客户端代码)
- 使用pyinstaller工具打包python项目代码生成exe文件
- android findview 自动生成工具 xml布局文件自动转换类模板代码工具
- (转载)Java生成和操作Excel文件
- 如何禁用/启用dr.watson诊断工具 drwtsn32 / 如何在vista下生成转储文件dump - 探路者 - CSDN博客
- Hibernate工具生成.hbm.xml及.java文件
- S60第三版FP1 SDK在生成.mif文件时会导致编译失败(转)
- ffmpeg 转换VC工具已经可以生成工程文件
- 使用mybatis generator工具生成文件