Visible to Intel only — GUID: hhw1675740225404
Ixiasoft
4.3.1. Writing the Custom Instruction HDL File
4.3.2. Opening the Component Editor
4.3.3. Specifying the Custom Instruction Component Type
4.3.4. Displaying the Custom Instruction Block Symbol
4.3.5. Adding the Custom Instruction HDL File
4.3.6. Configuring the Custom Instruction Parameter Type
4.3.7. Setting Up the Custom Instruction Interfaces
4.3.8. Saving and Adding the Custom Instruction
4.3.9. Generating and Compiling the Processor System
Visible to Intel only — GUID: hhw1675740225404
Ixiasoft
3.3.3. User-defined Immediate
You can apply the funct7 or funct3 field as a user-defined immediate by assigning “x” in the Software C-Macro, in the Platform Designer. Assigning the logic translates the fields into input arguments in the Software C-Macro.
Note: Platform Designer translates the bit field to the user-defined immediate when assigning the logic "x" in Software C-Macro only.
Software C Macros with funct3 and funct7 fields assigned with "x"
#define CUSTOM_OPERATION(VAL_1, VAL_2, F3, F7) ({ \
int output; \
asm volatile (".insn r 0x2B, %[FUNCT3], (0x0 | (%[FUNCT7]<<0)), %[out], %[input1], %[input2]" \
: [out] "=r" (output) \
: [input1] "r" (VAL_1), [input2] "r" (VAL_2), [FUNCT3] "i" (F3), [FUNCT7] "i" (F7)); \
output; \
})