Forum Discussion
Altera_Forum
Honored Contributor
12 years agoAccelerating a C Function with User Logic
Hey. I've implemented an algorithm in NIOS II which is in C. The thing is that it's running too slow, as expected, because I have a function which is called many times. I want to accelerate that func...
Altera_Forum
Honored Contributor
12 years agoA custom instruction only has two 32bit inputs (+ the opcode word) and can generate one 32bit result (although it can access other fpga resources), typically they will be synchronous - but you could arrange to do things asynchronously.
A custom component would have to be accessed via the avalon bus, so getting data to/from nios registers is slower (the nios cpu always stalls for the duration of an Avalon cycle). It is probably more appropriate if you need to access other fgpa resources - especially large memory blocks. I've only used combinatorial custom instructions - mainly to speed up CRC16 and byteswapping.