Porting MIPSfpga to Terasic DE1 board with Altera Cyclone II FPGA

This topic contains 0 replies, has 1 voice, and was last updated by  Yuri 1 year, 8 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #52793

    Yuri
    Moderator

    I got a request from some university about using MIPSfpga on Terasic DE1 board with Altera Cyclone II FPGA. While I do not have this particular board in my board collection, I tried to help the teacher to port MIPSfpga to this board and I hope the university can adopt MIPSfpga to their curriculum. Below is a fragment of my email conversation with the teacher.

    Prof. XXX:

    I was able to comfortably fit MIPSfpga into DE1 using my variation of MIPSfpga Getting Started / Fundamentals package. I can show you how you can reproduce my result and then how you can correct your own port of MIPSfpga Getting Started by borrowing some of the components I have created.

    First, here is how to reproduce my result:

    1. Unzip MIPSfpga Getting Started to C:\MIPSfpga
    2. Get mipsfpgfa-plus into C:\github\mipsfpga-plus
    3. cd C:\github\mipsfpga-plus\boards\de1
    4. make_project.bat
    5. Run Altera Quartus II version 13.0 sp1
    6. Open project C:\github\mipsfpga-plus\boards\de1\project\de1.qpf
    7. Analyze/Synthesize/Place&Route/Assemble
    8. Open Device / Hardware Setup / ByteBlaster / Set file / ouput_files / de1.sof / Start

    You should get the following:

    Note I do not have a DE1 board with me so I did not test running on the board. However I am confident it will run either immediately or after I adjust my clock divider.

    Now how to correct your own port of DE1:

    1. First, I noticed that you have two versions of mipsfpga_ahb_const.vh with different sizes for ram and reset_ram. This is OK if you have a proper “set_global_assignment -name SEARCH_PATH” line in your .qsf file. Does Quartus pick the correct .vh file?
    2. I was able to fit the design comfortably by specifying 1KB reset_ram size and 1 KB user ram size. However the boot/reset sequence in the original MIPSfpga Getting Started does not fit into 1 KB because it is linked with crt0 from the standard C library. This crt0 code is totally unnecessary because its function is to setup C runtime in “big” operating systems before calling main() and most of it is not applicable for MIPSfpga. By omitting calling crt0 and setting up a stack pointer inside the boot sequence itself, it is possible to shrink the boot sequence to 1KB. You can get it here – https://github.com/MIPSfpga/mipsfpga-plus/blob/master/programs/00_counter/boot.S
    3. Now you may say that 1 KB for user ram is too small. Still, it is enough to do many lab exercises, and if you need more, it is possible to write an interface to the 8 MB SDRAM present on the DE1 board.
    4. Also, if you need more block ram, it is possible to eliminate EJTAG module and load the software program into your synthesized system via UART present in DE1 board.
    5. Options like “set_global_assignment -name ENABLE_ADVANCED_IO_TIMING ON” can bloat the design. If you use it, this would explain why you cannot fit. You can see my constraint file right here – https://github.com/MIPSfpga/mipsfpga-plus/tree/master/boards/de1
    6. I got Fmax 45.97 MHz on my synthesis so you may need to adjust PLL to divide 50 MHz clock.
    7. If necessary, I can sit with you over Skype and make sure you fit the MIPSfpga into DE1 and can run it. My Skype is yuri.panchul.

    The whole thing is doable we just need to avoid the pitfalls I outlined (bloating options in constraint file, proper sizes for memories, compact bootloader, clock divider).

    1 user thanked author for this post.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.