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.

TCC Allocation Issue

I am trying to incorporate ACPY3 into my project by following the exmaple of the fastCopy non-algorithm approach. When I call status = DMAN3_createChannels(0, &dmaTab, 1); I always get the error code DMAN3_EOUTOFTCCS. Here is my DMAN3 setup code that is in my .cfg file.

var ACPY3 = xdc.useModule('ti.sdo.fc.acpy3.ACPY3');
var DMAN3 = xdc.useModule('ti.sdo.fc.dman3.DMAN3');

DMAN3.heapInternal = "L1DHEAP";
DMAN3.heapExternal = "EXTERNALHEAP";

DMAN3.paRamBaseIndex = 78;
DMAN3.numPaRamEntries = 48;
DMAN3.nullPaRamIndex = 127;
DMAN3.tccAllocationMaskH = 0xffffffff;
DMAN3.tccAllocationMaskL = 0x0;
DMAN3.numTccGroup   = [6, 6, 6, 6, 6, 3];
DMAN3.numPaRamGroup = [6, 6, 6, 6, 6, 6];

DMAN3.qdmaChannels = [0, 1, 2, 3, 4, 5];
DMAN3.maxQdmaChannels = 8;
DMAN3.numQdmaChannels = 6;

For the tccAllocationMasks I have also tried:

DMAN3.tccAllocationMaskL = 0xffffffff;
DMAN3.tccAllocationMaskH = 0x0;

and

DMAN3.tccAllocationMaskH = 0xfff;
DMAN3.tccAllocationMaskL = 0x0;

