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.

TMS320C6678: 一个关于omp_config.cfg文件的报错问题

Part Number: TMS320C6678
Other Parts Discussed in Thread: FFTLIB

如下图所示,编译fft_omp_sp_1d_c2c_k1_66_LE_ELF例程时总是出现报错,怀疑是不是例程自带的omp_config.cfg文件本身编写就有问题

使用的环境是CCS5.5,例程是FFTLIB库:fftlib_c66x_2_0_0_2,里面的fft_omp_sp_1d_c2c_k1_66_LE_ELF

错误:Cannot read property "base" from undefined (D:/ti/workspace_v5/fft_omp_sp_1d_c2c_k1_66_LE_ELF/omp_config.cfg#97)

OpenMP.msmcBase = msmc.base;
OpenMP.msmcSize = msmc.len;
//编译显示在这一行出现错误
OpenMP.msmcNoCacheVirtualBase  = msmcNcVirt.base;
OpenMP.msmcNoCacheVirtualSize  = msmcNcVirt.len;

OpenMP.msmcNoCachePhysicalBase  = msmcNcPhy.base;

OpenMP.ddrBase          = ddr3.base;
OpenMP.ddrSize          = ddr3.len;

以下是我的电脑中的工程:0410.fft_omp_sp_1d_c2c_k1_66_LE_ELF.zip

  • 以下是config文件的全部代码,报错显示在97行出现错误

    environment['xdc.cfg.check.fatal'] = 'false';
    
    /* Import configuration for using FC EDMA */
    /* utils.importFile("fc_config.cfg"); */
    var RMAN = xdc.useModule('ti.sdo.fc.rman.RMAN');
    RMAN.useDSKT2 = false;
    RMAN.persistentAllocFxn = "EdmaMgr_heap_alloc";
    RMAN.persistentFreeFxn = "EdmaMgr_heap_free";
    var EdmaMgr = xdc.useModule('ti.sdo.fc.edmamgr.EdmaMgr');
    xdc.useModule('ti.sdo.fc.global.Settings').profile = "release";
    
    /* Import configuration for enabling FC trace */
    //utils.importFile("fc_trace_config.cfg");
    
    /* Include OMP runtime in the build */
    var omp = xdc.useModule("ti.runtime.openmp.Settings");
    
    /* Set to true if the application utilizes RTSC/BIOS compoments */
    omp.usingRtsc = true;
    var BIOS = xdc.useModule("ti.sysbios.BIOS");
    BIOS.clockEnabled = false;
    
    /* Set up section mappings */
    var program = xdc.useModule('xdc.cfg.Program');
    
    /* Exclude sections which will be placed by linker command file */
    Program.sectionsExclude = "^\.fardata$|^\.far$";
    
    program.sectMap[".args"] = new Program.SectionSpec();
    program.sectMap[".bss"] = new Program.SectionSpec();
    program.sectMap[".cinit"] = new Program.SectionSpec();
    program.sectMap[".cio"] = new Program.SectionSpec();
    program.sectMap[".const"] = new Program.SectionSpec();
    program.sectMap[".neardata"] = new Program.SectionSpec();
    program.sectMap[".rodata"] = new Program.SectionSpec();
    program.sectMap[".stack"] = new Program.SectionSpec();
    program.sectMap[".switch"] = new Program.SectionSpec();
    program.sectMap[".sysmem"] = new Program.SectionSpec();
    program.sectMap[".text"] = new Program.SectionSpec();
    
    /* Required memory heaps */
    program.sectMap[".ll2_mem"] = new Program.SectionSpec();
    program.sectMap[".ddr_heap"] = new Program.SectionSpec();
    program.sectMap[".ddr_mem"] = new Program.SectionSpec();
    program.sectMap[".msmc_mem"] = new Program.SectionSpec();
    
    /* Must place these sections in core local memory */
    program.sectMap[".args"].loadSegment        = "L2SRAM";
    program.sectMap[".cio"].loadSegment         = "L2SRAM";
    program.sectMap[".stack"].loadSegment       = "L2SRAM";
    program.sectMap[".ll2_mem"].loadSegment    = "L2SRAM";
    
    /* Must place these sections in MSMC memory */
    program.sectMap[".msmc_mem"].loadSegment    = "MSMCSRAM";
    program.sectMap[".bss"].loadSegment         = "MSMCSRAM";
    program.sectMap[".cinit"].loadSegment       = "MSMCSRAM";
    program.sectMap[".const"].loadSegment       = "MSMCSRAM";
    program.sectMap[".neardata"].loadSegment    = "MSMCSRAM";
    program.sectMap[".rodata"].loadSegment      = "MSMCSRAM";
    program.sectMap[".sysmem"].loadSegment      = "MSMCSRAM";
    program.sectMap[".switch"].loadSegment      = "MSMCSRAM";
    program.sectMap[".text"].loadSegment        = "MSMCSRAM";
    
    /* Must place these sections in shared memory DDR3 */
    program.sectMap[".ddr_heap"].loadSegment    = "DDR3";
    program.sectMap[".ddr_mem"].loadSegment    = "DDR3";
    
    /* Size the default stack */
    /* program.stack = 0x28000; */
    program.stack = 0x2000;
    
    /* No need to pass arguments to main */
    program.argSize = 512;
    
    var OpenMP = xdc.useModule('ti.runtime.ompbios.OpenMP');
    
    // Configure the index of the master core and the number of cores available
    // to the runtime. The cores are contiguous.
    OpenMP.masterCoreIdx = 0;
    
    // Setup number of cores based on the device
    var deviceName = String(Program.cpu.deviceName);
    if      (deviceName.search("6670") != -1) { OpenMP.numCores      = 4; }
    else if (deviceName.search("6657") != -1) { OpenMP.numCores      = 2; }
    else                                      { OpenMP.numCores      = 8; }
    
    // Pull in memory ranges described in Platform.xdc to configure the runtime
    var ddr3       = Program.cpu.memoryMap["DDR3"];
    var msmc       = Program.cpu.memoryMap["MSMCSRAM"];
    var msmcNcVirt = Program.cpu.memoryMap["OMP_MSMC_NC_VIRT"];
    var msmcNcPhy  = Program.cpu.memoryMap["OMP_MSMC_NC_PHY"];
    
    // Initialize the runtime with memory range information
    //使用内存范围信息初始化运行时
    OpenMP.msmcBase = msmc.base;
    OpenMP.msmcSize = msmc.len;
    //在这里出现错误
    OpenMP.msmcNoCacheVirtualBase  = msmcNcVirt.base;
    OpenMP.msmcNoCacheVirtualSize  = msmcNcVirt.len;
    
    OpenMP.msmcNoCachePhysicalBase  = msmcNcPhy.base;
    
    OpenMP.ddrBase          = ddr3.base;
    OpenMP.ddrSize          = ddr3.len;
    
    
    /* Configure memory allocation using HeapOMP
     * HeapOMP handles 
     * - Memory allocation requests from BIOS components (core local memory)
     * - Shared memory allocation by utilizing the IPC module to enable 
     *   multiple cores to allocate memory out of the same heap.
     */
    var HeapOMP = xdc.useModule('ti.runtime.ompbios.HeapOMP');
    
    /* Shared Region 0 must be initialized for IPC */
    var sharedRegionId = 0;
    
    /* Size of the core local heap */
    var localHeapSize  = 0x2000;
    
    /* Size of the heap shared by all the cores */
    //var sharedHeapSize = 0x4000000;
    var sharedHeapSize = 0x100000;
    
    /* MSMCSRAM is a memory region described in the platform file (Platform.xdc) */
    var msmcmem = Program.cpu.memoryMap["MSMCSRAM"];
    
    /* Initialize a Shared Region & create a heap in the DDR3 memory region */
    var SharedRegion   = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.setEntryMeta( sharedRegionId,
                               {   base: msmcmem.base,
                                   len:  sharedHeapSize,
                                   ownerProcId: 0,
                                   cacheEnable: true,
                                   createHeap: true,
                                   isValid: true,
                                   name: "MSMC_SR0",
                               });
    
    /* Configure and setup HeapOMP */
    HeapOMP.configure(sharedRegionId, localHeapSize);
    
    
    // The function __TI_omp_reset_rtsc_mode must be called after reset
    var Reset = xdc.useModule('xdc.runtime.Reset');
    Reset.fxns.$add('&__TI_omp_reset_rtsc_mode');
    
    // __TI_omp_start_rtsc_mode configures the runtime and calls main
    var Startup = xdc.useModule('xdc.runtime.Startup');
    Startup.lastFxns.$add('&__TI_omp_initialize_rtsc_mode');
    //Startup.lastFxns.$add('&set_cache_size');
    
    
    

  • 您好,您的问题我们升级到英文论坛给美国工程师看下,链接如下:

    e2e.ti.com/.../tms320c6678-the-omp_config-cfg-file-reports-an-error

  • 您好,

    可以看下工程师的答复:

    目前应该没有方法可以通过 CCS 构建 fftlib 的选项。

    根据以下文档,GNU make 生成过程位于"/ti/fftlib_3_1_0_0/docs/doxygen/html/gnu_build.html "

    FFTLIB Build Procedure

    The FFTLIB may be compiled using GNU make following the procedure below. Note that the first three items are followed by two options, either of which may be used to accomplish the goal.

    1. Add cygwin/bin to the environment PATH (Windows only)
    2. Correct the *_INSTALL_DIR path in the makefile (two options)
      • Directly modify the makefile OR
      • Set the *_INSTALL_DIR in the environment with the proper tools path
    3. Correct the FFTLIB_INSTALL_DIR path in the makefile (two options)
      • Directly modify the makefile OR
      • Set the FFTLIB_INSTALL_DIR in the enviornment to the packages folder e.g. FFTLIB_INSTALL_DIR := /opt/ti/fftlib_k2hx_2_0_0_4/packages
    4. Build the library
      • Enter make all to build the library
      • Enter make clean to clean all generated object files and artifacts

    主软件包及其版本的是什么,其中的 fftlib-package 是其中的一部分吗?

    例如,processor SDK 6.3等。

  • fftlib库是我额外下载的,版本号是fftlib_c66x_2_0_0_2,之前文件夹里有一个fftlib_3_1_0_0但是里面导入不了例程于是就卸载了,这些是我general里面设置的内容,您的意思是我这个库的版本和要求的不匹配吗?

  • 我们跟进给工程师看下。

  • 您在哪里下载了fftlib库?能否给个链接?

  • 这里是网址:FFTLIB 驱动程序或库 | TI.com.cn请问是必须使用CCS8.3吗?

    如果不是的话,是否可以告诉我这个库怎么使用?软件型号和编译器啥的都要安装什么?能否给我一个多核并行FFT/IFFT的例程SobSobSobSob

    我现在用的版本是CCS8.3

  • 工程师尝试下载了您给出的 fftlib 版本,然后通过调整dependency package版本进行构建...您给出的 FFTLIB 封装似乎于2014年发布。

    该软件包依次包含许多较旧的软件包,如 XDC 工具和较旧的编译器版本、BIOS MCSDK 包以及一些其他库,如"ti.fftlib.platforms.ompevm6678"等..."

    相反,我们建议您使用 DSPLIB 来启用所有必要的 FIR 和 FFT 库示例程序。 这些 FFT 函数在最新的 CCS 9.3基础上成功构建。

    此 DSP LIB 是 PROCESSOR-SDK-RTOS-C667x 06_03_00_106的一部分:

    https://software-dl.ti.com/processor-sdk-rtos/esd/C667x/latest/index_FDS.html

    安装 Processor SDK 6.3后,请下载并查看位于以下路径的 FFT 示例程序列表:

    C:\ti\dsplib_c66x_3_4_0_4\packages\ti\dsplib\src\DSPF_sp_fftSPxSP_r2c

  • 好的,谢谢您,我已经放弃利用OpenMP进行多核FFT了,不过还是谢谢

  • 不客气,如果您之后需要任何技术支持,可以随时提问!