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.
工具/软件:Code Composer Studio
您好!
我希望使用 fastRTS 加快项目中的一些浮点计算。 首先、我尝试通过使用 controlSUITE 提供的示例来学习如何使用它。
示例名称是"28335_fastRTS"、位于"C:\ti\controlSUITE\libs\math\FPUfastRTS\V100\examples_ccsv4\2833x_fastRTS"。
我遵循了文档"C28x 浮点单元 fastRTS 库"(SPRCA75):
(1)在 build---c2000 link--file search path 中-- rts2800_fpu32.lib 和 rts2800_fpu32_fast_imple.lib 都已存在。
(2)按优先顺序搜索库和重新读取库已勾选。 另一个没有被勾选。
(3)按照链接顺序、它是28235_IQmath_Ink。cmd (不知道为什么是28235?)、rts2800_Fpu_fast_implement 和 rts2800_fpu32.lib。
I 编译工程时、编译日志如下所示。
****为项目28335_fastRTS 构建配置调试****
"C:\\ti\\ccsv8\\utils\\bin\\gmake"-k all
编译文件:"c:/ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/source/CodeStartBranch.asm
调用:C2000编译器
"c:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/bin/cl2000 "--silicon_version=28 -g -define=_debug -define=larg_model --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/include /ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/source/CodeStartBranch.asm --include_path="/packages/ti/xdais --include_path="C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/include --use_path="C:--quiet --diag_dwarning=225 --optimize_with_debug --large_memory_model --include_support_preproc_use_output-code.come_use_code.come_use_use_use_code.compruategrand_dive-proc-ase-use_use_use_use_suppuse_code.c -code.c -code.c -code.c -code.c -code.come_
完工:"c:/ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/source/CodeStartBranch.asm
编译文件:"c:/ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/source/fastRTS_sample.c
调用:C2000编译器
"c:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/bin/cl2000 "--silicon_version=28 -g -define=_debug -define=larg_model --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/include /ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/source/fastRTS_sample.c --include_path="/packages/ti/xdais --include_path="C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/include --quiet --diag_warning=225 --optimize_with_debug --large_memory_model --include_support_ase_pred_use_output=use_ase-fategrus_us_use_output-"--ategrus_us_us_use_output-"--ategrus_us_us_proc-ase_us_us_us_use_output=us_us_use_use_output-output-cn
完工:"c:/ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/source/fastRTS_sample.c
构建目标:"28335_fastrts.out"
调用:C2000链接器
"c:/ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/bin/cl2000 /ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/lib /ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/2833x_fastRTS "--silicon_version=28 -g -define=_debug -define=large_model --quiet --diag_warning=225 --optimize_with_debug --large_memory_model --unified_memory --float_support=fpu32 -asm_listing-out_output_all_syms -status-from_ram_infote_status-"-r32m /ti/ccsv8/tools/compiler/ti-cgt-c2000_18.1.3.LTS/include -ine-from_infot_infot_infot_infot_code"-r32m -r_code.rts"-r_code.tex-r_code.tex-r32"/ti/controlSUITE/libs/math/FPUfastRTS/V100/lib -r_infot_infot_infot_infot_infot_code.tex-r_infot_infot_infot_infot_infot_code.tex-r_code.tex-rts.ip_infot_code"-r32"-r_code.ts.r_infot_infot_infot_infot_infot_infot_infot_code./ti/controlSUITE/libs/math/FPUfastRTS/V100/examples_ccsv4/cmd/28335_fastRTS_lnk.cmd
警告:指定了"_c_int00"以外的入口点符号:"code_start"
已完成构建目标:"28335_fastrts.out"
****构建完成****
映射文件显示如下。
.text 0 00009000 0000030d
00009000 00000134 fastrts_sample.obj (.text)
00009134 00000056 rts2800_fpu32.lib:boot28.asm.obj (.text)
0000918a 0000004a rts2800_fpu32_fast_f늹 훺.lib:atan_F32.obj (.text)
000091d4 00000034:Cos_F32.obj (.text)
00009208 00000034:Sin_F32.obj (.text)
0000923c 00000029 rts2800_fpu32.lib:exit.c.obj (.text)
00009265 00000024:cpy_tbl.c.obj (.text)
00009289 00000021 rts2800_fpu32_fast_finc补.lib:sqrt_F32.obj (.text)
000092aa 0000001d rts2800_fpu32.lib:memcpy.c.obj (.text)
000092c7 00000019:args_main.c.obj (.text)
000092e0 00000019 rts2800_fpu32_fast_补 遗.lib:div_F32.obj (.text)
000092f9 00000009 rts2800_fpu32.lib:_lock.c.obj (.text)
00009302 00000008 CodeStartBranch.obj (.text)
0000930a 00000002 rts2800_fpu32.lib:pre_init.c.obj (.text)
0000930c 00000001:startup.c.obj (.text)
根据上面提到的文档、这个.map 意味着它仍然使用正常的 RTS、而不是 fastRTS、因为 rts2800_fpu32.lib 出现在第一个。 为什么会发生这种情况、因为我没有更改代码中的任何内容、并按照文档中的说明更改设置。 实际上、我不必更改这些设置、因为它们已经与文档中所述的相同。
为什么它仍在使用正常 RTS?
我将 CCS8.2与 TI F28335实验套件搭配使用。
谢谢、
您好!
使用 CCS 8.2尝试使用 C2000ware 示例:
C:\ti\c2000Ware_1_00_05_00\libraries\math\FPUfastRTS\c28\examples
此致、
Gautam
您好 Richard、
感谢你能抽出时间。 我还可以看到一些函数使用 fastRTS、例如 atan、cos、sin。。 我知道 fastRTS 并不是涵盖所有浮点计算。
我的困惑是根据 SPRCA75第3.4节 P10得出的。 "如果 fastRTS 库首先链接、您将看到如下列表所示的内容。 请注意 atan、cos、sin、sqrt 和除法函数都来自 fastRTS 库。"
我的理解是 rts2800_fpu32_fast_implemtation.lib 应该首先出现在映射文件中、如下图所示。
但是、在我在上述帖子中生成的.map 中、rts2800_fpu32.lib 首先出现、正如您在第二行中看到的那样。 请注意、在下图中、 rts2800_fpu32.lib 位于第三行。
我的问题是:
(1)在我的项目中使用.map 文件时、它使用 fastRTS 还是正常 RTS?
(2)"rts2800_fpu32.lib:boot.obj"在干什么? 这是否意味着我先链接正常 RTS?
(3)是否有其他方法可以检查我是使用 fastRTS 还是正常 RTS?
非常感谢。
您好、Ivan、
(1)在我的项目中使用.map 文件时、它使用 fastRTS 还是正常 RTS?
-它同时使用这两种方法。 fastRTS 支持的函数从 fastRTS 库链接、所有其他函数从标准 RTS 库链接。 段的顺序不重要。 它们按链接地址排序、而不是按链接器首先处理的文件排序。
(2A)"rts2800_fpu32.lib:boot.obj"在干什么?
-此模块包含启用浮点时设置 C 环境的代码。 这来自汇编语言工具用户指南:
8.11.1运行时初始化
所有 C/C++程序都必须与代码链接才能初始化和执行称为引导程序的程序
例程、也称为 boot.obj 目标模块。 符号_c_int00定义为程序条目
point 和是 boot.obj 中 C 引导例程的开始;引用_c_int00可确保 boot.obj 为
从运行时支持库中自动链接。 当程序开始运行时、它会执行
boot.obj 优先。 boot.obj 符号包含用于初始化运行时环境和的代码和数据
执行以下任务:
•设置系统堆栈和配置寄存器
•处理运行时.cinit 初始化表并自动初始化全局变量(链接器为时)
使用--rom_model 选项调用)
•禁用中断并调用_main
运行时支持对象库包含 boot.obj。 您可以:
•使用归档器从库中提取 boot.obj、然后直接链接中的模块。
•将适当的运行时支持库作为输入文件包含在内(链接器会自动提取
boot.obj、当您使用--ram_model 或--rom_model 选项时)。
(2B)这是否意味着我先链接正常 RTS?
-不
(3)是否有其他方法可以检查我是使用 fastRTS 还是正常 RTS?
我不这么认为。 如果您在.map 文件中看到从"rts2800_fpu32_fast_f补 遗.lib"链接的段、则表明 fastRTS 正在使用中。 如果没有"rts2800_fpu32_fast_f늹 ular.lib"的引用、则不使用它。 这是您上一篇帖子中两个屏幕截图的重要性。
您所做的是正确的。 您的代码正在使用 fastRTS 函数构建。 但愿这对您有所帮助。 如果仍有任何问题、请随时回帖。
此致、
Richard
感谢您的友好解释。 现在很清楚。 进一步说明如何检查是否正在使用 fastRTS 或正常 RTS。
我还可以通过上面提到的 TI fastRTS 示例找到它。 如果我以正确的方式放置链接器顺序、如果我按 F5、它将单步转到第二行。 但是、如果我故意通过将正常 RTS 放在第一位置来放置链接器顺序、然后按 F5、它将单步转到 s_atanf.c 中的以下子函数 在它完成子函数后、它会返回到我的代码中的下一行。
这是否可以作为使用正常 RTS 或 fasterRTS 的区别? 调用 s_atanf.c 是否符合正常 RTS 的要求?