Upon inspection of the DMAN3_PARAMS struct during runtime I noticed that the numTccGroup array is set to all "." . The numPaRamGroup, however, is set correctly (matches my cfg). I can change numPaRamGroup in the .cfg and runtime and observe the changes but, after everyhting I have tried, I cannot get the numTccGroup array to be anything other than all "." . I am guessing this is why I am getting the DMAN3_EOUTOFTCCS error because there are no TCC's being allocated? Can anyone shed some light on what might be my problem?

  • What version of Framework Components  are you using ?!

  • I am using FC 1.20.03

  • I looked at the code just now, and it seems fine.

    Could you share the generated ".c" file in the package/cfg/ directory where you are building your application ?!

    It will be called something like <appName>_x64P.c etc. It will have the generated C-structure called DMAN3_PARAMS.

    I would like to know what you see under numTccGroup there.

  • Here is the contents of my _x64p.c file:


    /*
     *  Do not modify this file; it is automatically
     *  generated and any modifications will be overwritten.
     *
     * @(#) xdc-t50
     */

    #define __nested__
    #define __config__

    #include <xdc/std.h>

    /*
     * ======== GENERATED SECTIONS ========
     *   
     *     MODULE INCLUDES
     *   
     *     <module-name> INTERNALS
     *     <module-name> INHERITS
     *     <module-name> VTABLE
     *     <module-name> PATCH TABLE
     *     <module-name> DECLARATIONS
     *     <module-name> OBJECT OFFSETS
     *     <module-name> TEMPLATES
     *     <module-name> INITIALIZERS
     *     <module-name> FUNCTION STUBS
     *     <module-name> PROXY BODY
     *     <module-name> OBJECT DESCRIPTOR
     *     <module-name> SYSTEM FUNCTIONS
     *     <module-name> PRAGMAS
     *   
     *     INITIALIZATION ENTRY POINT
     *     PROGRAM GLOBALS
     *     CLINK DIRECTIVES
     */


    /*
     * ======== MODULE INCLUDES ========
     */



    /*
     * ======== xdc.cfg.Program TEMPLATE ========
     */

    /*
     *  ======== __ASM__ ========
     *  Define absolute path to program's assembly directory
     */
    xdc__META(__ASM__, "@(#)__ASM__ = C:/Documents and Settings/labuser.EDN-COMPOSER/My Documents/Projects/beater_configuration/Default/configPkg/package/cfg/beater_configuration_x64P");

    /*
     *  ======== __ISA__ ========
     *  Define the ISA of this executable.  This symbol is used by platform
     *  specific "exec" commands that support more than one ISA; e.g., gdb
     */
    xdc__META(__ISA__, "@(#)__ISA__ = 64P");

    /*
     *  ======== __PLAT__ ========
     *  Define the name of the platform that can run this executable.  This
     *  symbol is used by platform independent "exec" commands
     */
    xdc__META(__PLAT__, "@(#)__PLAT__ = ti.platforms.evmDM648");

    /*
     *  ======== __TARG__ ========
     *  Define the name of the target used to build this executable.
     */
    xdc__META(__TARG__, "@(#)__TARG__ = ti.targets.C64P");

    /*
     *  ======== __TRDR__ ========
     *  Define the name of the class that can read/parse this executable.
     */
    xdc__META(__TRDR__, "@(#)__TRDR__ = ti.targets.omf.cof.Coff");


    /*
     * ======== ti.sdo.fc.dman3.DMAN3 TEMPLATE ========
     */


    /* C code contribution from ti/sdo/fc/dman3/DMAN3.xdt */

    #include <xdc/std.h>

    #include <ti/sdo/fc/dman3/dman3.h>
    #include <ti/sdo/fc/acpy3/acpy3.h>

    #if 20 > DMAN3_MAXGROUPS
    #error DMAN3 internal assertion:  const DMAN3.MAXGROUPS larger than header const
    #endif

    far Uns DMAN3_QDMA_CHANNELS[6] = {
        0,
        1,
        2,
        3,
        4,
        5
    };

    extern Void  _DMAN3_initInternal();
    extern Void  _DMAN3_initImpl(Void);



    /*
     *  ======== DMAN3_init  ========
     */
    Void DMAN3_init(Void)
    {
        extern far DMAN3_Params DMAN3_PARAMS;

        /* BIOS heap labels */
        extern far Int L1DHEAP;
        extern far Int EXTERNALHEAP;

        DMAN3_PARAMS.heapInternal = L1DHEAP;
        DMAN3_PARAMS.heapExternal = EXTERNALHEAP;

        _DMAN3_initImpl();
    }


    /*
     *  ======== DMAN3_CE_init  ========
     *  Supplied to support legacy Codec Engine Frameworks. To be deprecated in the future.
     */
    Void DMAN3_CE_init()
    {
        DMAN3_init();
        ACPY3_init();
    }

    /*
     *  ======== DMAN3_CE_exit  ========
     *  Supplied to support legacy Codec Engine Frameworks. To be deprecated in the future.
     */
    Void DMAN3_CE_exit()
    {
        DMAN3_exit();
        ACPY3_exit();
    }

    /*
     *  ======== DMAN3_PARAMS ========
     *  Default module configuration structure for DMAN3 implementation.
     *  It is set at design time by the system integrator to adjust the behaviour
     *  of the module to be optimal for its execution environment.
     */
    DMAN3_Params DMAN3_PARAMS = {

        /* qdmaPaRamBase: Physical base address for PARAM0 */
        (Uns *)0x1c04000,

        /* The maxPaRamEntries:  Total number of PARAM Table entries on the
         * hardware (eg, for IVA2 this is 128, for Himalaya, this is 256).
         */
        128,

        /*
         * paRamBaseIndex: (0>value>255) represents the first PARAM TABLE ENTRY
         * NUMBER that is assigned by configuration for exclusive DMAN3 allocation.
         */
        78,

        /*
         * numPaRamEntries:  number of PARAM Table entries starting at
         * DMAN3_PARAM_BASE_INDEX assigned by configuration for exclusive DMAN3
         * allocation.
         */
        48,

        /* maxQdmaChannels:  contains the total number of Physical QDMA channels
         * available on the hardware (eg, 8 for DaVinci, 4 for IVA2).
         */
        8,

        /*
         * numQdmaChannels: contains the number of Physical QDMA channels
         * that are assigned to DMAN3 via configuration.
         * qdmaChannels: array containing list of DMAN3_NUM_QDMA_CHANNELS
         * many Physical QDMA channels assigned to DMAN3 via configuration.
         */
        6,
        DMAN3_QDMA_CHANNELS,

        /*
         * tccAllocationMaskH and tccAllocationMaskL:  are 32-bit bitmasks
         * representing configuration provided list of TCCs for exclusive DMAN3
         * allocation.
         *
         * For example, for TCC's in the range 0-31 the Low Mask (tccAllocationMaskL)
         * is configured so that a '1' in bit position 'i' indicates the TCC 'i' is
         * assigned to DMAN3
         */
        0xffffffff,
        0x0,

         /*
          * heapInternal: BIOS Heap ID for dynamic allocation of DMAN3 objects
          * must be allocated in L1D Internal RAM.
          * heapExternal: BIOS Heap ID for dyn allocation of private DMAN3
          * data structures.
          *
          * A value of -1 indicates that the heap is NOT DEFINED.
          */
        -1, //L1DHEAP,
        0,  //EXTERNALHEAP,

        /* numTccGroup[DMAN3_MAXGROUPS] */
        {
        6,
        6,
        6,
        6,
        6,
        3,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
        },

        /* numPaRamGroup[DMAN3_MAXGROUPS] */
        {
        6,
        6,
        6,
        2,
        6,
        6,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
        },

        /* idma3Internal */
        1,

        /* scratchAllocFxn */
        NULL,

        /* scratchFreeFxn */
        NULL,

        /* nullPaRamIndex */
        127,
    };


    /*
     * ======== PROGRAM GLOBALS ========
     */


    /*
     * ======== CLINK DIRECTIVES ========
     */

    #ifdef __ti__
    #define PRAGMA(x) _Pragma(#x)
    #define xdc__clink_constant(var) \
    PRAGMA(DATA_SECTION(var, ".const:" #var))  \
    asm("   .sect \".const:" #var "\"\n"  \
      "   .clink\n"  \
      "   .sect \"[0].const:" #var "\"\n"  \
      "   .clink\n"  \
      "   .sect \"[1].const:" #var "\"\n"  \
      "   .clink")

    #endif


    It shows that it is being set correctly in there. I notice that it is saying the L1DHEAP is not defined but I have it defined in my .tcf file.

    I have attached screenshots of dmaTab and DMAN3_PARAMS after calling  "status = DMAN3_createChannels(0, &dmaTab, 1);"

     

  • Well it turns out the numTccGroup is being set correctly... I just had to change the display format to Hex. I didn't do that before because I figured it was just displaying the ASCII character for the value which would have been 0x2E. This, however, makes the out of tcc's error make even less sense...