Forum Discussion
Altera_Forum
Honored Contributor
14 years agoThe combinational block is now fully functional. Now I'm trying to build a multicycle custom instruction which performs filtering in 4 clock cycles. The waveform of my component is available in the attached files.
I have also attached the configuration of the interface in component editor; I specified the number of clock cycles required. Here is my problem : when I go to the software part and I try my filter with that code : # include <system.h> # include <unistd.h> int main() { int i; int res=20; //int j; int tab[25]={256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; for(i=0;i<25;i++) { res=ALT_CI_MY_FIR_CI_INST(tab[i]); printf("Iteration %d ; mem = %d \n",i,res); } return 0; } I get the following results : Iteration 0 ; mem = 0 Iteration 1 ; mem = -14 Iteration 2 ; mem = 10 Iteration 3 ; mem = 12 Iteration 4 ; mem = 16 Iteration 5 ; mem = 21 Iteration 6 ; mem = 25 Iteration 7 ; mem = 29 Iteration 8 ; mem = 32 Iteration 9 ; mem = 32 Iteration 10 ; mem = 32 Iteration 11 ; mem = 29 Iteration 12 ; mem = 25 Iteration 13 ; mem = 21 Iteration 14 ; mem = 16 Iteration 15 ; mem = 12 Iteration 16 ; mem = 10 Iteration 17 ; mem = -14 Iteration 18 ; mem = 0 Iteration 19 ; mem = 0 Iteration 20 ; mem = 0 Iteration 21 ; mem = 0 Iteration 22 ; mem = 0 Iteration 23 ; mem = 0 Iteration 24 ; mem = 0 These results are correct but there is a lag of one sample. Where could be the problem ?