8.1 Experiment Objective
Study the internal memory block of FPGA
Study the format of *.mif and how to edit *.mif file to configure the contents of ROM
Learn to use RAM, read and write RAM
8.2 Experiment Requirement
- Design 16 outputs ROM, address ranging 0-255
- Interface 8-bit switch input as ROM’s address
- Segment decoders display the contents of ROM and require conversion of hexadecimal to BCD output.
8.3.1 Design Procedure
Build a new project named memory_rom
In Installed IP, choose Library > Basic Function > On Chip Memory > ROM: 1-PORT, file type to be Verilog HDL. Choose 16 bits and 256 words for output. See Fig 8. 1
Fig 8. 1 RAM IP core invoking
3. According to the default setting, you need to add an initial ROM file in the location where red oval circles. See Fig 8. 2. In the figure, a *.mif file has already been added. (Refer to the project files)
4. Create a top level entity rom.mif
a. Go to File > New > Memory Files > Memory Initialization File. See Fig 8. 3
Fig 8. 2 ROM setting
Fig 8. 3 New *.mif file
b. In Fig 8. 4, modify the Number of words and Word size.
c.In Fig 8. 5. In the address area, right click and you can input the data or change the display format, such as hexadecimal, octal, binary, unsigned, signed, etc.
After completing the ROM and IP’s setting, fill the data for rom.mif. For convenience of verification, store the same data as the address from the lower byte to higher byte in ascending form. Right click to select Custom Fill Cells. See Fig 8. 6. The starting address is 0, ending at 255 (previous address setting depth is 256). The initial value is 0 and the step is 1.
After the setup, the system will fill in the data automatically. See Fig 8. 7
Refer to the design of conversion from hexadecimal to BCD in Experiment 7, display the data in ROM to the segment decoders. (You can refer to the project files attached)
8.3.2 Board Verification
Compile, lock the pins, and verify the experiment downloading the program to the develop board.
- How to use the initial file of ROM to realize the decoding, such as decoding and scanning the segment decoders.
- Write a *.mif file to generate sine, cosine wave, and other function generators.
- Comprehend application, combine the characteristic of ROM and PWM to form SPWM modulation waveform.