#*****************************************************************************
# File:			compiler.settings.debug.txt
#
# Content:		Additional compiler settings in DEBUG mode,
#				which are used in all projects.
#
# Author:		Sven Mulka
#
# Company:		Ingenieurbro Mulka, Software & Data Communication
#				Copyright (c) 2018, by IB-Mulka
#				http://www.ib-mulka.de
#
# Changes:
# 20.06.18 SM	Initial Version
#*****************************************************************************

# Set the optimizing level
# For debugging the level should not to large, but we need --opt_level=2 as
# minimum, which activates the pipelining.
--opt_level=2
--debug_software_pipeline
--fp_mode=relaxed

# Generates .asm files with details about pipelined loops
# should be disabled in normal developing process
--optimizer_interlist

# Informs the optimizer that our code may use aliased variables,
# with that it will create saver code, but not with max. optimization
# Use the keyword restrict to qualify pointers as non aliased in the
# current scope, which gets the origin performance. 
--aliased_variables

# The optimizer can disable the interrupts in pipelined loops
# for a number of cycles. 
--interrupt_threshold=1000

# Optimize the loading of data in pipelined loops
# It adds some space before and behind of memory sections, so a reading
# before or behind is uncritical and the pipelined loops are more optimized.
--speculate_loads=auto

# If used, the optimization will be restricted to use no speculated load and
# no $fill section are generated by linker at the beginning of MEMORY blocks.
# The performance will be not the best.
#--speculate_loads=0

# If used, the optimization will be restricted to use XXX bytes for
# the speculated load and no $fill section are generated by linker 
# at the beginning of MEMORY blocks.
# We have to make sure that the memory access is safe before and after 
# the requested memory address.
#--speculate_loads=1024

# The debugger may crash the running application during 
# reading of memory. The reason is a Silicon bug (SDSCM00051143)
# In RELEASE mode the SPLOOP optimization works so long we have no
# running debugger.
#--disable:sploop

#*****************************************************************************
# Allows the compiler to split out .text section into smaller pieces
# If option is disabled then all function of one file are linked in
# the some section, which may be more efficient for cache operations. 
#--gen_func_subsections=on

# defines the memory model
--mem_model:data=far
--mem_model:const=far

# Enables floating point support also for printf
--printf_support=full

# Enables the vector data types of C6x architecture,
# use <c6x_vec.h> include file. For details look into the readme.txt file 
# inside of C6000 CGT package or in section 7.15 of
# http://www.ti.com/lit/ug/sprui04a/sprui04a.pdf
--vectypes

# Accepts OpenMP and also multi-threading support on rtlc66.lib
--openmp
--multithread

# Accepts GCC language extensions
--relaxed_ansi

#*****************************************************************************
# Defines for the cTools library
--define=C66xx
--define=C6657
--define=_ETB_EDMA
--define=_STM
--define=_STM_Logging
--define=_MIPI_STM
--define=UCLIB_ETB_EDMA

# Enable our own optimized code for C66xx
--define=__USE_TMS320C6600__

# Selects the right CSL for PSDK 2.0.0 or higher
--define=DEVICE_C6657
--define=SOC_C6657

# Select the right device for OpenMP library
--define=TI_C6657

#*****************************************************************************
# Creates a *.pp file 
# Activate this option only if the optimizer or compiler terminates abnormally.
#-ppc

#*****************************************************************************
