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.

Template class not optimizing as well as non-template equivalent

I have designed a semi-generic polyphase upsampling filter with template parameters for taps per phase, phase count and max input length. If I take the template arguments off and declare the values as constants in the class the same function compiles much more optimally. What is happening and what can I do to improve the optimization of the template class method?

Thanks

Chris

  • That's not what I would expect.  What compiler are you using?  Please show me your exact build options.

    Thanks and regards,

    -George

  • It is the C6747 and I am developing the algorithm on the cycle accurate simulator. I used both version 7.3.1 and 7.4.1 and they have similar results. Where is the best place to gather a compact list of the build options? I use the GUI to change settings and I think the .cproject file content would be too large to paste here. I am using the "Optimization level (-O)" of 3, no debug model, no optimize for size.

    When I move everything that is in the template class (members and methods) to the non-template class the performance is about 5 times better. I also see in the assembly something like it can't pipeline the loop or something like that with many more NOPs than in the code that is not using templates.

    template<int UPSAMPLE_RATE, int TAPS_PER_PHASE, int MAX_INPUT_SAMPLE_COUNT>
    class polyphase_upsample_fir_c
    {
    public:
      static const int STATE_SAMPLE_COUNT = TAPS_PER_PHASE-1;
      
    private:
      const float (&taps)[UPSAMPLE_RATE][TAPS_PER_PHASE]; // These must be stored flipped left-to-right for simplicity
      cmplx_float_c state_and_input[STATE_SAMPLE_COUNT + MAX_INPUT_SAMPLE_COUNT];
      
    public:
      polyphase_upsample_fir_c(const float (&taps)[UPSAMPLE_RATE][TAPS_PER_PHASE]) :
      taps(taps)
      {
        // Initialize the state to zero
        for(int index=0; index<STATE_SAMPLE_COUNT; index++)
        {
          state_and_input[index].set(0, 0);
        }
      }
      
      void process(int input_sample_count, cmplx_float_c* output);
      
      // Returns a pointer to the first sample past the state memory, this is where the filter input should be placed.
      inline cmplx_float_c* get_input_pointer() { return &state_and_input[STATE_SAMPLE_COUNT]; }
    
    };
    
    template<int UPSAMPLE_RATE, int TAPS_PER_PHASE, int MAX_INPUT_SAMPLE_COUNT>
    void polyphase_upsample_fir_c<UPSAMPLE_RATE, TAPS_PER_PHASE, MAX_INPUT_SAMPLE_COUNT>::process(int input_sample_count, cmplx_float_c* output)
    {
      ...
    }
    
    class full_rate_upsample_fir_c
    {
    public:
      static const int UPSAMPLE_RATE = 24;
      static const int TAPS_PER_PHASE = 16;
      static const int MAX_INPUT_SAMPLE_COUNT = 48;
    
    private:
      polyphase_upsample_fir_c<UPSAMPLE_RATE, TAPS_PER_PHASE, MAX_INPUT_SAMPLE_COUNT> filter;
      static const float taps[UPSAMPLE_RATE][TAPS_PER_PHASE];
    
    public:
      full_rate_upsample_fir_c():
        filter(taps)
      {}
    
      inline void process(int input_sample_count, cmplx_float_c* output)
      {
        filter.process(input_sample_count, output);
      }
    
      inline cmplx_float_c* get_input_pointer() { return filter.get_input_pointer(); }
    };
  • ;******************************************************************************
    ;* GLOBAL FILE PARAMETERS *
    ;* *
    ;* Architecture : TMS320C674x *
    ;* Optimization : Enabled at level 3 *
    ;* Optimizing for : Speed *
    ;* Based on options: -o3, no -ms *
    ;* Endian : Little *
    ;* Interrupt Thrshld : Disabled *
    ;* Data Access Model : Far Aggregate Data *
    ;* Pipelining : Enabled *
    ;* Speculate Loads : Enabled with threshold = 0 *
    ;* Memory Aliases : Presume not aliases (optimistic) *
    ;* Debug Info : DWARF Debug for Program Analysis w/Optimization *
    ;* *
    ;******************************************************************************

    Here are the optimization settings for the source file, taken from the assembly output.

    Here are the cycle counts for running the filter with and without templating. The second set of numbers represents the speed when I turn on the no_bad_aliasing option.

    no template 89k cycles
    template 393k cycles

    no template 23k cycles
    template 88k cycles

    The function that I have copied to the other class is exactly identical on the template and non-template class.

  • c0l0jar0 said:
    Where is the best place to gather a compact list of the build options?

    There is build console window with the exact text of the commands that get executed.  It would suffice to see the compilation command for the one file in question, but the whole build console output is probably short enough to post here.

  • I have highlighted the important source files (the two I am comparing) in green. source.cpp is where I instantiate the template class and define a simple function that only calls the "process()" method of the template class so that i can control the optimization of that template class method using settings for that file.

    **** Build of configuration Debug for project firupsample_24 ****

    "C:\\ti3\\ccsv5\\utils\\bin\\gmake" -k all 

    'Building file: ../bios_cfg.tcf'

    'Invoking: TConf'

    "C:/ti3/xdctools_3_24_05_48/tconf" -b -Dconfig.importPath="C:/ti/bios_5_41_11_38/packages;C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers;" "../bios_cfg.tcf"

    'Finished building: ../bios_cfg.tcf'

    ' '

    'Building file: bios_cfg.s??'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="bios_cfg.pp"  "bios_cfg.s??"

    'Finished building: bios_cfg.s??'

    ' '

    'Building file: bios_cfg_c.c'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="bios_cfg_c.pp"  "bios_cfg_c.c"

    'Finished building: bios_cfg_c.c'

    ' '

    'Building file: C:/DSPSource/branches/us2233/algorithms/filters/firupsample_sp.cpp'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --static_template_instantiation --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --no_bad_aliases --abi=coffabi -k --preproc_with_compile --preproc_dependency="firupsample_sp.pp"  "C:/DSPSource/branches/us2233/algorithms/filters/firupsample_sp.cpp"

    'Finished building: C:/DSPSource/branches/us2233/algorithms/filters/firupsample_sp.cpp'

    ' '

    'Building file: ../main.cpp'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="main.pp"  "../main.cpp"

    'Finished building: ../main.cpp'

    ' '

    'Building file: C:/DSPSource/branches/us2233/algorithms/filters/polyphase_upsample_fir_24.cpp'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --no_bad_aliases --abi=coffabi -k --preproc_with_compile --preproc_dependency="polyphase_upsample_fir_24.pp"  "C:/DSPSource/branches/us2233/algorithms/filters/polyphase_upsample_fir_24.cpp"

    'Finished building: C:/DSPSource/branches/us2233/algorithms/filters/polyphase_upsample_fir_24.cpp'

    ' '

    'Building file: ../source_file.cpp'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --no_bad_aliases --abi=coffabi -k --preproc_with_compile --preproc_dependency="source_file.pp"  "../source_file.cpp"

    'Finished building: ../source_file.cpp'

    ' '

    'Building file: C:/DSPSource/branches/us2233/algorithms/filters/upsample_filter_taps.cpp'

    'Invoking: C6000 Compiler'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --static_template_instantiation --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="upsample_filter_taps.pp"  "C:/DSPSource/branches/us2233/algorithms/filters/upsample_filter_taps.cpp"

    'Finished building: C:/DSPSource/branches/us2233/algorithms/filters/upsample_filter_taps.cpp'

    ' '

    'Building target: firupsample_24.out'

    'Invoking: C6000 Linker'

    "C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --display_error_number --diag_warning=225 --abi=coffabi -k -z -m"firupsample_24.map" --warn_sections -i"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/lib" -i"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" -i"C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000" -i"C:/ti/bios_5_41_11_38/packages/ti/bios/lib" -i"C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24" --reread_libs --rom_model -o "firupsample_24.out" -l"./bios_cfg.cmd"  "./upsample_filter_taps.obj" "./source_file.obj" "./polyphase_upsample_fir_24.obj" "./main.obj" "./firupsample_sp.obj" "./bios_cfg_c.obj" "./bios_cfg.obj" 

    <Linking>

    warning #16002-D: build attribute vendor section TI missing in

       "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<simbuf.o62>":

       compatibility cannot be determined

    warning #16002-D: build attribute vendor section TI missing in

       "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<sim_mon.o62>":

       compatibility cannot be determined

    warning #16002-D: build attribute vendor section TI missing in

       "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<simbuf.o62>":

       compatibility cannot be determined

    warning #16002-D: build attribute vendor section TI missing in

       "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<sim_mon.o62>":

       compatibility cannot be determined

    warning #10247-D: creating output section "fast_l1_program" without a SECTIONS

       specification

    warning #10247-D: creating output section "tx_out_sect" without a SECTIONS

       specification

    warning #10247-D: creating output section "tx_upsampling_filter_taps_sect"

       without a SECTIONS specification

    'Finished building target: firupsample_24.out'

    ' '

    **** Build Finished ****


    **** Build of configuration Debug for project firupsample_24 ****
    "C:\\ti3\\ccsv5\\utils\\bin\\gmake" -k all 'Building file: ../bios_cfg.tcf''Invoking: TConf'"C:/ti3/xdctools_3_24_05_48/tconf" -b -Dconfig.importPath="C:/ti/bios_5_41_11_38/packages;C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers;" "../bios_cfg.tcf"'Finished building: ../bios_cfg.tcf'' ''Building file: bios_cfg.s??''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="bios_cfg.pp"  "bios_cfg.s??"'Finished building: bios_cfg.s??'' ''Building file: bios_cfg_c.c''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="bios_cfg_c.pp"  "bios_cfg_c.c"'Finished building: bios_cfg_c.c'' ''Building file: C:/DSPSource/branches/us2233/algorithms/filters/firupsample_sp.cpp''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --static_template_instantiation --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --no_bad_aliases --abi=coffabi -k --preproc_with_compile --preproc_dependency="firupsample_sp.pp"  "C:/DSPSource/branches/us2233/algorithms/filters/firupsample_sp.cpp"'Finished building: C:/DSPSource/branches/us2233/algorithms/filters/firupsample_sp.cpp'' ''Building file: ../main.cpp''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="main.pp"  "../main.cpp"'Finished building: ../main.cpp'' ''Building file: C:/DSPSource/branches/us2233/algorithms/filters/polyphase_upsample_fir_24.cpp''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --no_bad_aliases --abi=coffabi -k --preproc_with_compile --preproc_dependency="polyphase_upsample_fir_24.pp"  "C:/DSPSource/branches/us2233/algorithms/filters/polyphase_upsample_fir_24.cpp"'Finished building: C:/DSPSource/branches/us2233/algorithms/filters/polyphase_upsample_fir_24.cpp'' ''Building file: ../source_file.cpp''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --no_bad_aliases --abi=coffabi -k --preproc_with_compile --preproc_dependency="source_file.pp"  "../source_file.cpp"'Finished building: ../source_file.cpp'' ''Building file: C:/DSPSource/branches/us2233/algorithms/filters/upsample_filter_taps.cpp''Invoking: C6000 Compiler'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -O3 --static_template_instantiation --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --include_path="C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" --include_path="C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24/Debug" --include_path="C:/ti/bios_5_41_11_38/packages/ti/bios/include" --include_path="C:/ti/bios_5_41_11_38/packages/ti/rtdx/include/c6000" --include_path="C:/ti3/xdais_7_21_01_07/packages/ti/xdais" --include_path="C:/DSPSource/branches/us2233/vendor_packages" --include_path="C:/DSPSource/branches/us2233/drivers/c6747_platform" --include_path="C:/DSPSource/branches/us2233/vendor_packages/ti/C6x_intrinsic_support" --include_path="C:/DSPSource/branches/us2233/development_projects/radio_projects/ccs5_base_loco_app" --include_path="C:/DSPSource/branches/us2233/drivers/hw_specific/wally2" --include_path="C:/DSPSource/branches/us2233/algorithms/demod" --include_path="C:/DSPSource/branches/us2233/drivers/dsp_bios_support_drivers" --include_path="C:/DSPSource/branches/us2233/drivers/device_drivers" --include_path="C:/DSPSource/branches/us2233/algorithms/utilities" --include_path="C:/DSPSource/branches/us2233/algorithms/testing" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/c4fm" --include_path="C:/DSPSource/branches/us2233/algorithms/demod/pi4dqpsk" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/ReedSolomon" --include_path="C:/DSPSource/branches/us2233/algorithms/fec" --include_path="C:/DSPSource/branches/us2233/algorithms/fec/convCode" --include_path="C:/DSPSource/branches/us2233/config_and_test/" --include_path="C:/DSPSource/branches/us2233/algorithms/filters/" --display_error_number --diag_warning=225 --abi=coffabi -k --preproc_with_compile --preproc_dependency="upsample_filter_taps.pp"  "C:/DSPSource/branches/us2233/algorithms/filters/upsample_filter_taps.cpp"'Finished building: C:/DSPSource/branches/us2233/algorithms/filters/upsample_filter_taps.cpp'' ''Building target: firupsample_24.out''Invoking: C6000 Linker'"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6740 -g --define="_DEBUG" --define=BASE_LOCO_RADIO --define="_TMS320C6X" --define="C6x_SIM" --display_error_number --diag_warning=225 --abi=coffabi -k -z -m"firupsample_24.map" --warn_sections -i"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/lib" -i"C:/ti3/ccsv5/tools/compiler/c6000_7.4.1/include" -i"C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000" -i"C:/ti/bios_5_41_11_38/packages/ti/bios/lib" -i"C:/DSPSource/branches/us2233/development_projects/test_programs/dss/firupsample_24" --reread_libs --rom_model -o "firupsample_24.out" -l"./bios_cfg.cmd"  "./upsample_filter_taps.obj" "./source_file.obj" "./polyphase_upsample_fir_24.obj" "./main.obj" "./firupsample_sp.obj" "./bios_cfg_c.obj" "./bios_cfg.obj" <Linking>warning #16002-D: build attribute vendor section TI missing in   "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<simbuf.o62>":   compatibility cannot be determinedwarning #16002-D: build attribute vendor section TI missing in   "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<sim_mon.o62>":   compatibility cannot be determinedwarning #16002-D: build attribute vendor section TI missing in   "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<simbuf.o62>":   compatibility cannot be determinedwarning #16002-D: build attribute vendor section TI missing in   "C:/ti/bios_5_41_11_38/packages/ti/rtdx/lib/c6000/rtdxsim.lib<sim_mon.o62>":   compatibility cannot be determinedwarning #10247-D: creating output section "fast_l1_program" without a SECTIONS   specificationwarning #10247-D: creating output section "tx_out_sect" without a SECTIONS   specificationwarning #10247-D: creating output section "tx_upsampling_filter_taps_sect"   without a SECTIONS specification'Finished building target: firupsample_24.out'' '
    **** Build Finished ****

  • My guess is one or two functions is not getting inlined as needed.  That, in turn, causes one or two important loops to fail to software pipeline.  When that happens, a loop can run much slower.  Think 20X slower.  

    One way you might be able to look at this yourself is to use the build option --gen_opt_info=2.  This creates a text file, with the extension .nfo, which contains information from the optimization phase of the compiler.  There might be some useful hints about why a critical function failed to inline.  Read more about --gen_opt_info in the C6000 compiler manual.

    If that doesn't work out, then we need to reproduce this ourselves.  In addition to the build options, I need the C++ template source file.  You probably need to preprocess it as described here.  

    Thanks and regards,

    -George

  • OK I found that I was able to get the template class to perform almost identically to the simpler class. What I was doing is, the template class implemented the core functionality but the taps were not a member of the class. A reference to a 2-D array was passed to the constructor of the template class. Either I inherited or instantiated the template class and then passed the taps reference in.

    When I removed the taps reference and just gave the underlying template class the taps array the performance matched the other (this is not a usable solution). Why would this make such a large difference?

     const float (&taps)[UPSAMPLE_RATE][TAPS_PER_PHASE]; // These must be stored flipped left-to-right for simplicity
      // float taps[UPSAMPLE_RATE][TAPS_PER_PHASE]; // These must be stored flipped left-to-right for simplicity

    Is there a way that I can get the same performance using this reference? It is necessary for the template class and makes for much cleaner and more maintainable code than copying the filtering method into every filter class I need to write (currently four of them).

    If this is not enough information to give me suggestions I will look into the other options you have provided. I have already generated the .nfo files and I am reading through them.

    Thanks

    Chris