Chapter 7: User Flash Memory in MAX V Devices
7–39
Creating Memory Content File
Creating Memory Content File
You can initialize the content of the UFM through a memory content file. The
Quartus II software supports two types of initial memory content file format: Memory
Initialization File (.mif) and Hexadecimal File (.hex). A new memory content file for
the UFM block can be created by clicking New on the File menu. Select the .mif or
.hex file in the Other Files tab.
After clicking OK, a dialog box appears. In this dialog box, the Number of words
represents the numbers of address lines while the Word size represents the data
width. To create a memory content file for the ALTUFM megafunction, enter 512for
the number of words and 16for the word size.
The memory content is written into a .hex file. On the Tools menu, click MegaWizard
Plug-In Manager. The memory content file (data.hex) is included on the respective
ALTUFM MegaWizard Plug-In Manager. Click Yes to use this file for the memory
content file. Click Browse to include the memory content file.
Memory Initialization for the ALTUFM_PARALLEL Megafunction
For the parallel interface, if a .hex file is used to initialize the memory content for the
ALTUFM megafunction, you must fully specify all 16 bits in each memory address,
regardless of the data width selected. If your data width is less than 16 bits wide, your
data must be placed in the MSBs of the data word and the remaining LSBs must be
padded with 1’s.
For an example, if address_width=3 and data_width=8are selected for the
ALTUFM_PARALLEL megafunction, the .hex file should contain eight addresses of
data (23 addresses), each word containing 16 bits. If the initial content at the location
000is intended to be 10101010, you should specify 1010101011111111for address 000
in the .hex file.
1
This specification applies only to .hex files used with the parallel interface. .mifs do
not require you to fully specify 16 bits for each data word. However, both .mif and
.hex files require you to specify all addresses of data according to the address_width
selected in the megafunction.
Memory Initialization for the ALTUFM_SPI Megafunction
The same 16-bit data padding mentioned for ALTUFM_PARALLEL is required for
.hex files used with the SPI Base (8 bits) and Extended (16 bits) mode interface. In
addition, for SPI Base and Extended modes, you must fully specify memory content
for all 512 addresses (both sector 0 and sector 1) in the .mif and .hex files, even if
sector 1 is not used. You can put valid data for SPI Base mode addresses 0 to 255
(sector 0), and initialize sector 1 to all ones.
January 2011 Altera Corporation
MAX V Device Handbook