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.

Problem when migrating from CCS v5.4 to CCS v6.1

Hi,

I had a project that compiled perfectly in CCS v5.4 (C2000 compiler 6.1.3).

I just installed CCS v6.1 (6.1.0.00104) with C2000 compiler 6.4.4. Then I imported my old project in the new CCS (I didn't recreate the project manually).

Both projects also uses 

When trying to compile, I now have a few files that give me this kind of error:

>> path\my_file.c, line 1283:
INTERNAL ERROR: >>>Register allocation failed:
MyFunction


This may be a serious problem. Please contact customer support with a
description of this problem and a sample of the source files that caused this
INTERNAL ERROR message to appear.

Cannot continue compilation - ABORTING!


>> Compilation failure

 

I tried to change the optimization level in the compiler settings (from off to 1): the previous files with errors now compiled fine, but a new file is showing an issue.

Did anyone experienced the same kind of troubles during CCS version migration? I can see on the forum a few similar posts, but nothing that helped me directly.

 

Thanks,

Stephane

  • Stephane Mainier said:
    INTERNAL ERROR: >>>Register allocation failed:

    That always means there is a bug in the compiler.  (Well, maybe there was one case a long time ago where it wasn't a compiler bug. But anyway ...)

    Please submit a test case which allows us to reproduce the problem.  You do not need to submit the entire project.  Instead preprocess the problem source file and submit that.  Also show all the build options used.

    Thanks and regards,

    -George

  • Hi,

    Yes it looks like a compiler error, and not a CCS version issue. Still running CCS 6.1, I forced the compilation with the old compiler 6.1.3, and the compilation worked fine this time.

    So now I need to understand what doesn't work in the newest compiler. I looked at the instruction in your preprocess link. For some reason it doesn't seem to work for me: when I select the manual mode in "parser preprocessing options", plus the 2 options "-ppo" and "-ppa", it doesn't generate any .pp file anymore (at least I cannot see anything in the "source" folder under my  build target name. And in automatic mode, it generates a .pp file, but with only limited information (include files).

    I don't know if this is related, but I can also see in CCS 6.1 that I cannot compile individual files, the option "Build Selected File" is grayed out... This worked fine in CCS 5.4.

    Any idea how I should proceed for getting the preprocessed files?

    Thanks,

    Stephane

  • Stephane Mainier said:
    it doesn't generate any .pp file anymore (at least I cannot see anything in the "source" folder under my  build target name.

    The .pp file appears in the same directory as the related C file.  Is that this "source" directory?  Or somewhere else?

    Thanks and regards,

    -George

  • Thanks George, I was indeed looking in the wrong directory (I was looking at "source" in the output directory: ProjectFileFolder\TargetName\source)

    In parallelI worked a bit more on this and this time tried the different C2000 compiler versions inside CCS v5.4:

    • compiler 6.1.3: works fine
    • compiler 6.1.10: works fine
    • compiler 6.2.11: works fine
    • compiler 6.4.4: crash in compiler, same errors as during my tests with CCS v6.1

    I'm including here the .pp file for one of the files that is failing.

    code.pp.txt
     
    
    
    
    
     
    
    
    
    
    
    
    
    
    
    
    
    typedef  unsigned  int         SLB_INT16U;                       
    typedef  unsigned  long        SLB_INT32U;                       
    typedef  enum {                                                  
        SLB_FALSE = 0,
        SLB_TRUE
    } SLB_BOOL;
    
    
    
    
    
    typedef  enum  err
    {
        ERR_NONE = 0,                                       
    
    
    
    } ACQ_ERR;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    typedef enum
    {
    MEASURE = 0,                                                
    SIMULATE,                                                   
    INVALID_ACQ_MODE
    } eACQ_MODE;
    
    
    typedef enum
    {
        TESTMODE = 0                                                    
    
    } eTOOL_MODE;
    
    typedef enum
    {
        COMM = 0,                                                   
        DEV                                                        
    } eRAWDATA_MODE;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    typedef struct
    {
    
    SLB_BOOL            test;                        
    
    
    } BLA_INTERNAL_INFO;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    typedef struct msg1
    {
        SLB_INT16U dddddd[213];
        SLB_INT16U fffffff[213];
        SLB_INT16U nnnnnnn[213];
    } MSG1;
    
    typedef struct msg2
    {
        SLB_INT16U dddddd[213];
        SLB_INT16U fffffff[213];
        SLB_INT16U nnnnnnn[213];
    } MSG3;
    
    
    typedef struct msg3
    {
        SLB_INT16U dddddd[263];
        SLB_INT16U fffffff[263];
        SLB_INT16U nnnnnnn[263];
    } MSG2;
    
    
    extern void BLA_ReadMEM(eACQ_MODE acqMode, SLB_INT32U addr, SLB_INT16U *rdWrBuf);
    
    extern void BLA_fillFinalData(eACQ_MODE AcqMode, SLB_INT16U StartAddressInMEM, SLB_INT16U LenghtMEMPortion,
         SLB_INT16U FinalBinNumber, SLB_INT16U* FinalDataLocation, SLB_BOOL *pOverflow);
    extern void BLA_FillTestPositionInfo(SLB_INT16U sense, SLB_INT16U zone, BLA_INTERNAL_INFO *pPHAInfo);
    extern void BLA_fillFinalData(eACQ_MODE AcqMode, SLB_INT16U StartAddressInMEM, SLB_INT16U LenghtMEMPortion,
         SLB_INT16U FinalBinNumber, SLB_INT16U* FinalDataLocation, SLB_BOOL *pOverflow);
    extern void BLA_RetrieveTestPositionInfo(SLB_INT16U sense, BLA_INTERNAL_INFO *pPHAInfo, ACQ_ERR *pErr);
    
    
    void MODE_getTimingData(void *pBuf, BLA_INTERNAL_INFO *pPHAInfo, eRAWDATA_MODE RawDataMode,
            eACQ_MODE AcqMode, SLB_INT16U *pCountOverflowStatus, ACQ_ERR *pMsgErr)
    {
        SLB_INT16U group;
        SLB_INT16U sense;
        SLB_INT16U zone;
        SLB_INT16U sram_index_in_group;
        SLB_INT16U subzones_treated;
        SLB_INT16U final_data_index;
        SLB_BOOL   hasOverflowOccurred;
        SLB_INT16U* data_destination[3];
    
        const SLB_INT16U TS_Raw_Bins_Per_Subzones[8] = {50, 384, 11,             64, 25, 50, 100, 5};
    
        SLB_INT16U TS_Final_Bins_Per_Subzones[8] = {50, 12, 11,             2, 25, 50, 0, 5};    
    
        const SLB_INT16U TS_Subzones_Per_Group[4] = {1,3,3,1};
        const SLB_INT16U TS_Apparent_MEM_Addresses[3]  = {0x0C00, 0x3E00, 0x7000};;
        const SLB_INT16U TS_Sum_MEM_Addresses[3]       = {(0x0C00 + (0x0200 * 2)), (0x3E00 + (0x0200 * 2)), (0x7000 + (0x0200 * 2))};;
        const SLB_INT16U TS_MEM_Offset[4] = {0, 50,             ( 50 + (384 + 11 + 64) ), ( ( 50 + (384 + 11 + 64) ) + (25 + 50 + 100) )};
    
        *pMsgErr = ERR_NONE;
    
        if (RawDataMode == COMM)
        {
            MSG1* pGSHMsg = (MSG1*) pBuf;
            data_destination[0] = pGSHMsg->nnnnnnn;
            data_destination[1] = pGSHMsg->fffffff;
            data_destination[2] = pGSHMsg->dddddd;
    
            TS_Final_Bins_Per_Subzones[8-2] = 50;
        }
        else if (RawDataMode == DEV)
        {
            MSG2* pGSHMsg = (MSG2*) pBuf;
            data_destination[0] = pGSHMsg->nnnnnnn;
            data_destination[1] = pGSHMsg->fffffff;
            data_destination[2] = pGSHMsg->dddddd;
    
            TS_Final_Bins_Per_Subzones[8-2] = 100;
        }
        else 
        {
            MSG3* pGSHMsg = (MSG3*) pBuf;
            data_destination[0] = pGSHMsg->nnnnnnn;
            data_destination[1] = pGSHMsg->fffffff;
            data_destination[2] = pGSHMsg->dddddd;
    
            TS_Final_Bins_Per_Subzones[8-2] = 50;
        }
                                                                    
        for (sense = 0 ; sense < 3; sense++)
        {
            SLB_INT16U *destination = data_destination[sense];
    
            subzones_treated = 0;                                   
            final_data_index = 0;
                                                                    
            for (group = 0 ; group < 4; group++)
            {
                sram_index_in_group = 0;                            
    
                for (zone = 0; zone < TS_Subzones_Per_Group[group]; zone++)
                {
                                                                    
                    BLA_fillFinalData(AcqMode, TS_Apparent_MEM_Addresses[sense] + TS_MEM_Offset[group] + sram_index_in_group,
                        TS_Raw_Bins_Per_Subzones[subzones_treated], TS_Final_Bins_Per_Subzones[subzones_treated],
                        &destination[final_data_index], &hasOverflowOccurred);
    
                    if (hasOverflowOccurred == SLB_TRUE)
                    {
                        (*pCountOverflowStatus) |= ( 1 << ( 3 - (sense) - 1 ) );
                    }
                                                                    
                    if ( group == 1 )
                    {
                        BLA_FillTestPositionInfo(sense, zone, pPHAInfo);
                    }
                                                                    
                    sram_index_in_group += TS_Raw_Bins_Per_Subzones[subzones_treated];
                    final_data_index += TS_Final_Bins_Per_Subzones[subzones_treated];
                    subzones_treated++;
                }
            }
                                                                    
            BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[0] + 5 - 1, &destination[final_data_index++] );      
            BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[0] + 30 - 1, &destination[final_data_index++] );      
    
            BLA_fillFinalData(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[1] + 161 - 1,
                32, 1, &destination[final_data_index++],  &hasOverflowOccurred);                                                         
            if (hasOverflowOccurred == SLB_TRUE)
            {
                (*pCountOverflowStatus) |= ( 1 << ( 3 - (sense) - 1 ) );
            }
    
            BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[1] + 390 - 1, &destination[final_data_index++] );    
    
            BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[2] + 6 - 1, &destination[final_data_index++] );      
            BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[2] + 26 - 1, &destination[final_data_index++] );      
            if (RawDataMode == DEV)
            {
                BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[2] + 125 - 1, &destination[final_data_index++] );  
            }
            else 
            {
                BLA_fillFinalData(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[2] + 124 - 1,
                        2, 1, &destination[final_data_index++],  &hasOverflowOccurred);                                              
                if (hasOverflowOccurred == SLB_TRUE)
                {
                    (*pCountOverflowStatus) |= ( 1 << ( 3 - (sense) - 1 ) );
                }
            }
    
            BLA_ReadMEM(AcqMode, TS_Sum_MEM_Addresses[sense] + TS_MEM_Offset[3] + 3 - 1, &destination[final_data_index++] );    
    
                                                                    
            BLA_RetrieveTestPositionInfo(sense, pPHAInfo, pMsgErr);
    
    
        } 
    }
    

    Regards,

    Stephane

  • By the way here are the compile options:

    -v28 -ml -mt --float_support=fpu32 --include_path="C:/ti/ccsv5/tools/compiler/ti-cgt-c2000_6.4.4/include" --include_path="C:/ti/bios_5_42_01_09/packages/ti/bios/include" --include_path="C:/ti/bios_5_42_01_09/packages/ti/rtdx/include/c2000" -g --preproc_only --preproc_with_compile --define=TARGET_EZDSP_EVM --diag_warning=225 --display_error_number
  • Thank you for the test case.  I can reproduce the same error you show above.  I submitted SDSCM00051985 to the SDOWP system to have this investigated.  Feel free to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • George,

    I have run into the same bug as Stephane after upgrading to compiler 6.4.4. If it would be helpful for your team to have another example of this occurring, let me know. For now, I am building my project without optimization on the file in which the error is occurring.


    - Mitch