- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am a FPGA designer(VHDL Coder) and we are planning on implementing a NIOS 2 processor into our VHDL designs. I took the NIOS 2 class which Altera was offering, the instructor wasn't very helpful in the software aspect of the NIOS. He basically said "I do not know anything about the software part of NIOS". He showed us how to connect it to our VHDL code and what NIOS can do. We did the labs to the class, but the labs didn't help us understand how to create a custom component or custom instruction from scratch.
Here is a picture of what I would like to implement using onboard memory. http://boracoalition.org/members/milkman/blah.GIF How can I go about in implementing this? Can anyone provide an easy tutorial from scratch in implementing this? Thanks in advance, PatelLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ug_nios2_custom_instruction.pdf file in the documentation directory outlines the custom instruction.
Did you say that your application is going to reside in internal memory (no external memory)? If so, you might want to be carefull, because the HAL/IDE generates large code images that might not fit in the internal memory. Granted there are a bunch of things you can do to shorten the image, but I have found that the internal memory is just too small for medium-complex apps. If you need floats and/or printfs, you'll probably run out of memory. Good Luck, Rick- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, we are using the stratix 2-130 package. At this point we have no choice because the board is out to fab already and time is very short for us. As of right now, we want the microprocessor do arithmetic functions like logarithmic of a number or drive some logic.
I will go ahead and start reading the pdf, do you know of any other documentation which would be helpful?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Patel,
Your question seems along the lines of "Where do I start?", in which case I'd ignore the advice to read about custom instructions until you have a better base of knowledge. I would recommend that you start by either reading the Nios II Software Developers Manual which can be found under your install in altera\kits\documents\n2sw_nii5v2.pdf, or alternatively if you start up the Nios II IDE under the help manual there are many tutorials.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, I have created code and attached a vhdl component with it and it works. I tested it out on the dev board with IDE. I was able to run the program and debugged it to make sure all the variables are getting the right value. Now here is my question, how do I make it so the C code will be in the on-chip memory(pre-initializing a RAM). So when I boot up the stratix 2-130,1024 fpga, the C code will start up instantly. I tried using the flash programmer but it only gives me an option to burn the code onto an external ram. I wish we could place external memory onto our board but it is too late for it.
Also, 99.9% of the fpga(65% utilization) is VHDL code. How do I get both C code and VHDL(top level) code into the FPGA? I currently have a Stratix 2 NIOS dev board. any help will be greatly appreciated Patel- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On-chip memory built out of M4Ks can be initialised when the PLD is configured.
By default the initialisation file is stored in the same directory as the PTF file - edit your on-chip ram component to find out the name of the file for your particular memory. If you store anything into an on-chip memory then the IDE will write the appropriate contents into the correct file so that next time you compile a design in Quartus II it will store the software into the on-chip memory. You can select incremental compile to speed up this recompile if the hardware hasn't changed (Quartus II will skip the synthesis and routing stages and just do the final stage of assembling all the data to create the PTF file).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
okay I understand and now know how to implement it, but I ran into a bit of a problem trying it out on the dev board. Everytime I boot up the board it goes into the user region of the flash memory. How do I make it go back to the way it was when I first took it out of the box? I tried restoring it to the factory settings as specified in Appendix B in the Nios Development Board Reference Manual but that didn't work. Everytime I boot the board up, it still goes into the user region instead of factory region.
Also, I have created a program which will boot on internal ram blocks. I program it on the fpga. Will it run the program once I boot(power down and power it back up) the board up or will it stay in the factory or user regions? Patel
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page