Visible to Intel only — GUID: xrj1675739644540
Ixiasoft
Visible to Intel only — GUID: xrj1675739644540
Ixiasoft
3.3. Custom Instruction Word Format
The Nios® V processor custom instructions are based on the R-type instruction format. The instruction word specifies the selector index, extension index, immediate, ALU switch and register usage. The ctrl port delivers the 32-bit custom instruction word to the custom logic blocks.
Besides the opcode (hardcoded in Platform Designer), rs2, rs1, and rd fields (allocated during software compilation), you can assign funct7 and funct3 fields to serve different purposes. You can either hardcode the funct7 and funct3 fields in Platform Designer or translate the fields as input arguments in the software C-macro.
32-bit Custom Instruction Bit Field | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
funct7[6:0] | rs2 | rs1 | |||||||||||||
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
rs1 | funct3[2:0] | rd | opcode |
Each of the bit field serves the following purposes:
Bits | Function |
---|---|
funct7[6:4] |
|
funct7[3:0] |
|
rs2 | Source register of data1 |
rs1 | Source register of data0 |
funct3[2:0] |
|
rd | Destination register for result |
opcode | Required selector index |