I’m trying to get familiar with the SPT core and like to use the scalar product command.
The goal is to perform 8 multiply operations and compute the sum (don’t care about the Im() parts, set to 0).
In Matlab R2018b, I installed the “NXP_radar_Toolbox_for_S32R” toolkit, and tried the following:
a = [0,1,2,3,4,5,6,7];
c = [1,1,1,1,1,1,1,1];
M_Op = complex (a, 0)
M_Coeff = complex(c, 0)
no_of_taps = 8;
shft_val = 0;
M_Out = scp_mex(M_Coeff, M_Op, no_of_taps, shft_val)
Which gives me the result:
M_Out = 0.0000 + 0.0000i
But I would expect 0*1 + 1*1 + 2*1 + 3*1 + 4*1 + 5*1 + 6*1 + 7*1 = 28
What am I missing?
Solved! Go to Solution.
Hi Andreas,
The instruction has a scale after the multiplication is done of 13 bits, and another after the adding is done of 4 bits.
So if you run
a = [0,1,2,3,4,5,6,7]*2^17;
c = [1,1,1,1,1,1,1,1];
M_Op = complex(a, 0)
M_Coeff = complex(c, 0)
no_of_taps = 8;
shft_val = 0;
M_Out = scp_mex(M_Coeff, M_Op, no_of_taps, shft_val)
you will get
M_Out = 28.0000 + 0.0000i
Best regards,
Iulian
Hi Andreas,
The instruction has a scale after the multiplication is done of 13 bits, and another after the adding is done of 4 bits.
So if you run
a = [0,1,2,3,4,5,6,7]*2^17;
c = [1,1,1,1,1,1,1,1];
M_Op = complex(a, 0)
M_Coeff = complex(c, 0)
no_of_taps = 8;
shft_val = 0;
M_Out = scp_mex(M_Coeff, M_Op, no_of_taps, shft_val)
you will get
M_Out = 28.0000 + 0.0000i
Best regards,
Iulian
Perfect. Many thanks for your fast answer. I wonder where I can find more information about this shifting and the exact bit width used for the MUL and ADD operations?
Hi Andreas,
You should open a ticket here https://www.nxp.com/support/support:SUPPORTHOME.
Best regards,
Iulian
Hello Iulian,
I created such a ticket. Unfortunately, I didn't get any answers yet. Could you provide me more details about it?
Best regards,
Andreas
Hi andreas.schibilla@aptiv.com,
Sorry to hear that. Please escalate on the ticket support since we are not allowed to share documents that are marked as "confidential information"
Can you have a look at this issue. Thank you!
Daniel