Quartus ROM Creation Instructions for EE 3701 at University of Florida - Prof. Karl S. Gug, Study Guides, Projects, Research of Electrical and Electronics Engineering

Instructions on how to create a rom using quartus software for electrical and computer engineering students at the university of florida. It covers creating a new project, adding an lpm_rom component, defining the device family, setting the width and depth, creating a mif file, and simulating the design. The document also includes important notes on simulation and timing.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 03/10/2009

koofers-user-tfm-1
koofers-user-tfm-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
University of Florida EEL 3701 Drs. Eric M. Schwartz & Karl Gugel
Department of Electrical & Computer Engineering Revision 0 13-Sep-08
Page 1/3 Quartus ROM Creation Instructions
1
Figure 1: An lpm_rom component.
VCC
A
[9..0] INPUT
D[7.. 0]
OUTPU T
address[9..0] q[7.. 0]
lpm_rom0
inst
D[7. . 0]A[9..0]
Figure 2: ROM with signals named and defined.
Problem: You have an ASM or CPU that you would like to control/test from an EEPROM. How can
you simulate the EEPROM under Quartus?
Solution:
Use the ROM model found in the “megafunctions | storage” library called “lpm_rom.”
Design Procedure:
1. Create a new project and BDF file (File->New…). In your schematic (BDF file), add an “lpm_rom” component found in
the “megafunctions” library under “storage.”
2. The MegaWizard Plug-In Manager should now help you with the rest of your design. (It will give a default name. I
suggest you use it.)
3. Select “Next” to use AHDL for the output file.
4. For the device family, pick something that has RAM. The
FLEX10K family has internal RAM, but only about 2kB. The
FLEX10KE family has a device (the EPF10K200SR240-3) that
has more then 64kB. For our example we will use the
FLEX10KE family (and you will eventually pick the
EPF10K200SR240-3 device).
5. We will make a 1k x 8 bit device (1kB), so we’ll need 8 data
bits and 10 address bits (210=1024 words). Answer “8” for
“How wide should the ‘q’ output bus be?” Answer “1024” for
“How many 8-bit words of memory?” Select “Next”.
6. Remove the checks so that neither the address or data port are
registered. Select “Next”.
7. Enter a new file name for your memory initialization file (MIF)
or use a previously made file like “rom_creation.mif” provided
on our web site. Select “Next”. Select “Next” again. Then
select “Finish”.
8. Place your ROM device somewhere in your “.bdf” window.
You should see something like Figure 1 when you try to
place the component onto your schematic:
9. Add a bus to the address inputs, address[9..0], and a bus to
the data outputs, q[9..0]. Label the address or data bus by
drawing it then typing the name. In Figure 2, we have used
A[9..0] and D[7..0] as the example names. They must be in
the form of “Name[msb..0]” where msb is the most
significant bit’s position, starting from zero on the right.
You can now use these signals anywhere else in your
circuit or as inputs & outputs (as shown in Figure 2).
pf3

Partial preview of the text

Download Quartus ROM Creation Instructions for EE 3701 at University of Florida - Prof. Karl S. Gug and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

Department of Electrical & Computer Engineering Revision 0 13-Sep-

Page 1/3 Quartus ROM Creation Instructions

Figure 1: An lpm_rom component.

VCC

A[9..0] INPUT

OUTPUT D[7..0]

address[9..0] q[7..0]

lpm_rom

inst

A[9..0] D[7..0]

Figure 2: ROM with signals named and defined.

Problem: You have an ASM or CPU that you would like to control/test from an EEPROM. How can

you simulate the EEPROM under Quartus?

Solution:

Use the ROM model found in the “megafunctions | storage” library called “lpm_rom.”

Design Procedure:

1. Create a new project and BDF file (File->New…). In your schematic (BDF file), add an “lpm_rom” component found in

the “megafunctions” library under “storage.”

2. The MegaWizard Plug-In Manager should now help you with the rest of your design. (It will give a default name. I

suggest you use it.)

3. Select “Next” to use AHDL for the output file.

4. For the device family, pick something that has RAM. The

FLEX10K family has internal RAM, but only about 2kB. The

FLEX10KE family has a device (the EPF10K200SR240-3) that

has more then 64kB. For our example we will use the

FLEX10KE family (and you will eventually pick the

EPF10K200SR240-3 device).

5. We will make a 1k x 8 bit device (1kB), so we’ll need 8 data

bits and 10 address bits (

10

=1024 words). Answer “8” for

“How wide should the ‘q’ output bus be?” Answer “1024” for

“How many 8-bit words of memory?” Select “Next”.

6. Remove the checks so that neither the address or data port are

registered. Select “Next”.

7. Enter a new file name for your memory initialization file (MIF)

or use a previously made file like “rom_creation.mif” provided

on our web site. Select “Next”. Select “Next” again. Then

select “Finish”.

8. Place your ROM device somewhere in your “.bdf” window.

You should see something like Figure 1 when you try to

place the component onto your schematic:

9. Add a bus to the address inputs, address[9..0], and a bus to

the data outputs, q[9..0]. Label the address or data bus by

drawing it then typing the name. In Figure 2, we have used

A[9..0] and D[7..0] as the example names. They must be in

the form of “Name[msb..0]” where msb is the most

significant bit’s position, starting from zero on the right.

You can now use these signals anywhere else in your

circuit or as inputs & outputs (as shown in Figure 2).

Department of Electrical & Computer Engineering Revision 0 13-Sep-

Page 2/3 Quartus ROM Creation Instructions

DEPTH = 1024; % Memory depth and width are required % WIDTH = 8; % Enter decimal numbers for each %

ADDRESS_RADIX = HEX; % Address and value radixes are optional % DATA_RADIX = HEX; % Enter BIN, DEC, HEX, or OCT; unless % % otherwise specified, radixes = HEX %

-- Specify values for addresses, which can be single address or range

CONTENT BEGIN

[0..F] : 0; % First 16 values are zero % 10 : 33; % Single address data % 11 : 5C; % Addr[11] = 5C % 12 : 99; 13 : A1; % Addr[13] = A1 % 14 : B2; 15 : C3; 16 : D4; % Addr[16] = D4 % [17..3FF] : FF; % remaining locations are FF % END ; % You must have END statement! %

Figure 3: Example MIF file, rom_creation.mif.

Figure 4: Example MIF file, rom_creation.mif, displayed in Quartus.

10. Create a MIF file that will contain the memory contents you want programmed in the ROM. This example is called

“rom_creation.mif” and can be created with a text editor in Quartus or other text editiors (i.e., Notepad, emacs, etc.).

This file is shown in Figure 3. Note that you can use any base you want (BIN, DEC, HEX or OCT) in the MIF file. The

DEPTH is the number of addresses (memory words) in the ROM and the WIDTH is the size of the data bus (the number

of data bits per word). This example has 16 locations with zeros, 7 different data values and then $FF for the remaining

locations.

11. You can also create a MIF file by selecting “File | New | Other Files | Memory Initialization File.

a. Then you must supply the “Number of Words” and the “Word Size”. These are 1024 and 8, respectively, in our

example.

b. A table will now appear. Enter your data directly in this table. All data in this table must used base 10 (unsigned

decimal).

c. Figure 4 shows the results of using or creating the rom_creation.mif file with a text editor and then opening it in

Quartus.