Forum Discussion
Altera_Forum
Honored Contributor
11 years agoCustom instructions are probably a good way to teach software engineers a bit of VHDL.
You also get some insight into the way the nios works by finding your custom instruction logic in the RTL viewer. I have a string suspicion (not verified) that the 'readra' and 'readrb' bits are ignored. All other instructions (except call/jmp) will stall if the A register has been written, and stall on the B register if the bottom two bits of the opcode differ (or are the same - forgotten which). In many cases the A/B fields are coded as zero in order to aviod the stall. In any case, if readrb is zero the B field can be used for any purpose - I use it to select between 16bit and 32bit byteswap.