Hello wpaulus:
Thanks for your help. There is "mul" instruction in nios2 system and I found as follow:
mul
multiply
Operation: rC ← (rA × rB) 31..0
Assembler Syntax: mul rC, rA, rB
Example: mul r6, r7, r8
Description: Multiplies rA times rB and stores the 32 low-order bits of the product to rC. The result
is the same whether the operands are treated as signed or unsigned integers.
While we know the Nios2 instruction set is RISC, lots of clock cycles may needed when doing multiplication.What puzzled me was the introduction on page 15 of "Nios2 Processor Reference Handbook"
The Nios II processor is a general-purpose RISC processor core,
providing:
■ Full 32-bit instruction set, data path, and address space
■ 32 general-purpose registers
■ 32 external interrupt sources
■ Single-instruction 32 × 32 multiply and divide producing a 32-bit
result
■ Dedicated instructions for computing 64-bit and 128-bit products of
multiplication
■ Single-instruction barrel shifter
Does the content means CAN doing a 32 × 32 multiplication in ONE clock cycle?
Unfortunately, my work based on nios2 system is REAL TIME applitcation, in another word, that is time limited. And I need to do a 32 × 32 multiplication in 1 clock cycle for the best!
What's the worst, "mul" is one of "Unimplemented Instructions" as presented page 24 of "Nios2 Processor Reference Handbook" as follow:
Unimplemented Instructions
Some Nios II processor cores do not provide hardware to perform
multiplication or division operations. The following instructions are the
only operations that the processor core may emulate in software: mul,
muli, mulxss, mulxsu, mulxuu, div, divu. In such a core, these are
known as unimplemented instructions. All other instructions are
implemented in hardware.
The processor generates an exception whenever it issues an
unimplemented instruction, and the exception handler calls a routine that
emulates the operation in software. Therefore, unimplemented
instructions do not affect the programmer’s view of the processor.
What can I do now? Custom Instruction?