Mudanças entre as edições de "Inicialização de memória com arquivos .MIF e .HEX"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
(Criou página com '=Memory Initialization File (.mif)= An ASCII text file (with the extension .mif) that specifies the initial content of a memory block (CAM, RAM, or ROM), that is, the initial v...')
 
Linha 39: Linha 39:
 
END;
 
END;
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
<html> <center>
 +
<table x-use-null-cells="" cellspacing="1" height="271" class="whs14">
 +
<colgroup><col>
 +
<col>
 +
<col class="whs15">
 +
 +
</colgroup><tbody><tr valign="top" class="whs16">
 +
<td bgcolor="#BFBFBF" class="whs17">
 +
<p class="TableText" style="font-weight: bold;">Address : Data Pairs Syntax
 +
Rules</p></td>
 +
<td bgcolor="#BFBFBF" class="whs17">
 +
<p class="TableText" style="font-weight: bold;">Definition</p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#BFBFBF" width="121px" class="whs18">
 +
<p class="TableText" style="font-weight: bold;">Example</p></td></tr>
 +
<tr valign="top" class="whs16">
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">A : D </span></p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">Addr[A] </span>=<span class="Code"> D</span></p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" width="121px" class="whs20">
 +
<p><span class="Code">2 : 4</span><br>
 +
Address:<span class="Code"> 01234567</span><br>
 +
Data:<span class="Code"> &nbsp;&nbsp;&nbsp;00400000</span></p></td></tr>
 +
<tr valign="top" class="whs16">
 +
<td bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">[A0..A1] : D</span></p></td>
 +
<td bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">Addr[A0] </span>to<span class="Code">
 +
[A1]</span> contain data<span class="Code"> D</span></p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" width="121px" class="whs20">
 +
<p><span class="Code">[0..7] : 6</span><br>
 +
Address:<span class="Code"> 01234567</span><br>
 +
Data:<span class="Code"> &nbsp;&nbsp;&nbsp;66666666</span></p></td></tr>
 +
<tr valign="top" class="whs16">
 +
<td bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">[A0..A1] : D0 D1</span></p></td>
 +
<td bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">Addr[A0] = D0, <br>
 +
Addr[A0+1] = D1, <br>
 +
Add [A0+2] = D0, </span></p>
 +
<p class="TableText"><span class="Code">Addr[A0+3] = D1, </span></p>
 +
<p class="TableText"><span class="Code">until A0+n = A1</span></p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" width="121px" class="whs20">
 +
<p class="TableText"><span class="Code">[0..7] : 5 6</span><br>
 +
Address:<span class="Code"> 01234567</span><br>
 +
Data:<span class="Code"> &nbsp;&nbsp;&nbsp;56565656</span></p></td></tr>
 +
<tr valign="top" class="whs16">
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">A : D0 D1 D2</span></p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" class="whs19">
 +
<p class="TableText"><span class="Code">Addr[A] = D0, <br>
 +
Addr[A+1] = D1, <br>
 +
Addr[A+2] = D2</span></p></td>
 +
<td colspan="1" rowspan="1" bgcolor="#E0E0E0" width="121px" class="whs20">
 +
<p class="TableText"><span class="Code">2 : 4 5 6</span><br>
 +
Address:<span class="Code"> 01234567</span><br>
 +
Data:<span class="Code"> &nbsp;&nbsp;&nbsp;00456000</span></p></td></tr>
 +
</tbody></table>
 +
</center></html>
  
 
FONTE: http://quartushelp.altera.com/9.1/mergedProjects/reference/glossary/def_mif.htm
 
FONTE: http://quartushelp.altera.com/9.1/mergedProjects/reference/glossary/def_mif.htm

Edição das 15h41min de 26 de junho de 2012

Memory Initialization File (.mif)

An ASCII text file (with the extension .mif) that specifies the initial content of a memory block (CAM, RAM, or ROM), that is, the initial values for each address. This file is used during project compilation and/or simulation. You can create a Memory Initialization File in the Memory Editor, the In-System Memory Content Editor, or the Quartus II Text Editor.

A Memory Initialization File serves as an input file for memory initialization in the Compiler and Simulator. You can also use a Hexadecimal (Intel-Format) File (.hex) to provide memory initialization data.

A Memory Initialization File contains the initial values for each address in the memory. A separate file is required for each memory block. In a Memory Initialization File, you must specify the memory depth and width values. In addition, you can specify data radixes as binary (BIN), hexadecimal (HEX), octal (OCT), signed decimal (DEC), or unsigned decimal (UNS) to display and interpret addresses and data values. Data values must match the specified data radix.

When creating a Memory Initialization File in the Quartus II Text Editor, you must start with the DEPTH, WIDTH, ADDRESS_RADIX and DATA_RADIX keywords. You can use Tab "\t" and Space " " characters as separators, and insert multiple lines of comments with the percent "%" character, or a single comment with double dash "--" characters. Address : data pairs represent data contained inside certain memory addresses and you must place them between the CONTENT BEGIN and END keywords, as shown in the following examples.


% multiple-line comment multiple-line comment %

-- single-line comment

DEPTH = 32; -- The size of data in bits WIDTH = 8; -- The size of memory in words ADDRESS_RADIX = HEX; -- The radix for address values DATA_RADIX = BIN; -- The radix for data values CONTENT -- start of (address : data pairs) BEGIN

00 : 00000000; -- memory address : data 01 : 00000001; 02 : 00000010; 03 : 00000011; 04 : 00000100; 05 : 00000101; 06 : 00000110; 07 : 00000111; 08 : 00001000; 09 : 00001001; 0A : 00001010; 0B : 00001011; 0C : 00001100;

END; </syntaxhighlight>

<html>

<colgroup><col> <col> <col class="whs15"> </colgroup><tbody> </tbody>

Address : Data Pairs Syntax Rules

Definition

Example

A : D

Addr[A] = D

2 : 4
Address: 01234567
Data:    00400000

[A0..A1] : D

Addr[A0] to [A1] contain data D

[0..7] : 6
Address: 01234567
Data:    66666666

[A0..A1] : D0 D1

Addr[A0] = D0,
Addr[A0+1] = D1,
Add [A0+2] = D0,

Addr[A0+3] = D1,

until A0+n = A1

[0..7] : 5 6
Address: 01234567
Data:    56565656

A : D0 D1 D2

Addr[A] = D0,
Addr[A+1] = D1,
Addr[A+2] = D2

2 : 4 5 6
Address: 01234567
Data:    00456000

</html>

FONTE: http://quartushelp.altera.com/9.1/mergedProjects/reference/glossary/def_mif.htm