Before you move on to the software design, make sure the top level module doesn’t have any errors. Of course you won’t know the logical errors until you get to the software design.
Moving on, you will find the Nios II SBT for Eclipse under Tools in the Quartus window.
Choose the default workspace (which should mostly be your project space). Then, to create a new file, choose “Nios II Application and BSP from template”. This will make Nios refer to the design files you created in Quartus. This is a critical link between not just Quartus and Eclipse, but also your hardware and software design.
As shown in the screenshot above, choose the sopcinfo file from the project folder. The Nios CPU name should show. If you have used multiple cpu’s, you must choose the appropriate one. Name your project and for the project template, choose ‘Hello World’. Since we have a SDRAM in our design, we can afford to use this template. If you are using only on-chip memory, then you must choose ‘Hello World Small’, this will shrink the program size and just enough to fit on the on-chip memory.
Hit ‘Finish’ and it should create a bunch of files in the sub-window in the left. In the hello_world.c file the following program was written:
* “Hello World” example.
* This example prints ‘Hello from Nios II’ to the STDOUT stream. It runs on
* the Nios II ‘standard’, ‘full_featured’, ‘fast’, and ‘low_cost’ example
* designs. It runs with or without the MicroC/OS-II RTOS and requires a STDOUT
* device in your system’s hardware.
* The memory footprint of this hosted application is ~69 kbytes by default
* using the standard reference design.
* For a reduced footprint version of this template, and an explanation of how
* to reduce the memory footprint for a given application, see the
* “small_hello_world” template.
Note: A lot of the statements here may be redundant, but hey, it works 🙂
Then build the program and wait for a ‘Build Finished’ statement. You may face some issue/errors here. One of them can say ‘Permission denied’ which is also the most common one. In such a case open Nios II SBT via Start->All Programs->altera and make sure to roght click on Eclipse and choose “Run as Administrator”. This should solve the problem.
Past all this, you have to RUN the program!
Choose a New Configuration under Run. Choose the project .elf file if its not selected by default. Also select the Target Connection tab and choose the USB Blaster. Check the Ignore mismatched system ID and Ignore mismatched system timestamp if and only if you encounter a problem later during execution of the file. Usually this doesn’t cause a problem.
Then save the configuration and simply Run. It should start processing and soon you will the output on your LCD screen!
At the time of writing this, I have boxed up my amazing Alter DE2-115 kit and brought in an evenmore interesting platform, Cyclone V SX (SoC). So I will no longer post about Cyclone IV but will post about the latest version of Cyclone series. It also has an ARM core! I’m so excited to be working with it. I will however be pleased to answer an questions about any of these kits!