8 Observing the Output on the MPLAB Data Visualizer

  1. After building and programming the application, open MPLAB Data Visualizer by clicking the highlighted icon.
    Figure 8-1. Launching MPLAB Data Visualizer
  2. To configure the Serial Port of the PIC32CZ CA90 Curiosity Ultra Evaluation Board, click on the Gear icon as shown below:
    Figure 8-2. Serial Port Setup
  3. On the COM Settings propery sheet, for Baud Rate, enter 115200.
    Figure 8-3. Selecting Baud Rate
  4. Open the Serial Port of the PIC32CZ CA90 Curiosity Ultra Evaluation Board by clicking the Play icon.
    Figure 8-4. Opening the Serial Port
  5. Select Send to Terminal to visualize the TCM performance test results, and then click Close.
    Figure 8-5. Select the Terminal Option
  6. Press the Reset button on the Evaluation Board to reset the device.
    Figure 8-6. Resetting the PIC32CZ CA90 Curiosity Ultra Evaluation Board
    Figure 8-7. Resetting the SAM E70 Xplained Ultra Evaluation Kit
  7. Observe the console message TCM Performance Demo displayed on the MPLAB Data Visualizer.
    Figure 8-8. TCM Performance Comparison
    Note:
    1. The optimization level is set to None / O0 for both projects.
    2. Execution metrics collected for the PIC32CZ CA and SAM E70/S70/V70/V71 family of devices are provided in the following tables:
  8. The following tables provide the benefits of ITCM and DTCM compared to traditional Flash/SRAM combinations. It is noted that the advantage is minimal when cache is enabled, as the example program is very small and fits entirely within the cache. However, real-world applications are significantly more complex and cannot be fully contained within the cache. For such applications, TCM proves to be more advantageous in managing critical and deterministic code segments.
    Table 8-1. PIC32CZ CA: TCM Configuration - 128 KB, Optimization – None / O0
    ConfigurationCodeBufferCycles
    Instruction Cache = OFF;

    Data Cache = OFF;

    FlashSRAM1085171
    FlashDTCM988133
    SRAMSRAM955135
    SRAMDTCM876161
    ITCMSRAM916673
    ITCMDTCM834131
    Instruction Cache = ON;

    Data Cache = OFF;

    FlashSRAM1035921
    FlashDTCM938207
    SRAMSRAM944315
    SRAMDTCM853327
    ITCMSRAM898183
    ITCMDTCM834117
    Instruction Cache = ON;

    Data Cache = ON;

    FlashSRAM166569
    FlashDTCM163984
    SRAMSRAM163995
    SRAMDTCM163982
    ITCMSRAM163981
    ITCMDTCM163981
    Table 8-2. SAM E70/S70/V70/V71: TCM Configuration - 32 KB, Optimization – None / O0
    ConfigurationCodeBufferCycles
    Instruction Cache = OFF;

    Data Cache = OFF;

    FlashSRAM1317577
    FlashDTCM1258257
    SRAMSRAM1186391
    SRAMDTCM1064289
    ITCMSRAM1039041
    ITCMDTCM964571
    Instruction Cache = ON;

    Data Cache = OFF;

    FlashSRAM1266171
    FlashDTCM1161249
    SRAMSRAM1169437
    SRAMDTCM1051603
    ITCMSRAM1052657
    ITCMDTCM963431
    Instruction Cache = ON;

    Data Cache = ON;

    FlashSRAM167639
    FlashDTCM163973
    SRAMSRAM164019
    SRAMDTCM164034
    ITCMSRAM163971
    ITCMDTCM163973
  9. To enhance these figures, adjust the optimization level to O2 to observe the improvements:
    1. In the MPLAB X IDE Project Properties window, under Categories, click and expand Conf: [pic32cz_ca90_cult] > XC32 (Global Options), and then select xc32-gcc.
    2. In the right Options for xc32-gcc properties sheet:
      1. For Option categories, select Optimization.
      1. For Optimization level, select 2.
    Figure 8-9. Project Properties
  10. Click Apply, and then click OK.
  11. To rebuild and program the PIC32CZ CA90 Curiosity Ultra Evaluation Board, refer to the Building and Programming the Application.
    Note:
    Table 8-3. PIC32CZ CA: TCM Configuration - 128 KB, Optimization – O2
    ConfigurationCodeBufferCycles
    Instruction Cache = OFF;

    Data Cache = OFF;

    FlashSRAM383503
    FlashDTCM385553
    SRAMSRAM179778
    SRAMDTCM134154
    ITCMSRAM181595
    ITCMDTCM133951
    Instruction Cache = ON;

    Data Cache = OFF;

    FlashSRAM179485
    FlashDTCM136405
    SRAMSRAM179496
    SRAMDTCM133842
    ITCMSRAM181515
    ITCMDTCM133851
    Instruction Cache = ON;

    Data Cache = ON;

    FlashSRAM45442
    FlashDTCM45203
    SRAMSRAM39094
    SRAMDTCM42650
    ITCMSRAM41132
    ITCMDTCM42640
    Table 8-4. SAM E70/S70/V70/V71: TCM Configuration - 32 KB, Optimization – O2
    ConfigurationCodeBufferCycles
    Instruction Cache = OFF;

    Data Cache = OFF;

    FlashSRAM394969
    FlashDTCM397011
    SRAMSRAM215731
    SRAMDTCM159931
    ITCMSRAM215575
    ITCMDTCM159709
    Instruction Cache = ON;

    Data Cache = OFF;

    FlashSRAM214951
    FlashDTCM163591
    SRAMSRAM216901
    SRAMDTCM161029
    ITCMSRAM216859
    ITCMDTCM161013
    Instruction Cache = ON;

    Data Cache = ON;

    FlashSRAM47036
    FlashDTCM45180
    SRAMSRAM41120
    SRAMDTCM42636
    ITCMSRAM41101
    ITCMDTCM42633

    The following graphs represent the TCM performance on the PIC32CZ CA and SAM E70/S70/V70/V71 Family of devices.

    Figure 8-10. PIC32CZ CA: Disabled Instruction Cache and Data Cache
    Figure 8-11. PIC32CZ CA: Enabled Instruction Cache
    Figure 8-12. PIC32CZ CA: Enabled Instruction Cache and Data Cache
    Figure 8-13. SAM E70/S70/V70/V71: Disabled Instruction Cache and Data Cache
    Figure 8-14. SAM E70/S70/V70/V71: Enabled Instruction Cache
    Figure 8-15. SAM E70/S70/V70/V71: Enabled Instruction Cache and Data Cache