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++
12596 Discussions

nios 2 custom instruction having multiple inputs

Altera_Forum
Honored Contributor II
1,088 Views

Hello Everyone,  

I am implementing sobel edge detection on de2 board using nios2 processor. I want to create custom instruction for sobel kernel. I have created verilog module for my sobel kernel.  

question is nios2 custom instruction allows only two inputs dataa and datab while in my sobel kernel , I have eight inputs. can anyone guide me how to create custom instruction for multiple inputs.  

Here I have attached my verilog code also. 

Thanks
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
373 Views

You cant move 8 inputs to a custom instruction in a single clock. You can use the register file interface, or use multiple opcodes to break up the data from the execution. 

 

Often, custom instructions are being used to speed things up. So if you care about performance, you need to look at where the 8 input data are coming from. If they aren't already in the register file, the NIOS would need to take some time to get them there before executing the CI. - maybe that's fine or maybe that's terrible depending on your goal.
0 Kudos
Altera_Forum
Honored Contributor II
373 Views

Hi Ted,  

I have image matrix in my nios2 c code. I will take 8 surrounding pixel values and want to set them as an input arguments for custom instruction. Can you guide me about register file interface because in my case it will be the only option to perform my task.
0 Kudos
Altera_Forum
Honored Contributor II
373 Views

Hi Ted,  

I have image matrix in my nios2 c code. I will take 8 surrounding pixel values and want to set them as an input arguments for custom instruction. Can you guide me about register file interface because in my case it will be the only option to perform my task.
0 Kudos
Reply