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.

TMS570LS3137 - HET_v2 flag in HALCoGen vs HET IDE

Other Parts Discussed in Thread: HALCOGEN

Hello,

HALCoGen 3.06.00 defines HET_v2 as 0 in std_nhet.h.  HET IDE 3.3 defines it as 1 in its include file.  Is this flag used for anything (i.e., do I need to manually change std_nhet.h)?

Thanks, Charlie Johnston

  • Charles,

    This flag is used to differentiate N2HET from NHET.

    Depending on the device you are using, this flag has to be defined to 0 for NHET and 1 for N2HET.

    Your finding is correct. HET GUI defines HET_v2 to 1 when the selected device includes N2HET and does not define HET_v2 for NHET.

    I've forwarded this finding to the HALCOGEN team. I will be back to you as soon as they confirm the problem.
    In the mean time, you can force in the compiler option the definition of HET_v2 to 1 (if you use N2HET).
    Note that this has no real impact on the execution of your NHET/N2HET code.

  • Hi Jean-Marc,

    I see where the NHET assembler has a -v2 flag, but I don't see how HALCoGen or any of its generated code use the constant HET_v2.  It also appears that HALCoGen does not use the NHET assembler.

    Thanks, Charlie

     

  • Charles,

    The HET_v2 definition is used in std_nhet.h

    #if HET_v2
      uint32 branch_condition     : 5 ;
    #else
      uint32 branch_condition     : 3 ;
      uint32                                      : 1 ;
      uint32                                      : 1 ;
    #endif

    Halcogen does not use the NHET assembler. The code generated by Halcogen is pre-assembled. So there is no need to run NHET assembler.
    This code in Halcogen is more a demonstration code than anything else.
    If you have to create and develop your own NHET program than the use of HET_GUI is the correct way.
    HET_GUI provide a way to export your NHET program to Halcogen. It will replace the NHET code from Halcogen by your code coming from HET_GUI.

  • Jean-Marc,

    You're right - I missed that conditional in std_nhet.h.  So if we use the driver code in het.c, we should manually change the #define until it is changed in HALCoGen.

    Thanks, Charlie

  • Charlie,

    The other solution is to use in your CCS project properties, under Build->ARM Compiler->Advanced Options->Predefined Symbols and add HET_v2.

    The result will be the same.

  • Charlie,

    Just for follow up, the Halcogen team have recognize this problem as a bug. It will be fixed in the next release.
    In the mean time, the easiest way to workaround this problem is to use in CCS project definition the pre-defined symbol to set HET_v2 to 1.