Forum Discussion
MIF file
- 4 years ago
Hi Yitim,
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.
The format is like this:
DEPTH = 32; -- The size of memory in words
WIDTH = 8; -- The size of data in bits
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;
END;
You can easily use memory editor to create a mif file in file--> new --> memory file --> select your option.
Yitim,
May I know if there is any update?
- efe3734 years ago
New Contributor
Hi,
Because you said 'Data values must match the specified data radix.', I wrote everything in binary, not hexadecimal. So, there is no problem. However, I wish Quartus do bit reduction when I specify 18-bit word length and write 0x3FFFF. Thanks.