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.

AM572x Core Number?

Is there a preferred API to use to get the current core number of an operating DSP core?  I tried DNUM but that was not found by the compiler and I don't see it in the TRM.  I ended up using Mutliproc_self() but that seems odd to use IPC for something so basic.

  • DNUM relates to a single Core-PAC with multiple cores. These are two Core-PACs each with one core. So they are both considered "Core 0".

    The expectation here is to read the DSP_SYS_HWINFO register. Each DSP can see its own DSP_SYS_HWINFO register at address 0x01D0 0004. The least significant nibble identifies which DSP subsystem it is.
  • Good info Brad, thanks. I see that in the TRM now.

    How do we access this from our C code? I could not find DSP_SYS_HWINFO defined in any file in my C:\ti directory path.
  • How about like this:

    #define DSP_SYS_HWINFO *(volatile unsigned int*)0x01D00004

  • Sure, I can do this also, int corenum = *(unsigned int*)(0x01D00004); //DSP_SYS_HWINFO

    I guess I was expecting a much needed system level variable like this to have a built in API for the user.
  • I'll make the suggestion to the software team, but for now I think you've got the idea.
  • Hi Chirs,

    We have put in a request to add an API to get the DSP core number as an update to the CSL release.

    The DSP system register base address is defined in the file cslr_soc_dsp_baseaddress.h as the macro CSL_DSP_DSP_SYSTEM_REGS and the DSP system register set has been defined in the file cslr_cgem_system.h. 

    If you add a define for a register handle as shown below

     #define hCgem_system     ((CSL_CgemSystemRegs*)CSL_DSP_DSP_SYSTEM_REGS)

    you can access all the registers in the DSP system register space.

    I will post an update when we get a confirmation that an API has been added to the AM572xx CSL for this function.

    Regards,

    Rahul

  • Chris,

    After consulting with the development team, I found out that there is an API defined for finding the core number in the CSL that uses DNUM for the C66x cores. The usage has been demonstrated in the PCIE sample code in the PDK package. Please refer to the file pcie_sample.c. The code that I am referring to is as given below:

    uint32_t coreNum;

    /* Get the core number. */
    coreNum = CSL_chipReadReg(CSL_CHIP_DNUM);

    Inorder to use this function, you need to link to ti.csl.ae66 library found in the path pdk_am57xx_1_0_1\packages\ti\csl\lib\am572x\c66 and include the header file #include <ti\csl\csl_chip.h>.

    I have tested the code and also the other approach suggested by Brad and me in the earlier post.
    Please let us know if you find any issues.

    Regards,
    Rahul

  • Tried it out and appears to work just fine. Thanks. Embarrassing part is I've worked on the PCIe demo quite a bit and never noticed that code.