Forum Discussion
Altera_Forum
Honored Contributor
13 years agoHi dsl,
Really appreciate the inputs. Now I understand the SOPC build process and came to know that that custom instructions could only be implemented through an HDL (In my project I will use Verilog, my professor demands that). I have decided to go ahead and try playing around with these concepts. Initially I thought the custom instructions could be implemented with a high level language like C or C++. However now I understand that all those Macros we discussed above are just like an interface to the application programmer (who can program in C) and the usage is entirely decided by the SOPC builder. Now what I plan to do is to implement the arbitrary precision logic custom instructions where the user can define the block numbers. Say the user says 32 blocks, the ALU is supposed to operate on 32 blocks of 32 bit data (s). An ADD Example: ADDCUSTOM with block size 4. This input asks the custom logic to add two operands of 128 bits, where 32 bits are added at one time. As usual I came up with a couple of questions here as well: 1) Inside the custom instruction, is it possible to call a NIOS ii normal instruction, like ADD (which can add two operands rC ← rA + rB) with the carry detection instruction added (CMPLTU). After a block operation we should be able to store the Carry bit for the next block for the ADD instruction. 2) Shall I come up with a separate ALU for this custom logic or is it possible for me to assign the NIOS ii ALU to do this logic, since the normal ADD instruction can be executed in the NIOS ii ALU itself? 3) Third question is about how to store the carry bit and the intermediate results. Is it possible to ask the custom ALU which might have an ACCUMULATOR to hold these values? Thank You, Akhil