Forum Discussion
Altera_Forum
Honored Contributor
14 years agoA custom instruction is limited to two 32bit inputs (and one output) because of the design of the nios cpu - that can't change.
What you do with the values and the other other register fields is rather up to your imagination... If you write a non-combinatorial instruction (and make sure that only one thread uses the hardware at a time) you can save state between instructions. So if 'writerc' is 0, you can use the 'C' bits as a sub-opcode (rather than a register number) - so maybe 'load first', 'load next', 'load last' ? Similarly you can use 'readrb' of 0 to indicate other special actions. However loading data via the nios is probably slow - if you really need a sort accelerator you probably need to give it an Avalom master interface so it can directly access the data in memory.