fpga的reg怎样初始化_FPGA中几种初始化文件

本文介绍了Altera FPGA中用于内存初始化的.MIF文件格式,包括内存深度、宽度、地址基数和数据基数的定义,以及如何在Quartus II Text Editor中创建和编辑.MIF文件。内容涵盖数据对的表示方式和注释的插入方法,为FPGA开发中初始化ROM、RAM或CAM提供指导。
摘要由CSDN通过智能技术生成

一、

Altera ROM

初始化文件——

mif

文件格式

以下文字引自

Altera

公司的资料。

Memory Initialization File (.mif) Definition

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;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值