- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am not sure but i think either you might have forgotten to specify as Internal register file while preparing the SOPC Builder or may you can do one thing you specify in the main itself the a(internal register address) b(internal register address ) and c(internal register address) and try if whether the compiler will take the values Please let me know if you are able to solve the issue Thanks and regards M Kalyan srinivas- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
i think there is really no Makro to handle those register-files, which means you have to handle them yourself. i tried with the assembler instruction asm("custom n, xC, xA, xB"); where n is the id of the cutom instruction. if you replace the 'x' with a 'c', you address the vhdl-description of the custom instruction. the only problem is, that if you disassemble the code, he doesn't even use this insturction. instead of asm("custom 8, c7, c8, c9"); it translates custum 8, c1, c2, c3
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page