2. Migrating cl2000 CCS Projects to c29clang

One of the challenges you may face when transitioning an existing TI C28x application in order to build the application with the c29clang compiler is in mapping cl2000 compiler options into their corresponding c29clang compiler options. If your TI C28x application exists as a CCS project, then CCS can help with the mapping of cl2000 compiler options to c29clang options.

The process of migrating an cl2000 CCS project to use the c29clang compiler is relatively straightforward:

  1. Import the cl2000 CCS project into a CCS workspace.

  2. In the Explorer window, right-click on the cl2000 project name and select Properties.

../_images/CCS_tutorial_theia_1.png
  1. You will then see a Properties pop-up dialog box for the cl2000 project.

../_images/CCS_tutorial_theia_2.png

Before migrating the cl2000 project to use the c29clang compiler, you can check the cl2000 option settings. In this example, the Optimization options show that the -O3 and -mf3 options have been selected:

../_images/CCS_tutorial_theia_3.png
  1. Click on the General category along the left-hand side of the dialog box, then change the Compiler from the current cl2000 compiler to the c29clang compiler (may be denoted as “TI Clang <version string>”):

../_images/CCS_tutorial_theia_4.png
  1. Click on Save and Close at the bottom of the dialog box. CCS will create a new build configuration with the migrated compiler options.

Unless all cl2000 compiler options were migrated flawlessly to their c29clang compiler counterparts, you will see a pop-up dialog box explaining that some issues were encountered when creating the new build configuration:

../_images/CCS_tutorial_theia_5.png

You can then click Open Log and proceed to view the project.log file in the CCS source file window.

The project.log file provides details about each of the cl2000 to c29clang option mappings that were enacted during the migration step. The cl2000 compiler options that CCS was not able to migrate into a functionally equivalent c29clang compiler option will be listed with a !WARNING message in the project.log file. You will want to review the mappings listed in the project.log file to ensure that each cl2000 compiler option was mapped to a c29clang option as you expected.

For this tutorial we can see that the cl2000 -O3 and -mf3 options were mapped to the c29clang -Os option:

../_images/CCS_tutorial_theia_6.png

To further ensure that the cl2000 options were properly converted to c29clang options, you can check the build settings for the newly created TICLANG configuration of your project. Right-click on the project name and select Properties to bring up the Properties dialog box associated with the TICLANG configuration of your project. For this tutorial, we can see the Optimization options for the c29clang compiler show that -Os option has been selected, as expected:

../_images/CCS_tutorial_theia_7.png

During migration, CCS will also enable a few Clang-Tidy checks that can help you update your TI C28x application source code so that it can be built using the c29clang compiler. To view or modify the enabled Clang-Tidy checks, click on Clang-Tidy in the Properties dialog:

../_images/CCS_tutorial_theia_8.png

For more information about Clang-Tidy and a list of the available checks, see Migrating Source Code with Clang-Tidy.

Further details about mapping cl2000 compiler options to c29clang compiler options are provided in the remainder of this chapter.