Forum Discussion
Altera_Forum
Honored Contributor
15 years agoA custom instruction can only process two 32bit input values [1] and generate a single 32bit output value. It can change local state - provided it is a multi-cycle custom instruction and not a combinatorial one.
Combinatorial custom instructions are passed input data for EVERY instruction cycle, the output value will be used if the instruction decode indicates that it is required (this is how all the ALU instructions work). So it isn't clear how you intend doing 128bit arithmetic! You could do 64bit arithmetic using an external accumulator, passing the input values in rA and rB, and the opcode in C (with readrc = 0). You'd then need some way of reading the result, either a 2nd (combinatorial) custom instruction, or (maybe) if readrc = 1, use A (or B) (the 5 bit number) to determine which part of the result to read. Maybe you could do 128bit in a similar way - but you'd need to use two instructions to set a 128bit input value. [1] It actually has all of the 32bit instruction (ie the register numbers and the ra/rb/rc fields) and the two source register values as inputs. The register file is very likely to always be read for the 'A' and 'B' register numbers, and I strongly suspect that the readra/readrb fields are not used to disable a pipeline stall (ie they have no effect on the system logic).