Visible to Intel only — GUID: jjh1675739082974
Ixiasoft
Visible to Intel only — GUID: jjh1675739082974
Ixiasoft
2.3. Extended Custom Instruction
Extended custom instruction is an extension to multicycle custom instructions. An extended custom instruction allows a single custom logic block to implement several different operations.
Extended custom instruction components implement multiple indexes, comprised of opcode, funct7, and funct3. These indexes are determined when the custom instruction hardware block is instantiated in the system using Platform Designer.
While the selector indexes (opcode and funct7[6:4]) are required to select the correct logic block, extended custom instructions decode extension indexes (funct7[3:0] and funct3[2:0]) to specify which operation in the logic block to perform. The extension index can be up to seven bits wide, allowing a single custom logic block to implement as many as 128 different operations. Paired with 32 logic blocks in a single Nios® V processor, this enables up to 4096 custom instructions per processor.
To implement an extended custom instruction, apply the ctrl port to your custom instruction logic. The total bit width of the funct7[3:0] and funct3[2:0] port is a function of the number of operations the custom logic block can perform.
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 |
Selector Index | Extension Index | Supported Custom Instructions (per opcode) | ||
---|---|---|---|---|
opcode | funct7[6:4] | funct7[3:0] | funct3[2:0] | |
custom-0 | 1 custom logic blocks | Idle | Idle | 1 custom instructions |
custom-1 | 8 custom logic blocks | Idle | Idle | 8 custom instructions (1 per logic block) |
custom-2 | 8 custom logic blocks | As extension index | Idle | 128 custom instructions (16 per logic block) |
custom-3 | 8 custom logic blocks | As extension index | As extension index | 1024 custom instructions (128 per logic block) |
Total custom instruction in this processor | 1161 custom instructions |