This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS0x32 - ADD instruction with N2HET

Other Parts Discussed in Thread: TMS570LS0332

Hello,
I have a question concerning the ADD instruction on the N2HET micromachine of the TMS570LS0332 for a safety application.
I need to add an immediate value with the B register and I need to store it in a remote destination.
In the ADD control field, I set:
C[22:19] = 0001: src1 = IMM: current instruction address;
C[18:16] = 011: src2 = register B;
C[4:3] = 01: rdest = REM: remote destination specified by remote[8:0]

What is the best to set in the dest field as I want to store the result only in the remote destination
and no where else ? I would like to specify dest=NONE and be sure of storing it nowhere else.

Solution 1: C[7]C[2:1] = 011
But in SPNU517B page 647, it is said "case 011:IR2 is not stored in register, immediate".
What means immediate ? I don't want to store the result immediate data field.
How much cycle would require this instruction ?

Solution 2: C[7]C[2:1] = 000
But in SPNU517B page 647, it is said "case 000:A[24:0] = IR2[31:8]".
I don't want to store the result in the A register which is used for an other timer in my application.

Solution 3: C[7]C[2:1] = 010
The result is save into an unsued register such as register T.
How much cycle would require this instruction ?

Line 8 in table 17-53 of SPNU517B: in the dest column, the term n/a (meaning not applicable, I suppose) is confusing with regard to the
Execution description page 647 :
/********** WRITE REGISTER DESTINATION STAGE ***********/
switch (C7, C2:C1)
{
case 000:A[24:0] = IR2[31:8]
case 001:B[24:0] = IR2[31:8]
case 010:T[31:0] = IR2[31:0]
case 011:IR2 is not stored in register, immediate
case 100:R[31:0] = IR2[31:0]
case 101:S[31:0] = IR2[31:0]
case 110:Immediate Data Field[31:0] = IR2
case 111:IR2 is not stored in register, immediate
}

Thank you in advance for your  answers and clarifications;

Jean Daniel

  • Hello Jean,

      Your original idea is the correct way by simply specifying the dest=NONE. So no registers will be updated with the result but only the remote address location. See below example.

     ADD { src1=B,src2=IMM,dest=NONE,rdest=REM,remote=My_Remote_Address,data=0x1};

  • Hi Martin,
    Do you have any more questions on using the ADD instruction? If your question is answered can you please click the Verify Answer button? Thanks.
  • Hi Charles,

    Thank you for your answer.

    I did not know how to set dest="none", and I see that the instructions generated by HET IDE adopt the Solution 1 that I detailled above (Solution 1: C[7]C[2:1] = 011).

    I have tested in debug with JTAG that this solution do not store the result in the immediate data field of the ADD instruction, so this solution is the right one form me.

    However, what does immediate mean in SPNU517B page 647, "case 011:IR2 is not stored in register, immediate" ?

    As my application is a safety application, I want to perfectly conform with the datasheet.

    Secondly, what is the number of cycle for this ADD solution 1 ?

    Thank you in advance.

    Jean Daniel

  • Hi Martin,

    case0011: means that the IR2 will not be store in any register and neither the immediate data field which is the DF[31:0]

    This instruction will take 3 cycles to complete since it needs to write to the remote address.