Altera_Forum
Honored Contributor
16 years agousing register-file in custom instruction
hello,
i want to create a custom instruction with more than two inputs, that can be changed randomly. The custom instructions user guide (www.altera.com/literature/ug/ug_nios2_custom_instruction.pdf) (http://www.altera.com/literature/ug/ug_nios2_custom_instruction.pdf)) says, that you can use the internal registers of the custom instruction instead of the nios register-file, if you instantiate a custom instruction with the following IOs dataa[31..0] datab[31..0] result[31..0] clk clk_en start reset done n[7..0] a[4..0] readra b[4..0] readrb c[4..0] writerc where a,b and c are the adresses of these internal registers. The problem is, that the system.h only gives me a makro, with A (=dataa), B (=datab) and n (= extended opcode).
#define ALT_CI_GP_ALU_NIOS_CUSTOM_INSTR_WRAPPER_INST(n,A,B) __builtin_custom_inii(ALT_CI_GP_ALU_NIOS_CUSTOM_INSTR_WRAPPER_INST_N+(n&ALT_CI_GP_ALU_NIOS_CUSTOM_INSTR_WRAPPER_INST_N_MASK),(A),(B))
so, how can i set the internal register file adresses (a,b and c) ? Tanks keitall