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.

Instructions to use HETP Assembler Debug Output

The program 'hetp' creates a '.c' and '.h' file as output.

The '.h' file contains a data structure matching the het assembler code.

For example, a program starting with a CNT instruction followed by a ECMP instruction would

have the following lines in the .h file:

 

struct

{

     CNT_INSTRUCTION PCT_0;

     ECMP_INSTRUCTION AEB_0;

    ....

}

The types "CNT_INSTRUCTION" and "ECMP_INSTRUCTION" are defined in 'std_het.h'.   These types include the bitfield encoding of the HET program, control and data fields for each specific HET opcode.  

You should be able to open a watch window in CCS, and point to the HET RAM perhaps case as the type defined in the '.h' file output by hetp.

Then you should be able to click to browse the HET program in the debugger, with all the fields of the opcodes correctly decoded.  
This would be a major improvement to looking at just raw HEX in a memory window.   However, I haven't been able to make this work.

Looking for a recipe / instructions on how to make use of this data structure created by the assembler.

 

 

 

 

  • Hi Anthony,

    Can you try adding the Structure / structure pointer to the "Watch Window". It will show all the bit fields inside every instruction. I have debugged earlier with this approach.
    I think in memory window CCS does not show all the symbols inside a structure.

    Note: From NHET assembler version 1.5 "std_het.h" will be replaced with "std_nhet.h", Just the naming change. Also this file need not be included in main C file, it is already included inside "HET_CODExx.h" that assembler generates.

    Cheers!!!
    Prathap

  • Prathap,

    I tried the watch window  before posting, but didn't work for me.
    Please post the instructions on how you're doing it (step-by-step so I can replicate) and I'll try this.

    As far as I can tell the header file only declares a type but not an actual variable.  So I cast a pointer to the NHET RAM as the HET program data type declared in the header, and tried this in the watch window.  Getting an error about non-primitive data types and not being able to display them when I do this.

  • Anthony,

    Please have the following in the main / nhet C file

    /* Include Files */
    ......
    ......
    #include "nhet.h"             /* Module register */
    #include "HET_code.h" /* std_nhet.h is already included in this header file, if not include below this */
    ......

    /* Assigning pointers */
    NHET_ST  *NHET_Ptr         =         (NHET_ST *) NHET; /* Module Register Structure pointer */
    HETPROGRAM0_UN *HET_PROGRAM_Ptr          =        (HETPROGRAM0_UN *) NHET_RAM;  /* Pointer to the NHET RAM */

    /* Copying the opcode to the NHET memory */
    memcpy((void*) NHET_RAM, (void*) HET_INIT0_PST, sizeof(HET_INIT0_PST));

    /* Just a simple useage of pointer with one of the instruction (acnt) corresponding to the HET_Code.het file */
    HET_PROGRAM_Ptr->Program0_ST.Lable1_0.acnt.interrupt_enable=0;

    /* For Watchwindow to edit / monitor NHET opcodes */
    Add HET_PROGRAM_Ptr to watch window, expand it to see all the instructions.

    Hope this helps..

    Cheers!!!
    Prathap