Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12690 Discussions

how to use vhdl program in the NIOS?

Altera_Forum
Honored Contributor II
1,252 Views

pls give me a simple example about how i can add a vhdl program to the nios cpu ? 

what is format of the vhdl program ?
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
512 Views

You should first create an IUL between your VHDL and Nios system. Then you create a block symbol of your VHDL if necessary. Finally assign the linking pins correspondingly.

0 Kudos
Altera_Forum
Honored Contributor II
512 Views

To put that a bit simplier. 

 

1) Add a component in SOPC builder called "Interface to User Logic". 

2) Study the signals in that interface under the timing (and set your timing up) 

3) Design your custom hardware in VHDL, Verilog, Block Diagrams, etc... (with the proper pin names if you allow SOPC builder to connect them automatically, otherwise they will become input/outputs to your SOPC builder system). 

4) Connect your hardware (if not done already) 

5) Access your hardware using pointers (with NIOS I declare your pointers with volatile and use them normally, in NIOS II declare your pointers volatile and use the cache bypassing functions (otherwise you'll probably cause cause hits instead of accessing your hardware). 

 

Sorry for not going into more detail but I have to run. 

 

Good-luck
0 Kudos
Altera_Forum
Honored Contributor II
512 Views

 

--- Quote Start ---  

originally posted by badomen@Dec 7 2004, 10:54 AM 

to put that a bit simplier. 

 

1)  add a component in sopc builder called "interface to user logic". 

2)  study the signals in that interface under the timing (and set your timing up) 

3)  design your custom hardware in vhdl, verilog, block diagrams, etc... (with the proper pin names if you allow sopc builder to connect them automatically, otherwise they will become input/outputs to your sopc builder system). 

4)  connect your hardware (if not done already) 

5)  access your hardware using pointers (with nios i declare your pointers with volatile and use them normally, in nios ii declare your pointers volatile and use the cache bypassing functions (otherwise you'll probably cause cause hits instead of accessing your hardware). 

 

sorry for not going into more detail but i have to run. 

 

good-luck 

--- Quote End ---  

 

Thank u very much ! 

i have to read more materials about NIOS! 

will you give me a simple example about it ? 

 

thans u again!
0 Kudos
Altera_Forum
Honored Contributor II
512 Views

hmmmmm. 

 

Ok lets say you have your embedded system and you find that you need some input from the outside world coming into the processor, but you don't want everything coming in, so you implement some type of filter that will only let in what the CPU should see. 

 

Create a filter (VHDL, Verilog, AHDL, Block diagram, etc...) in hardware and make sure that you follow the specifications of the avalon bus (the switch fabric that connects everything in your SOPC system). Create an interface to user logic (so that your new hardware is addressed like a memory space). Then you simply perform reads and writes to this device to use it. 

 

I know that probably doesn't help much, but there are billions of different things you can do using hardware added to your system so it's a pretty broad question. Posted elsewhere in this forum are a bunch of cores that you can add to the Nios, so if you take a look at those you might get a better idea of what I'm trying to say. 

 

Also so that you know there is also the ability to extend the Nios instruction set using what is called a "Custom Instruction". This allows you to create hardware once again to perform a specific task, however instead of adding it to the avalon bus it becomes its own piece of the ALU. So before you try creating your hardware I would try to determine what type of functionality it is (i.e. is it something that you need to read and write a lot of data to, or it something that simply takes in up to 2-3 inputs and outputs a result).
0 Kudos
Reply